summaryrefslogtreecommitdiff
path: root/script/build/release/roms
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-09-27 21:33:19 +0100
committerLeah Rowe <leah@libreboot.org>2023-09-27 21:33:19 +0100
commita00b43375a7d4a33b6569c0b6ccb9e9291877bb5 (patch)
tree85306111c84c1f29f7b1f374af538435ca0e6ff8 /script/build/release/roms
parent3b9442f7b2886b84c995c90e25280c1716ffdc78 (diff)
build/release/roms: simplify strip_rom_image()
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'script/build/release/roms')
-rwxr-xr-xscript/build/release/roms42
1 files changed, 16 insertions, 26 deletions
diff --git a/script/build/release/roms b/script/build/release/roms
index b3c76419..b19d404c 100755
--- a/script/build/release/roms
+++ b/script/build/release/roms
@@ -185,36 +185,26 @@ strip_ucode()
strip_rom_image()
{
- romfile=${1}
-
- [ -f "${romfile}" ] || return 0
-
- if [ "${CONFIG_HAVE_ME_BIN}" = "y" ]; then
- "${ifdtool}" --nuke me "${romfile}" -O "${romfile}" || \
- err "strip_rom_images: ${romfile}: cannot nuke Intel ME"
- fi
-
- if [ "${CONFIG_HAVE_MRC}" = "y" ]; then
- "${cbfstool}" "${romfile}" remove -n mrc.bin || \
- err "strip_rom_images: ${romfile}: cannot nuke mrc.bin"
- "${cbfstool}" "${romfile}" print || :
- fi
-
+ [ -f "${1}" ] || return 0
+ [ "${CONFIG_HAVE_ME_BIN}" != "y" ] || \
+ "${ifdtool}" --nuke me "${1}" -O "${1}" || \
+ err "strip_rom_images: ${1}: cannot nuke Intel ME"
+ [ "${CONFIG_HAVE_MRC}" != "y" ] || \
+ "${cbfstool}" "${1}" remove -n mrc.bin || \
+ err "strip_rom_images: ${1}: cannot nuke mrc.bin"
+ [ "${CONFIG_INCLUDE_SMSC_SCH5545_EC_FW}" != "y" ] || \
+ "${cbfstool}" "${1}" remove -n sch5545_ecfw.bin || \
+ err "strip_rom_images: ${1}: can't nuke sch5545ec fw"
if [ "${CONFIG_KBC1126_FIRMWARE}" = "y" ]; then
- "${cbfstool}" "${romfile}" remove -n ecfw1.bin || \
- err "strip_rom_images: ${romfile}: can't nuke ecfw1.bin"
- "${cbfstool}" "${romfile}" remove -n ecfw2.bin || \
- err "strip_rom_images: ${romfile}: can't nuke ecfw2.bin"
+ "${cbfstool}" "${1}" remove -n ecfw1.bin || \
+ err "strip_rom_images: ${1}: can't nuke ecfw1.bin"
+ "${cbfstool}" "${1}" remove -n ecfw2.bin || \
+ err "strip_rom_images: ${1}: can't nuke ecfw2.bin"
fi
-
- [ "${CONFIG_INCLUDE_SMSC_SCH5545_EC_FW}" != "y" ] || \
- "${cbfstool}" "${romfile}" remove -n sch5545_ecfw.bin || \
- err "strip_rom_images: ${romfile}: can't nuke sch5545ec fw"
-
# TODO: replace this board-specific hack
if [ "${target}" = "e6400_4mb" ]; then
- "${cbfstool}" "${romfile}" remove -n "pci10de,06eb.rom" || \
- err "strip_rom_images: ${romfile}: can't nuke e6400 vga rom"
+ "${cbfstool}" "${1}" remove -n "pci10de,06eb.rom" || \
+ err "strip_rom_images: ${1}: can't nuke e6400 vga rom"
fi
}