Skip to content

Commit

Permalink
grub_install: Remove core grub modules from EFI partition
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Adrian Vladu <[email protected]>
  • Loading branch information
jepio authored and ader1990 committed Jun 19, 2024
1 parent 630add5 commit 75c79df
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions build_library/grub_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 75c79df

Please sign in to comment.