diff options
| author | Leah Rowe <leah@libreboot.org> | 2025-05-03 07:17:21 +0100 | 
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2025-05-03 07:17:21 +0100 | 
| commit | 8de0ed811fb9bc48659f95918a36317f24be3d8e (patch) | |
| tree | 81fa843afdca8d073570e965f1727f65d0b2ba35 /include/inject.sh | |
| parent | 530e4109a2b4ad2d26c3e29eda652e2ab180cf84 (diff) | |
inject.sh: Stricter TBFW handling
Don't copy it until it has been padded properly.
Otherwise, erroneous padding would result in an error,
and who knows what would be left in vendorfiles/ ?
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include/inject.sh')
| -rw-r--r-- | include/inject.sh | 22 | 
1 files changed, 13 insertions, 9 deletions
| diff --git a/include/inject.sh b/include/inject.sh index 805415ef..c5e41f6d 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -278,19 +278,23 @@ 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 - -	tbtmp="$xbmklocal/tb.bin" -	x_ rm -f "$tbtmp" && fe_ copy_tbfw "$appdir" -type f -name "TBT.bin" - -	x_ dd if=/dev/null of="$tbtmp" bs=1 seek=$TBFW_size -	x_ cp "$tbtmp" "$_dest" +	chkvars TBFW_size +	fe_ copy_tbfw "$appdir" -type f -name "TBT.bin" +	[ -f "$_dest" ] || $err "$board: Could not extract tbfw"; :  }  copy_tbfw()  { -	[ -f "$1" ] && [ ! -L "$1" ] && x_ cp "$1" "$xbmklocal/tb.bin" && \ -	    return 1; : +	[ -f "$1" ] || return 0 +	[ -L "$1" ] && return 0 + +	tbtmp="$xbmklocal/tb.bin" +	x_ rm -f "$tbtmp" + +	x_ dd if=/dev/null of="$1" bs=1 seek=$TBFW_size +	x_ mv "$1" "$_dest" + +	return 1  }  extract_fspm() | 
