
Remove also EFI version of BootLoader Specification dirs. This will:
- really force to re-generate initramfs during installation, after all
relevant configs are updated; previously, dracut (called by anaconda
through kernel-install) refuse to update already existing
/boot/efi/.../initrd file.
- save some precious space in /boot/efi
Fixes QubesOS/qubes-issues#3234
(cherry picked from commit 53730c4ba2
)
22 lines
921 B
Bash
Executable File
22 lines
921 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# The Boot Loader Specification is not useful for Qubes OS, because it handles
|
|
# only direct Linux boot, not Xen or any other multiboot application (like
|
|
# tboot).
|
|
# Because of that Qubes OS still uses generated grub2 configuration.
|
|
# Unfortunately the sole existence of /boot/${MACHINE_ID} changes behaviour of
|
|
# some tools - for example default output file in dracut. So forcibly remove
|
|
# the directory (which was just created...).
|
|
|
|
[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
|
|
|
|
if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then
|
|
rm -rf /boot/${MACHINE_ID}
|
|
fi
|
|
if [[ $MACHINE_ID ]] && ( [[ -d /boot/efi/${MACHINE_ID} ]] || [[ -L /boot/efi/${MACHINE_ID} ]] ); then
|
|
rm -rf /boot/efi/${MACHINE_ID}
|
|
rm -f /boot/efi/loader/entries/${MACHINE_ID}-*.conf
|
|
# remove only when empty
|
|
rmdir /boot/efi/loader/entries /boot/efi/loader || :
|
|
fi
|