
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 fixesd1f3be0eed
"kernel-install: avoid creating initramfs multiple times". Fixes QubesOS/qubes-issues#3234 (cherry picked from commitbcf7c9e978
)
24 lines
543 B
Bash
Executable File
24 lines
543 B
Bash
Executable File
#!/bin/sh
|
|
|
|
COMMAND="$1"
|
|
KVER="$2"
|
|
BOOT_DIR_ABS="$3"
|
|
|
|
case "$COMMAND" in
|
|
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
|
|
dracut "/boot/initramfs-${KVER}.img" "$KVER"
|
|
fi
|
|
;;
|
|
remove)
|
|
rm -f "/boot/initramfs-${KVER}.img"
|
|
;;
|
|
esac
|
|
if [ -x /usr/sbin/grub2-mkconfig ]; then
|
|
grub2-mkconfig -o /boot/grub2/grub.cfg
|
|
fi
|