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=""