From 03d8f93c9517230adabaaa1cb9b3fcf53dd50af5 Mon Sep 17 00:00:00 2001 From: Thierry Laurion Date: Thu, 31 Aug 2023 11:14:33 -0400 Subject: [PATCH] modules/zstd: now included by default. Deactivated under legacy-flash boards Rationale: cpio -t alone cannot extract initrd past early cpio (microcode) in most packed initrd. unpack_initramfs.sh already under master comes to the rescue, but its usage up to today was limited to pass firmware blobs to final OS under boards/librem_mini_v2 Debian OSes (and probably others) need to have cryptroot/crypttab overriden directly, otherwise generic generation of crypttab is not enough. Extracting crypttab and overriding directly what is desired by final OS and exposed into /boot/initrd is the way to go otherwise hacking on top of hacks. This brings default packed modules under Heads to 5 modules, which needs to be deactivate in board configs if undesired: user@heads-tests-deb12:~/heads$ grep -Rn "?= y" modules/ | grep -v MUSL modules/zlib:1:CONFIG_ZLIB ?= y modules/zstd:3:CONFIG_ZSTD ?= y modules/exfatprogs:2:CONFIG_EXFATPROGS ?= y modules/busybox:2:CONFIG_BUSYBOX ?= y modules/e2fsprogs:2:CONFIG_E2FSPROGS ?= y --- .../UNTESTED_t430-legacy-flash.config | 1 + boards/librem_mini_v2/librem_mini_v2.config | 2 -- boards/x230-legacy-flash/x230-legacy-flash.config | 2 ++ modules/zstd | 3 +++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/boards/UNTESTED_t430-legacy-flash/UNTESTED_t430-legacy-flash.config b/boards/UNTESTED_t430-legacy-flash/UNTESTED_t430-legacy-flash.config index 94c74887..3d8cdadb 100644 --- a/boards/UNTESTED_t430-legacy-flash/UNTESTED_t430-legacy-flash.config +++ b/boards/UNTESTED_t430-legacy-flash/UNTESTED_t430-legacy-flash.config @@ -13,6 +13,7 @@ CONFIG_LINUX_CONFIG=config/linux-x230-flash.config #Add bare minimal tools for flashing boards CONFIG_BASH=n CONFIG_FLASHROM=y +CONFIG_ZSTD=n #CONFIG_GPG=y #CONFIG_FLASHTOOLS=y CONFIG_PCIUTILS=y diff --git a/boards/librem_mini_v2/librem_mini_v2.config b/boards/librem_mini_v2/librem_mini_v2.config index 40881e12..30224921 100644 --- a/boards/librem_mini_v2/librem_mini_v2.config +++ b/boards/librem_mini_v2/librem_mini_v2.config @@ -20,8 +20,6 @@ CONFIG_PCIUTILS=y CONFIG_POPT=y CONFIG_QRENCODE=y CONFIG_TPMTOTP=y -# zstd-decompress - for blob jail, needed to extract /init from zstd cpio archive -CONFIG_ZSTD=y CONFIG_CAIRO=y CONFIG_FBWHIPTAIL=y diff --git a/boards/x230-legacy-flash/x230-legacy-flash.config b/boards/x230-legacy-flash/x230-legacy-flash.config index 52eb41f9..1ad51a0f 100644 --- a/boards/x230-legacy-flash/x230-legacy-flash.config +++ b/boards/x230-legacy-flash/x230-legacy-flash.config @@ -13,6 +13,7 @@ CONFIG_LINUX_CONFIG=config/linux-x230-flash.config #Add bare minimal tools for flashing boards CONFIG_BASH=n CONFIG_FLASHROM=y +CONFIG_ZSTD=n #CONFIG_GPG=y #CONFIG_FLASHTOOLS=y CONFIG_PCIUTILS=y @@ -21,6 +22,7 @@ CONFIG_PCIUTILS=y #CONFIG_TPMTOTP=y #CONFIG_DROPBEAR=y + #Additional hardware support CONFIG_LINUX_USB=y #CONFIG_LINUX_E1000E=y diff --git a/modules/zstd b/modules/zstd index 3d7bd4b3..cf980812 100644 --- a/modules/zstd +++ b/modules/zstd @@ -1,3 +1,6 @@ +# ZSTD is always included, unless explicitly turned off +# Needed by initrd/bin/unpack_initramfs.sh under TPM Disk Unlock Key setup +CONFIG_ZSTD ?= y modules-$(CONFIG_ZSTD) += zstd zstd_version := 1.5.5