From 92bd18c45aa1fea5b88d5d0603057b7cba689721 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 20 May 2023 19:45:08 +0100 Subject: build/release/roms: minor cleanup split actual purging of blobs to a function rename functions for clarity --- resources/scripts/build/release/roms | 65 ++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 29 deletions(-) (limited to 'resources/scripts/build/release') diff --git a/resources/scripts/build/release/roms b/resources/scripts/build/release/roms index be93d597..33200cc4 100755 --- a/resources/scripts/build/release/roms +++ b/resources/scripts/build/release/roms @@ -90,7 +90,7 @@ make_archive() # remove ME/MRC/EC firmware from ROM images if [ "${CONFIG_HAVE_ME_BIN}" = "y" ] \ || [ "${target}" = "e6400nvidia_4mb" ]; then - purge_blobs "${romdir}" + strip_archive "${romdir}" fi printf "Generating release/%s/roms/%s-%s_%s.tar.xz\n" \ @@ -110,7 +110,7 @@ make_archive() fi } -purge_blobs() +strip_archive() { romdir=${1} @@ -137,36 +137,43 @@ purge_blobs() for romfile in "${romdir}"/*.rom do - if [ ! -f "${romfile}" ]; then - continue - fi - - if [ "${CONFIG_HAVE_ME_BIN}" = "y" ]; then - ${ifdtool} --nuke me "${romfile}" || exit 1 - mv "${romfile}" "${romdir}_tmp"/ - mv "${romfile}.new" "${romfile}" - fi - - if [ "${CONFIG_HAVE_MRC}" = "y" ] - then - ${cbfstool} "${romfile}" remove -n mrc.bin || exit 1 - ${cbfstool} "${romfile}" print - fi - - if [ "${CONFIG_KBC1126_FIRMWARE}" = "y" ]; then - ${cbfstool} "${romfile}" remove -n ecfw1.bin || exit 1 - ${cbfstool} "${romfile}" remove -n ecfw2.bin || exit 1 - fi - - # TODO: replace this board-specific hack - if [ "${target}" = "e6400nvidia_4mb" ]; then - ${cbfstool} "${romfile}" remove \ - -n "pci10de,06eb.rom" \ - || exit 1 - fi + strip_rom_image "${romfile}" done } +strip_rom_image() +{ + romfile=${1} + + if [ ! -f "${romfile}" ]; then + continue + fi + + if [ "${CONFIG_HAVE_ME_BIN}" = "y" ]; then + ${ifdtool} --nuke me "${romfile}" || exit 1 + mv "${romfile}" "${romdir}_tmp"/ + mv "${romfile}.new" "${romfile}" + fi + + if [ "${CONFIG_HAVE_MRC}" = "y" ] + then + ${cbfstool} "${romfile}" remove -n mrc.bin || exit 1 + ${cbfstool} "${romfile}" print + fi + + if [ "${CONFIG_KBC1126_FIRMWARE}" = "y" ]; then + ${cbfstool} "${romfile}" remove -n ecfw1.bin || exit 1 + ${cbfstool} "${romfile}" remove -n ecfw2.bin || exit 1 + fi + + # TODO: replace this board-specific hack + if [ "${target}" = "e6400nvidia_4mb" ]; then + ${cbfstool} "${romfile}" remove \ + -n "pci10de,06eb.rom" \ + || exit 1 + fi +} + err() { printf "%s: %s\n" $0 $1 -- cgit v1.2.1