summaryrefslogtreecommitdiff
path: root/include/vendor.sh
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-12-18 03:42:45 +0000
committerLeah Rowe <leah@libreboot.org>2024-12-18 03:42:45 +0000
commit02cbf8a729dd08be8a212695a9fcf93f05a8cec9 (patch)
tree867f7b9fd6215e3164174a66a54a7dd967a56637 /include/vendor.sh
parent9884e5ed1b0b6e5be00cd5cd7fd52454518e8dad (diff)
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 <leah@libreboot.org>
Diffstat (limited to 'include/vendor.sh')
-rw-r--r--include/vendor.sh5
1 files changed, 3 insertions, 2 deletions
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"; :
}