From 945014691b11c08c9455e19c46b72a151cb5063c Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Thu, 14 Nov 2024 16:14:42 +0000 Subject: [PATCH] grub_install.sh: Compress modules with xz instead of gzip to save space Giving the --best or -9 option results in a heavier decompression cost with no gain on such small files. Signed-off-by: James Le Cuirot --- build_library/grub_install.sh | 6 +++--- changelog/changes/2024-11-18-grub-modules.md | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build_library/grub_install.sh b/build_library/grub_install.sh index cbe2958b96..840dbdd029 100755 --- a/build_library/grub_install.sh +++ b/build_library/grub_install.sh @@ -41,7 +41,7 @@ switch_to_strict_mode GRUB_DIR="flatcar/grub/${FLAGS_target}" # Modules required to boot a standard CoreOS configuration -CORE_MODULES=( normal search test fat part_gpt search_fs_uuid gzio search_part_label terminal gptprio configfile memdisk tar echo read btrfs ) +CORE_MODULES=( normal search test fat part_gpt search_fs_uuid xzio search_part_label terminal gptprio configfile memdisk tar echo read btrfs ) SBAT_ARG=() @@ -137,7 +137,7 @@ case "${FLAGS_target}" in [[ ${file} == ${GRUB_SRC}/${core_mod}.mod ]] && continue 2 done out="${ESP_DIR}/${GRUB_DIR}/${file##*/}" - gzip --best --stdout "${file}" | sudo_clobber "${out}" + xz --stdout "${file}" | sudo_clobber "${out}" done ;; esac @@ -178,7 +178,7 @@ fi info "Generating ${GRUB_IMAGE}" sudo grub-mkimage \ - --compression=auto \ + --compression=xz \ --format "${FLAGS_target}" \ --directory "${GRUB_SRC}" \ --config "${ESP_DIR}/${GRUB_DIR}/load.cfg" \ diff --git a/changelog/changes/2024-11-18-grub-modules.md b/changelog/changes/2024-11-18-grub-modules.md index ed8f3d096b..043c3b7d7e 100644 --- a/changelog/changes/2024-11-18-grub-modules.md +++ b/changelog/changes/2024-11-18-grub-modules.md @@ -1 +1,2 @@ - Additional GRUB modules are no longer installed for UEFI platforms to save space and also because they cannot be loaded with Secure Boot enabled. This does not affect existing installations. +- The GRUB modules on non-UEFI platforms are now compressed with xz rather than gzip to save even more space. This does not affect existing installations.