summaryrefslogtreecommitdiff
path: root/include/vendor.sh
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-10-01 07:19:04 +0100
committerLeah Rowe <leah@libreboot.org>2025-10-01 07:19:04 +0100
commit3b6d2b799ccff1f1803401d7e2ff64aa21a26b3b (patch)
treed530d2b969f707a4eb4fea6c9d4a7eb08af734e3 /include/vendor.sh
parent347330a61122cadbee538baae020415cb71b380a (diff)
vendor.sh: break up the extract_kbc1126 subshell
stick it in a new function, for easier reading. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include/vendor.sh')
-rw-r--r--include/vendor.sh51
1 files changed, 27 insertions, 24 deletions
diff --git a/include/vendor.sh b/include/vendor.sh
index 6f3bc249..9e0eb731 100644
--- a/include/vendor.sh
+++ b/include/vendor.sh
@@ -313,30 +313,8 @@ extract_archive()
extract_kbc1126ec()
{
- (
- x_ cd "$appdir/"
-
- if mv Rompaq/68*.BIN ec.bin; then
- :
- elif unar -D ROM.CAB Rom.bin; then
- :
- elif unar -D Rom.CAB Rom.bin; then
- :
- elif unar -D 68*.CAB Rom.bin; then
- :
- else
- err "!kbc1126 unar" "extract_kbc1126ec" "$@"
- fi
-
- if [ ! -f "ec.bin" ]; then
- x_ mv Rom.bin ec.bin
- fi
-
- if x_ e ec.bin f; then
- x_ "$kbc1126_ec_dump" ec.bin
- fi
-
- ) || err "$board: can't extract kbc1126 fw" "extract_kbc1126ec" "$@"
+ ( extract_kbc1126ec_dump ) || \
+ err "$board: can't extract kbc1126 fw" "extract_kbc1126ec" "$@"
# throw error if either file is missing
x_ e "$appdir/ec.bin.fw1" f
@@ -345,6 +323,31 @@ extract_kbc1126ec()
x_ cp "$appdir/"ec.bin.fw* "${_pre_dest%/*}/"
}
+extract_kbc1126ec_dump()
+{
+ x_ cd "$appdir/"
+
+ if mv Rompaq/68*.BIN ec.bin; then
+ :
+ elif unar -D ROM.CAB Rom.bin; then
+ :
+ elif unar -D Rom.CAB Rom.bin; then
+ :
+ elif unar -D 68*.CAB Rom.bin; then
+ :
+ else
+ err "!kbc1126 unar" "extract_kbc1126ec" "$@"
+ fi
+
+ if [ ! -f "ec.bin" ]; then
+ x_ mv Rom.bin ec.bin
+ fi
+
+ if x_ e ec.bin f; then
+ x_ "$kbc1126_ec_dump" ec.bin
+ fi
+}
+
extract_e6400vga()
{
set +u +e