grub_install: Remove core grub modules from EFI partition

Since we build them into the grub executable, they are not needed on
disk. The only case I am unsure of is legacy BIOS boot, so left those
on disk.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
Signed-off-by: Adrian Vladu <avladu@cloudbasesolutions.com>
This commit is contained in:
Jeremi Piotrowski 2024-04-25 10:30:31 +00:00 committed by Adrian Vladu
parent 14f1c4f735
commit 0624d8cc4a

View File

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