From d6343146c1db69fc724ca666a5d9321af7fd0d46 Mon Sep 17 00:00:00 2001 From: Antonio Alvarez Feijoo Date: Tue, 3 May 2022 15:37:42 +0200 Subject: [PATCH] fix(lsinitrd.sh): always check that MACHINE_ID is not empty --- lsinitrd.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lsinitrd.sh b/lsinitrd.sh index 4175e4d8cf..39be169df7 100755 --- a/lsinitrd.sh +++ b/lsinitrd.sh @@ -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=""