kernel-install: use up to date initramfs

During installation, /usr/lib/kernel/install.d/50-dracut.install
generate initramfs in $BOOT_DIR_ABS. It is important to use that one,
even if there is one in /boot/initramfs-*.img already, because it was
generated later and contains all required config files (including
keyboard layout for entering LUKS passphrase).

This fixes d1f3be0eed "kernel-install:
avoid creating initramfs multiple times".

Fixes QubesOS/qubes-issues#3234
This commit is contained in:
Marek Marczykowski-Górecki 2018-03-27 19:20:36 +02:00
parent 7c1cad00b0
commit bcf7c9e978
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -6,12 +6,12 @@ BOOT_DIR_ABS="$3"
case "$COMMAND" in case "$COMMAND" in
add) add)
# use newer image if available
if [ -e "$BOOT_DIR_ABS"/initrd ]; then
cp -u "$BOOT_DIR_ABS"/initrd "/boot/initramfs-${KVER}.img"
fi
if [ ! -e "/boot/initramfs-${KVER}.img" ]; then if [ ! -e "/boot/initramfs-${KVER}.img" ]; then
if [ -e "$BOOT_DIR_ABS"/initrd ]; then dracut "/boot/initramfs-${KVER}.img" "$KVER"
cp "$BOOT_DIR_ABS"/initrd "/boot/initramfs-${KVER}.img"
else
dracut "/boot/initramfs-${KVER}.img" "$KVER"
fi
fi fi
;; ;;
remove) remove)