From 0624d8cc4ad279b60fc5461bb865e21b04f9c117 Mon Sep 17 00:00:00 2001 From: Jeremi Piotrowski Date: Thu, 25 Apr 2024 10:30:31 +0000 Subject: [PATCH] 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 Signed-off-by: Adrian Vladu --- build_library/grub_install.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build_library/grub_install.sh b/build_library/grub_install.sh index 6661e021d8..6426dea9f0 100755 --- a/build_library/grub_install.sh +++ b/build_library/grub_install.sh @@ -183,6 +183,12 @@ 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 + # Now target specific steps to make the system bootable case "${FLAGS_target}" in i386-pc)