-
Notifications
You must be signed in to change notification settings - Fork 56
rely on udev to manage symlinks, closes #2 #3
Conversation
* uses `xvd` notation to match Ubuntu default for Xen virtual devices * uses [:space:] character set to delete all whitespace * move script to `/usr/local/sbin` as this is a system script
@@ -1,10 +1,21 @@ | |||
#!/bin/bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of this file doesn't match the udev rule reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Just submitted a fix.
It would probably be nice to update the README as well to make sure the explanation match the actual provided files. |
Using this PR I still get the wrong devices for the root device:
when it should be
(note that I don't have the xvdb mounted anywhere, was just adding another block device) The vendor specific info says sda1 for the device that ends up on Should there be a |
@@ -1,10 +1,21 @@ | |||
#!/bin/bash | |||
# Inspired by https://github.com/oogali/ebs-automatic-nvme-mapping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this comment block was from your gist, I don't think this needs to be incorporated upstream.
( test -b "${blkdev}" && test -L "${mapping}" ) || ln -s "${blkdev}" "${mapping}" | ||
fi | ||
done | ||
if [[ -x /usr/sbin/nvme ]] && [[ -b ${1} ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If your test conditions are not matched, this script will silently fail (with a return value of zero).
A better option would be to invert the test conditions, as to be loud and verbose that we can't find the nvme
program and that a required argument is missing.
# use `xvd` prefix instead of `sd` | ||
# remove all trailing space | ||
nvme_link=$( \ | ||
/usr/sbin/nvme id-ctrl --raw-binary "${1}" | \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the required argument passed is not a valid path to a block device -- should we complain? Or should we let nvme
complain and have the user decipher its error message?
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
xvd
notation to match Ubuntu default for Xen virtual devices/usr/local/sbin
as this is a system script