Skip to content

build GRUB with optimizations and don't ship tools or modules - #163

Merged
bcressey merged 2 commits into
bottlerocket-os:developfrom
bcressey:grub-fixes
May 29, 2025
Merged

build GRUB with optimizations and don't ship tools or modules#163
bcressey merged 2 commits into
bottlerocket-os:developfrom
bcressey:grub-fixes

Conversation

@bcressey

@bcressey bcressey commented May 28, 2025

Copy link
Copy Markdown
Contributor

Issue number:
Fixes #161, fixes #162

Description of changes:
Drop the tools and modules subpackages, as they're not used and shouldn't be used downstream.

Build GRUB with -Os, as upstream intends and like other distros do.

Testing done:
Verified that both EC2 instances and VMware guests could boot in both EFI and BIOS modes.

The GRUB images are around 30% smaller.

# before
-rwxr-xr-x. 1 root root 1340912 May 16 00:40 /boot/efi/EFI/BOOT/grubaa64.efi
-rwxr-xr-x. 1 root root 1123824 May 16 00:39 /boot/efi/EFI/BOOT/grubx64.efi

# after
-rwxr-xr-x. 1 root root 947688 May 28 18:50 /boot/efi/EFI/BOOT/grubaa64.efi
-rwxr-xr-x. 1 root root 763368 May 28 18:47 /boot/efi/EFI/BOOT/grubx64.efi

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

Ben Cressey added 2 commits May 28, 2025 22:46
The tools and modules are only expected to be used at build time, to
create the final bootloader images.

Signed-off-by: Ben Cressey <bcressey@amazon.com>
`-Os` is the default if TARGET_CFLAGS is not set in the environment.
Add it to avoid building without any optimizations at all.

Signed-off-by: Ben Cressey <bcressey@amazon.com>
@bcressey
bcressey requested review from arnaldo2792 and rpkelly May 28, 2025 23:04
@bcressey
bcressey merged commit 4982d16 into bottlerocket-os:develop May 29, 2025
@bcressey
bcressey deleted the grub-fixes branch May 29, 2025 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

remove GRUB tools and modules build GRUB with optimizations

3 participants