From 02cbf8a729dd08be8a212695a9fcf93f05a8cec9 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Wed, 18 Dec 2024 03:42:45 +0000 Subject: vendor.sh: make TBFW pad size configurable we encountered 1MB flash so far, but we may encounter other sizes on other machines when added to libreboot later on Signed-off-by: Leah Rowe --- include/vendor.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/vendor.sh b/include/vendor.sh index b1f47d6d..bd06af25 100644 --- a/include/vendor.sh +++ b/include/vendor.sh @@ -26,7 +26,7 @@ eval `setvars "" EC_url_bkup EC_hash DL_hash DL_url_bkup MRC_refcode_gbe vcfg \ archive EC_url boarddir rom cbdir DL_url nukemode cbfstoolref vrelease \ verify _7ztest ME11bootguard ME11delta ME11version ME11sku ME11pch \ IFD_platform ifdprefix cdir sdir _me _metmp mfs TBFW_url_bkup TBFW_url \ - TBFW_hash $cv` + TBFW_hash TBFW_size $cv` vendor_download() { @@ -240,6 +240,7 @@ extract_sch5545ec() # https://pcsupport.lenovo.com/us/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t480-type-20l5-20l6/20l5/solutions/ht508988 extract_tbfw() { + chkvars TBFW_size # size in bytes, matching TBFW's flash IC x_ mkdir -p tmp find "$appdir" -type f -name "TBT.bin" > "tmp/tb.txt" || \ $err "extract_tbfw $_dest: Can't extract TBT.bin" @@ -250,7 +251,7 @@ extract_tbfw() $err "extract_tbfw $_dest: Can't copy TBT.bin" break done < "tmp/tb.txt" - dd if=/dev/null of=tmp/tb.bin bs=1 seek=1048576 || \ + dd if=/dev/null of=tmp/tb.bin bs=1 seek=$TBFW_size || \ $err "extract_tbfw $_dest: Can't pad TBT.bin" cp "tmp/tb.bin" "$_dest" || $err "extract_tbfw $_dest: copy error"; : } -- cgit v1.2.1