From 17fb8b14fe01b60b4192a80a5a8d523d8d848bda Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Wed, 10 Jan 2024 22:35:30 +0900 Subject: [PATCH] Switch memdisk compression to lzop xz decompression is very slow and slows down boot by around 5 seconds on aarch64/Apple M1 when using the default font. Switch to lzop, which takes less than one second to uncompress. This increases EFI core image size by around 11%. Signed-off-by: Hector Martin --- grub.macros | 6 +++--- grub2.spec | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/grub.macros b/grub.macros index 0198ffc..241baf8 100644 --- a/grub.macros +++ b/grub.macros @@ -419,7 +419,7 @@ rm -f %{1}.conf \ %define efi_mkimage() \ mkdir -p memdisk/fonts \ cp %{4}/unicode.pf2 memdisk/fonts \ -mksquashfs memdisk memdisk.squashfs -comp xz \ +mksquashfs memdisk memdisk.squashfs -comp lzo \ %{4}./grub-mkimage -O %{1} -o %{2}.orig \\\ -d grub-core \\\ --sbat %{4}./sbat.csv \\\ @@ -448,14 +448,14 @@ mksquashfs memdisk memdisk.squashfs -comp xz \ %define ieee1275_mkimage() \ mkdir -p memdisk/fonts \ cp %{5}/unicode.pf2 memdisk/fonts \ -mksquashfs memdisk memdisk.squashfs -comp xz \ +mksquashfs memdisk memdisk.squashfs -comp lzo \ ./grub-mkimage -O %{1} -o %{2} -p '/grub2' -d grub-core ${GRUB_MODULES} \ %{nil} %else %define ieee1275_mkimage() \ mkdir -p memdisk/fonts \ cp %{5}/unicode.pf2 memdisk/fonts \ -mksquashfs memdisk memdisk.squashfs -comp xz \ +mksquashfs memdisk memdisk.squashfs -comp lzo \ APPENDED_SIG_SIZE=0 \ if [ -x /usr/bin/rpm-sign ]; then \ touch empty.unsigned \ diff --git a/grub2.spec b/grub2.spec index 2a56551..a72f3f6 100644 --- a/grub2.spec +++ b/grub2.spec @@ -17,7 +17,7 @@ Name: grub2 Epoch: 1 Version: 2.06 -Release: 112%{?dist} +Release: 113%{?dist} Summary: Bootloader with support for Linux, Multiboot and more License: GPLv3+ URL: http://www.gnu.org/software/grub/ @@ -554,6 +554,9 @@ mv ${EFI_HOME}/grub.cfg.stb ${EFI_HOME}/grub.cfg %endif %changelog +* Sat Jan 13 2024 Hector Martin - 2.06-113 +- Switch memdisk compression to lzop + * Thu Jan 11 2024 Daan De Meyer - 2.06-112 - Don't obsolete the tools package with minimal