diff options
author | Leah Rowe <leah@libreboot.org> | 2023-09-30 20:04:02 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2023-09-30 20:06:29 +0100 |
commit | 26fc3f13254e38ddd6903e7e18e0945b4e6fe63d (patch) | |
tree | 0baf792f50daea402a9a35dec25bb2aa6e89ac3d /script/build/release | |
parent | 0a0defd3256ff5e29e3b4d129a04fb7546bc31ac (diff) |
general code formatting cleanup in shell scripts
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'script/build/release')
-rwxr-xr-x | script/build/release/roms | 27 | ||||
-rwxr-xr-x | script/build/release/src | 6 |
2 files changed, 12 insertions, 21 deletions
diff --git a/script/build/release/roms b/script/build/release/roms index 4a18037d..026f4eae 100755 --- a/script/build/release/roms +++ b/script/build/release/roms @@ -46,10 +46,9 @@ init_check() [ ! -d "release/${version}/roms/" ] || \ rm -Rf "release/${version}/roms/" || \ err "init_check: !rm -Rf release/${version}/roms/" - if [ ! -d "release/${version}/roms/" ]; then - mkdir -p "release/${version}/roms/" || \ - err "init_check: !mkdir -p release/${version}/roms/" - fi + [ -d "release/${version}/roms/" ] && return 0 + mkdir -p "release/${version}/roms/" || \ + err "init_check: !mkdir -p release/${version}/roms/" } make_archive() @@ -161,20 +160,17 @@ strip_archive() strip_ucode() { romfile=${1} - _newrom_b="${romfile%.rom}_nomicrocode.tmprom" cp "${romfile}" "${_newrom_b}" || \ err "strip_rom_image: cp \"${romfile}\" \"${_newrom_b}\"" microcode_present="y" "${cbfstool}" "${_newrom_b}" remove -n \ cpu_microcode_blob.bin 2>/dev/null || microcode_present="n" - if [ "${microcode_present}" = "n" ]; then - printf "REMARK: '%s' already lacks microcode\n" "${romfile}" \ - 1>&2 - printf "Renaming default ROM file instead.\n" 1>&2 - mv "${romfile}" "${_newrom_b}" || \ - err "strip_rom_image: can't rename no-u ${romfile}" - fi + [ "${microcode_present}" = "n" ] || return 0 + printf "REMARK: '%s' already lacks microcode\n" "${romfile}" 1>&2 + printf "Renaming default ROM file instead.\n" 1>&2 + mv "${romfile}" "${_newrom_b}" || \ + err "strip_rom_image: can't rename no-u ${romfile}" } strip_rom_image() @@ -196,10 +192,9 @@ strip_rom_image() err "strip_rom_images: ${1}: can't nuke ecfw2.bin" fi # TODO: replace this board-specific hack - if [ "${target}" = "e6400_4mb" ]; then - "${cbfstool}" "${1}" remove -n "pci10de,06eb.rom" || \ - err "strip_rom_images: ${1}: can't nuke e6400 vga rom" - fi + [ "${target}" = "e6400_4mb" ] || return 0 + "${cbfstool}" "${1}" remove -n "pci10de,06eb.rom" || \ + err "strip_rom_images: ${1}: can't nuke e6400 vga rom" } main $@ diff --git a/script/build/release/src b/script/build/release/src index c29869f5..74854879 100755 --- a/script/build/release/src +++ b/script/build/release/src @@ -36,7 +36,6 @@ main() purge_files create_release_archive - printf "Source code archive available at %s.tar.xz\n\n" "${srcdir}" } @@ -116,9 +115,7 @@ copy_files() purge_files() { ( - cd "${srcdir}/" || \ - err "purge_files 3: !cd ${srcdir}/" - + cd "${srcdir}/" || err "purge_files 3: !cd ${srcdir}/" [ ! -d "coreboot/default/util/kbc1126" ] || \ ./handle make file -c "coreboot/default/util/kbc1126" || \ err "purge_files 1: default/util/kbc1126: ! make clean" @@ -128,7 +125,6 @@ purge_files() ./handle make config -c "${p}" || \ err "purge_files: ${p}: cannot clean the source trees" done - for p in bios_extract flashrom grub uefitool; do ./handle make file -c "${p}" || \ err "purge_files: !./handle make file -c ${p}" |