Skip to content

Commit d8b4d03

Browse files
committed
fix patterns in udev rule to work for multiple digits again
also fix paths in `ebs-nvme-mapping.sh` this had previously been fixed in oogali#3 but it was changed before it was merged. then I tried to fix it again in oogali#8 but missed some of the digits rebased on top of @pforman-zymergen's PR oogali#13 because I want that binary check but udev needs the full paths
1 parent 4c8e038 commit d8b4d03

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

999-aws-ebs-nvme.rules

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
SUBSYSTEM=="block", KERNEL=="nvme[0-9]*n1", ATTRS{model}=="Amazon Elastic Block Store", PROGRAM+="/usr/local/sbin/ebs-nvme-mapping.sh /dev/%k" SYMLINK+="%c"
1+
SUBSYSTEM=="block", KERNEL=="nvme[0-9]*n[0-9]*", ATTRS{model}=="Amazon Elastic Block Store", PROGRAM+="/usr/local/sbin/ebs-nvme-mapping.sh /dev/%k" SYMLINK+="%c"

ebs-nvme-mapping.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
# To be used with the udev rule: /etc/udev/rules.d/999-aws-ebs-nvme.rules
33

4-
if [[ -z $(command -v nvme) ]]; then
4+
if [[ -z $(command -v /usr/sbin/nvme) ]]; then
55
echo "ERROR: NVME tools not installed." >> /dev/stderr
66
exit 1
77
fi
@@ -16,9 +16,9 @@ fi
1616
# use `xvd` prefix instead of `sd`
1717
# remove all trailing space
1818
nvme_link=$( \
19-
nvme id-ctrl --output binary "${1}" | \
20-
cut -c3073-3104 | \
21-
sed 's/^\/dev\///g'| \
22-
tr -d '[:space:]' \
19+
/usr/sbin/nvme id-ctrl --output binary "${1}" | \
20+
/usr/bin/cut -c3073-3104 | \
21+
/bin/sed 's/^\/dev\///g'| \
22+
/usr/bin/tr -d '[:space:]' \
2323
);
2424
echo $nvme_link;

0 commit comments

Comments
 (0)