2015-07-10 15:54:24 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2015-07-11 12:20:04 +00:00
|
|
|
COMMAND="$1"
|
|
|
|
KVER="$2"
|
2018-02-27 22:19:50 +00:00
|
|
|
BOOT_DIR_ABS="$3"
|
2015-07-11 12:20:04 +00:00
|
|
|
|
|
|
|
case "$COMMAND" in
|
|
|
|
add)
|
2018-03-27 17:20:36 +00:00
|
|
|
# use newer image if available
|
|
|
|
if [ -e "$BOOT_DIR_ABS"/initrd ]; then
|
|
|
|
cp -u "$BOOT_DIR_ABS"/initrd "/boot/initramfs-${KVER}.img"
|
|
|
|
fi
|
2018-02-27 22:19:50 +00:00
|
|
|
if [ ! -e "/boot/initramfs-${KVER}.img" ]; then
|
2018-03-27 17:20:36 +00:00
|
|
|
dracut "/boot/initramfs-${KVER}.img" "$KVER"
|
2018-02-27 22:19:50 +00:00
|
|
|
fi
|
2015-07-11 12:20:04 +00:00
|
|
|
;;
|
|
|
|
remove)
|
|
|
|
rm -f "/boot/initramfs-${KVER}.img"
|
|
|
|
;;
|
|
|
|
esac
|
2015-09-26 00:54:32 +00:00
|
|
|
if [ -x /usr/sbin/grub2-mkconfig ]; then
|
2019-12-19 04:33:34 +00:00
|
|
|
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
|
2015-09-26 00:54:32 +00:00
|
|
|
fi
|