grub_install: Remove core grub modules from EFI partition for i386-pc

The image also boots on Hyper-V Generation 1 VM (BIOS) if the modules
are removed.

Signed-off-by: Adrian Vladu <avladu@cloudbasesolutions.com>
This commit is contained in:
Adrian Vladu 2024-06-20 15:05:37 +03:00
parent 0624d8cc4a
commit e7d9faadc8

View File

@ -183,11 +183,9 @@ sudo grub-mkimage \
--output "${ESP_DIR}/${GRUB_DIR}/${CORE_NAME}" \
"${CORE_MODULES[@]}"
if [[ "${FLAGS_target}" != i386-pc ]]; then
for mod in "${CORE_MODULES[@]}"; do
sudo rm "${ESP_DIR}/${GRUB_DIR}/${mod}.mod"
done
fi
for mod in "${CORE_MODULES[@]}"; do
sudo rm "${ESP_DIR}/${GRUB_DIR}/${mod}.mod"
done
# Now target specific steps to make the system bootable
case "${FLAGS_target}" in