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>
This commit is contained in:
Leah Rowe
2025-10-01 07:19:04 +01:00
parent 347330a611
commit 3b6d2b799c
+27 -24
View File
@@ -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