Skip to content

Commit 481b87f

Browse files
ryncsnjohannbg
authored andcommitted
fix(dracut-initramfs-restore.sh): initramfs detection not working
The path detection is not working on latest Fedora and some other distros, and it fails to extract the initramfs. It seems the if statement is broken by a previous commit, so let's fix it. Fixes: 3d8e1ad ('fix(dracut-initramfs-restore.sh): add missing default paths') Signed-off-by: Kairui Song <[email protected]>
1 parent 928252a commit 481b87f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

dracut-initramfs-restore.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ fi
2727

2828
mount -o ro /boot &> /dev/null || true
2929

30-
if [[ -d /efi/loader/entries ]] || [[ -L /efi/loader/entries ]] \
31-
|| [[ -d /efi/$MACHINE_ID ]] || [[ -L /efi/$MACHINE_ID ]]; then
30+
if [[ -d /efi/loader/entries || -L /efi/loader/entries ]] \
31+
&& [[ -d /efi/$MACHINE_ID || -L /efi/$MACHINE_ID ]]; then
3232
IMG="/efi/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
33-
elif [[ -d /boot/loader/entries ]] || [[ -L /boot/loader/entries ]] \
34-
|| [[ -d /boot/$MACHINE_ID ]] || [[ -L /boot/$MACHINE_ID ]]; then
33+
elif [[ -d /boot/loader/entries || -L /boot/loader/entries ]] \
34+
&& [[ -d /boot/$MACHINE_ID || -L /boot/$MACHINE_ID ]]; then
3535
IMG="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
36-
elif [[ -d /boot/efi/loader/entries ]] || [[ -L /boot/efi/loader/entries ]] \
37-
|| [[ -d /boot/efi/$MACHINE_ID ]] || [[ -L /boot/efi/$MACHINE_ID ]]; then
36+
elif [[ -d /boot/efi/loader/entries || -L /boot/efi/loader/entries ]] \
37+
&& [[ -d /boot/efi/$MACHINE_ID || -L /boot/efi/$MACHINE_ID ]]; then
3838
IMG="/boot/efi/$MACHINE_ID/$KERNEL_VERSION/initrd"
3939
elif [[ -f /lib/modules/${KERNEL_VERSION}/initrd ]]; then
4040
IMG="/lib/modules/${KERNEL_VERSION}/initrd"

0 commit comments

Comments
 (0)