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 <jlecuirot@microsoft.com>
This commit is contained in:
James Le Cuirot 2024-11-14 16:14:42 +00:00
parent 93cbba765d
commit 945014691b
No known key found for this signature in database
GPG Key ID: 1226415D00DD3137
2 changed files with 4 additions and 3 deletions

View File

@ -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" \

View File

@ -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.