diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2024-11-01 21:27:08 +0100 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2024-11-02 20:43:19 +0100 |
commit | 29a8e71d9c0858aef502f091a0ef58d5569b1c70 (patch) | |
tree | d216dcb3ea6ad79b80c871edda9dc990ff920f37 /test/units/TEST-17-UDEV.06.sh | |
parent | pam: quiet a spurious debug message (diff) | |
download | systemd-29a8e71d9c0858aef502f091a0ef58d5569b1c70.tar.xz systemd-29a8e71d9c0858aef502f091a0ef58d5569b1c70.zip |
TEST-17-UDEV: Don't hardcode root device name
There's no guarantee the root device will be /dev/sda, so let's use
bootctl to get the actual path instead of harcoding it.
Diffstat (limited to 'test/units/TEST-17-UDEV.06.sh')
-rwxr-xr-x | test/units/TEST-17-UDEV.06.sh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/units/TEST-17-UDEV.06.sh b/test/units/TEST-17-UDEV.06.sh index 6d83645303..c9493becbd 100755 --- a/test/units/TEST-17-UDEV.06.sh +++ b/test/units/TEST-17-UDEV.06.sh @@ -46,8 +46,10 @@ EOF check -MAJOR=$(udevadm info /dev/sda | grep -e '^E: MAJOR=' | sed -e 's/^E: MAJOR=//') -MINOR=$(udevadm info /dev/sda | grep -e '^E: MINOR=' | sed -e 's/^E: MINOR=//') +ROOTDEV="$(bootctl -RR)" + +MAJOR="$(udevadm info "$ROOTDEV" | grep -e '^E: MAJOR=' | sed -e 's/^E: MAJOR=//')" +MINOR="$(udevadm info "$ROOTDEV" | grep -e '^E: MINOR=' | sed -e 's/^E: MINOR=//')" test -L "/run/udev/watch/b${MAJOR}:${MINOR}" cat >/run/udev/rules.d/50-testsuite.rules <<EOF @@ -56,8 +58,8 @@ EOF check -MAJOR=$(udevadm info /dev/sda | grep -e '^E: MAJOR=' | sed -e 's/^E: MAJOR=//') -MINOR=$(udevadm info /dev/sda | grep -e '^E: MINOR=' | sed -e 's/^E: MINOR=//') +MAJOR="$(udevadm info "$ROOTDEV" | grep -e '^E: MAJOR=' | sed -e 's/^E: MAJOR=//')" +MINOR="$(udevadm info "$ROOTDEV" | grep -e '^E: MINOR=' | sed -e 's/^E: MINOR=//')" test ! -e "/run/udev/watch/b${MAJOR}:${MINOR}" rm /run/udev/rules.d/00-debug.rules |