From f12d2997fcde22afdf681a09262f3f819f241055 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Sun, 22 Feb 2026 16:40:28 +0100 Subject: [PATCH] lib/cbfs: Don't include unused LZ4 code to shrink postcar stage When ramstage is not LZ4 compressed then don't include the LZ4 decompressor into postcar stage. TEST=Reduces postcar size on Lenovo x220 by 1224 bytes. Change-Id: I51e25d94213b42474c8cedd9e7bae9e81568566d Signed-off-by: Patrick Rudolph Reviewed-on: https://review.coreboot.org/c/coreboot/+/91385 Reviewed-by: Angel Pons Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel --- src/lib/cbfs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c index 0c602474b3..25a29a2885 100644 --- a/src/lib/cbfs.c +++ b/src/lib/cbfs.c @@ -137,6 +137,9 @@ static inline bool cbfs_lz4_enabled(void) if (ENV_SMM) return false; + if (ENV_RAMSTAGE_LOADER && !CONFIG(COMPRESS_RAMSTAGE_LZ4)) + return false; + return true; }