Skip to content

Commit

Permalink
cloud_storage_udev_rules: Tweaks for RHEL 7
Browse files Browse the repository at this point in the history
This commit captures alterations from the original CoreOS script.
  • Loading branch information
mbarnes committed Jan 14, 2019
1 parent 550ed5f commit 75fdf39
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace_id() {
# see https://github.com/coreos/bugs/issues/2399.
devname() {
check_udev_aws
RAWVOL=$(nvme id-ctrl --raw-binary "$1" | cut -c3073-3104 | tr -s ' ' | sed 's/ $//g')
RAWVOL=$(/usr/sbin/nvme id-ctrl --raw-binary "$1" | cut -c3073-3104 | tr -s ' ' | sed 's/ $//g')
VOL="${RAWVOL#/dev/}"
if [[ -n "$VOL" ]]; then
echo "${VOL}"
Expand All @@ -31,8 +31,8 @@ devname() {
# Ensure this is run with proper environment populated by udev,
# and acting on an AWS EBS device.
check_udev_aws() {
if [ "${ID_MODEL}" != "Amazon Elastic Block Store" ]; then
echo 'Stopping due to non-matching ID_MODEL env variable'
if [[ "${ID_SERIAL}" != "Amazon Elastic Block Store"* ]]; then
echo 'Stopping due to non-matching ID_SERIAL env variable'
exit 1
fi
}
Expand Down

0 comments on commit 75fdf39

Please sign in to comment.