]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(lsinitrd.sh): always check that MACHINE_ID is not empty
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Tue, 3 May 2022 13:37:42 +0000 (15:37 +0200)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Tue, 3 May 2022 22:12:13 +0000 (22:12 +0000)
lsinitrd.sh

index 4175e4d8cf153ec7d9a477ca197f5d9912a70b0a..39be169df75d8a3c1f402afcedab77cafd0292be 100755 (executable)
@@ -133,9 +133,11 @@ else
         image="/lib/modules/${KERNEL_VERSION}/initrd"
     elif [[ -f /boot/initramfs-${KERNEL_VERSION}.img ]]; then
         image="/boot/initramfs-${KERNEL_VERSION}.img"
-    elif mountpoint -q /efi; then
+    elif [[ $MACHINE_ID ]] \
+        && mountpoint -q /efi; then
         image="/efi/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
-    elif mountpoint -q /boot/efi; then
+    elif [[ $MACHINE_ID ]] \
+        && mountpoint -q /boot/efi; then
         image="/boot/efi/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
     else
         image=""