From fb00e9e94b125a94777d83d435057e1332a7c676 Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Sun, 26 Feb 2023 11:44:58 -0800 Subject: [PATCH] cmd/mkinitfs: don't compress initramfs-extra (MR 25) There is little(?) reason to compress the -extra archive, but some there are some good reasons why it should be left uncompressed: 1) decompression increases boot time 2) selecting exotic formats (e.g. lzma or zstd) can actually increase the initramfs size since you now have to include support for those archive formats In the future this could be made configurable... --- cmd/mkinitfs/main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/mkinitfs/main.go b/cmd/mkinitfs/main.go index f668660..4b57c1e 100644 --- a/cmd/mkinitfs/main.go +++ b/cmd/mkinitfs/main.go @@ -111,7 +111,10 @@ func main() { return } - if err := generateArchive("initramfs-extra", compressionFormat, compressionLevel, workDir, []filelist.FileLister{ + // Note: compression disabled for initramfs-extra, since it slows down boot + // and can add more requirements to the initramfs (e.g. need to add support + // for extracting zstd) + if err := generateArchive("initramfs-extra", archive.FormatNone, archive.LevelDefault, workDir, []filelist.FileLister{ hookfiles.New("/usr/share/mkinitfs/files-extra"), hookfiles.New("/etc/mkinitfs/files-extra"), hookscripts.New("/usr/share/mkinitfs/hooks-extra"),