diff options
| author | Leah Rowe <leah@libreboot.org> | 2023-05-20 19:45:08 +0100 | 
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2023-05-20 19:45:08 +0100 | 
| commit | 92bd18c45aa1fea5b88d5d0603057b7cba689721 (patch) | |
| tree | ae9e20c654693931424eb13893081c9993534fe3 /resources/scripts | |
| parent | ec3d1006b3eef1d6f46d1bf2a2b21509b63c60b6 (diff) | |
build/release/roms: minor cleanup
split actual purging of blobs to a function
rename functions for clarity
Diffstat (limited to 'resources/scripts')
| -rwxr-xr-x | resources/scripts/build/release/roms | 65 | 
1 files changed, 36 insertions, 29 deletions
| 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 | 
