4a88c520ac
Since EFI boot now also use grub2, update its config too when present. Reported-by: @JarrahG QubesOS/qubes-issues#4902
29 lines
706 B
Bash
Executable File
29 lines
706 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
|
|
if [ -e /boot/grub2/grub.cfg ]; then
|
|
grub2-mkconfig -o /boot/grub2/grub.cfg
|
|
fi
|
|
if [ -e /boot/efi/EFI/qubes/grub.cfg ]; then
|
|
grub2-mkconfig -o /boot/efi/EFI/qubes/grub.cfg
|
|
fi
|
|
fi
|