hp820g2: fix vendorfile inject and set release=y

I believed that the compressed nature of refcode was the only
non-reproducible thing, but turns out you also need to run
rmodtool on the refcode to make the binary relocatable in
cbfs. This is based on my reading of the coreboot Makefile.

With this change, I can now provide release binaries for
the HP EliteBook 820 G2.

Signed-off-by: Leah Rowe <leah@libreboot.org>
master
Leah Rowe 2024-12-31 14:44:31 +00:00
parent f9ab082ec1
commit e8799310db
5 changed files with 52 additions and 11 deletions

View File

@ -0,0 +1,31 @@
From 1e72e6df7f5d71fd41350e34d0a8bd5230349235 Mon Sep 17 00:00:00 2001
From: Leah Rowe <info@minifree.org>
Date: Tue, 31 Dec 2024 14:42:24 +0000
Subject: [PATCH 1/1] Disable compression on refcode insertion
Compression is not reliably reproducible. In an lbmk release
context, this means we cannot rely on vendorfile insertion.
Therefore, use uncompressed refcode.
Signed-off-by: Leah Rowe <info@minifree.org>
---
Makefile.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.mk b/Makefile.mk
index e9ad2ccbb2..6a96d45a83 100644
--- a/Makefile.mk
+++ b/Makefile.mk
@@ -1364,7 +1364,7 @@ endif
cbfs-files-$(CONFIG_HAVE_REFCODE_BLOB) += $(CONFIG_CBFS_PREFIX)/refcode
$(CONFIG_CBFS_PREFIX)/refcode-file := $(REFCODE_BLOB)
$(CONFIG_CBFS_PREFIX)/refcode-type := stage
-$(CONFIG_CBFS_PREFIX)/refcode-compression := $(CBFS_COMPRESS_FLAG)
+$(CONFIG_CBFS_PREFIX)/refcode-compression := none
cbfs-files-$(CONFIG_SEABIOS_VGA_COREBOOT) += vgaroms/seavgabios.bin
vgaroms/seavgabios.bin-file := $(CONFIG_PAYLOAD_VGABIOS_FILE)
--
2.39.5

View File

@ -5,7 +5,6 @@ xarch="i386-elf"
payload_seabios="y" payload_seabios="y"
payload_grub="y" payload_grub="y"
payload_memtest="y" payload_memtest="y"
release="n"
grub_scan_disk="nvme ahci" grub_scan_disk="nvme ahci"
grubtree="xhci" grubtree="xhci"
vcfg="hp820g2" vcfg="hp820g2"

View File

@ -10,6 +10,7 @@ _ua="Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0"
ifdtool="elf/ifdtool/default/ifdtool" ifdtool="elf/ifdtool/default/ifdtool"
cbfstool="elf/cbfstool/default/cbfstool" cbfstool="elf/cbfstool/default/cbfstool"
rmodtool="elf/cbfstool/default/rmodtool"
tmpgit="$PWD/tmp/gitclone" tmpgit="$PWD/tmp/gitclone"
grubdata="config/data/grub" grubdata="config/data/grub"
err="err_" err="err_"

View File

@ -84,10 +84,14 @@ check_coreboot_utils()
utilmode="" && [ -n "$mode" ] && utilmode="clean" utilmode="" && [ -n "$mode" ] && utilmode="clean"
x_ make -C "$utilsrcdir" $utilmode -j$XBMK_THREADS $makeargs x_ make -C "$utilsrcdir" $utilmode -j$XBMK_THREADS $makeargs
[ -z "$mode" ] && [ ! -f "$utilelfdir/$util" ] && \ if [ -z "$mode" ] && [ ! -f "$utilelfdir/$util" ]; then
x_ mkdir -p "$utilelfdir" && \ x_ mkdir -p "$utilelfdir"
x_ cp "$utilsrcdir/$util" "elf/$util/$1" x_ cp "$utilsrcdir/$util" "$utilelfdir"
[ -z "$mode" ] || x_ rm -Rf "$utilelfdir"; continue [ "$util" = "cbfstool" ] || continue
x_ cp "$utilsrcdir/rmodtool" "$utilelfdir"
elif [ -n "$mode" ]; then
x_ rm -Rf "$utilelfdir"
fi; continue
done; return 0 done; return 0
} }

View File

@ -383,6 +383,7 @@ readcfg()
cbdir="src/coreboot/$tree" cbdir="src/coreboot/$tree"
cbfstool="elf/cbfstool/$tree/cbfstool" cbfstool="elf/cbfstool/$tree/cbfstool"
rmodtool="elf/cbfstool/$tree/rmodtool"
mecleaner="$PWD/$cbdir/util/me_cleaner/me_cleaner.py" mecleaner="$PWD/$cbdir/util/me_cleaner/me_cleaner.py"
kbc1126_ec_dump="$PWD/$cbdir/util/kbc1126/kbc1126_ec_dump" kbc1126_ec_dump="$PWD/$cbdir/util/kbc1126/kbc1126_ec_dump"
cbfstool="elf/cbfstool/$tree/cbfstool" cbfstool="elf/cbfstool/$tree/cbfstool"
@ -425,10 +426,10 @@ patch_rom()
rom="$1" rom="$1"
readkconfig || return 1 readkconfig || return 1
[ "$CONFIG_HAVE_MRC" = "y" ] && inject "mrc.bin" "$CONFIG_MRC_FILE" \
"mrc" "0xfffa0000"
[ -n "$CONFIG_HAVE_REFCODE_BLOB" ] && inject "fallback/refcode" \ [ -n "$CONFIG_HAVE_REFCODE_BLOB" ] && inject "fallback/refcode" \
"$CONFIG_REFCODE_BLOB_FILE" "stage" "$CONFIG_REFCODE_BLOB_FILE" "stage"
[ "$CONFIG_HAVE_MRC" = "y" ] && inject "mrc.bin" "$CONFIG_MRC_FILE" \
"mrc" "0xfffa0000"
[ "$CONFIG_HAVE_ME_BIN" = "y" ] && inject IFD "$CONFIG_ME_BIN_PATH" me [ "$CONFIG_HAVE_ME_BIN" = "y" ] && inject IFD "$CONFIG_ME_BIN_PATH" me
[ "$CONFIG_KBC1126_FIRMWARE" = "y" ] && inject ecfw1.bin \ [ "$CONFIG_KBC1126_FIRMWARE" = "y" ] && inject ecfw1.bin \
"$CONFIG_KBC1126_FW1" raw "$CONFIG_KBC1126_FW1_OFFSET" && inject \ "$CONFIG_KBC1126_FW1" raw "$CONFIG_KBC1126_FW1_OFFSET" && inject \
@ -487,10 +488,15 @@ inject()
"$cbfstool" "$rom" remove -n "$cbfsname" || \ "$cbfstool" "$rom" remove -n "$cbfsname" || \
$err "inject $rom: can't remove $cbfsname"; return 0 $err "inject $rom: can't remove $cbfsname"; return 0
fi fi
[ "$_t" != "stage" ] || "$cbfstool" "$rom" add-stage -f \ if [ "$_t" = "stage" ]; then # the only stage we handle in refcode
"$_dest" -n "$cbfsname" -t stage -c lzma || $err "$rom: !add ref" x_ mkdir -p tmp; x_ rm -f "tmp/refcode"
[ "$_t" = "stage" ] || "$cbfstool" "$rom" add -f "$_dest" \ "$rmodtool" -i "$_dest" -o "tmp/refcode" || "!reloc refcode"
-n "$cbfsname" -t $_t $_offset || $err "$rom !add $_t ($_dest)"; : "$cbfstool" "$rom" add-stage -f "tmp/refcode" -n "$cbfsname" \
-t stage || $err "$rom: !add ref"
else
"$cbfstool" "$rom" add -f "$_dest" -n "$cbfsname" \
-t $_t $_offset || $err "$rom !add $_t ($_dest)"
fi; :
} }
modify_gbe() modify_gbe()