summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-04-17 18:11:55 +0100
committerLeah Rowe <leah@libreboot.org>2025-04-17 18:11:55 +0100
commita3acf4c3f95a77bc61d903db25a9434a7b611866 (patch)
tree117a8f6e7e3082bfed5c745abf7c3d6ac24a63ce
parent30213a96883c6affe622d7f2855d350d733c4e75 (diff)
vendor.sh: simplify process_release_roms
Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r--include/vendor.sh10
1 files changed, 3 insertions, 7 deletions
diff --git a/include/vendor.sh b/include/vendor.sh
index 5523cc6b..2e71a76a 100644
--- a/include/vendor.sh
+++ b/include/vendor.sh
@@ -520,17 +520,13 @@ process_release_rom()
[ "${_xromname#"$vfix"}" != "$_xromname" ]; then
_xromnew="${_xrom%/*}/${_xromname#"$vfix"}"
- stat -c '%s' "$_xrom" > "tmp/rom.size" || \
- $err "$_xrom: Can't resize '$_xrom' (out: tmp/rom.size)"
- read -r xromsize < "tmp/rom.size" || \
- $err "$_xrom: Can't read rom size. $dontflash"
-
+ stat -c '%s' "$_xrom" > "tmp/rom.size" || $err "!resize $_xrom"
+ read -r xromsize < "tmp/rom.size" || $err "!readsize $_xrom"
expr "X$xromsize" : "X-\{0,1\}[0123456789][0123456789]*$" \
1>/dev/null 2>/dev/null || $err "$_xrom size non-integer"
xromsize="`expr $xromsize - 1`"
- [ $xromsize -lt 524288 ] && \
- $err "$_xrom size too small; likely not a rom. $dontflash"
+ [ $xromsize -lt 524288 ] && $err "too small, $xromsize: $_xrom"
x_ dd if="$_xrom" of="$_xromnew" bs=$xromsize count=1
rm -f "$_xrom" || $err "Can't rm $_xrom - $dontflash"