minor code cleanup in the build system

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2024-06-20 01:15:06 +01:00
parent 4ab99d546e
commit 808458ced5
5 changed files with 10 additions and 19 deletions
+2 -4
View File
@@ -57,15 +57,13 @@ fetch_project_repo()
[ -n "$xtree" ] && [ ! -d "src/coreboot/$xtree" ] && \ [ -n "$xtree" ] && [ ! -d "src/coreboot/$xtree" ] && \
x_ ./update trees -f coreboot "$xtree" x_ ./update trees -f coreboot "$xtree"
[ -z "$depend" ] || for d in $depend ; do [ -z "$depend" ] || for d in $depend ; do
printf "'%s' needs dependency '%s'; grabbing '%s' now\n" \ printf "'%s' needs '%s'; grabbing '%s'\n" "$project" "$d" "$d"
"$project" "$d" "$d"
x_ ./update trees -f $d x_ ./update trees -f $d
done done
clone_project clone_project
for x in config/git/*; do for x in config/git/*; do
[ -f "$x" ] && nuke "${x##*/}" "src/${x##*/}" 2>/dev/null; \ [ -f "$x" ] && nuke "${x##*/}" "src/${x##*/}" 2>/dev/null
continue
done done
} }
+2 -4
View File
@@ -181,8 +181,7 @@ mktarball()
[ "${2%/*}" = "$2" ] || \ [ "${2%/*}" = "$2" ] || \
mkdir -p "${2%/*}" || $err "mk, !mkdir -p \"${2%/*}\"" mkdir -p "${2%/*}" || $err "mk, !mkdir -p \"${2%/*}\""
printf "\nCreating archive: %s\n\n" "$2" printf "\nCreating archive: %s\n\n" "$2"
tar -c "$1" | xz -T$threads -9e > "$2" || \ tar -c "$1" | xz -T$threads -9e > "$2" || $err "mktarball 2, $1"
$err "mktarball 2, $1"
mksha512sum "$2" "${2##*/}.sha512" mksha512sum "$2" "${2##*/}.sha512"
} }
@@ -190,8 +189,7 @@ mksha512sum()
{ {
( (
[ "${1%/*}" != "$1" ] && x_ cd "${1%/*}" [ "${1%/*}" != "$1" ] && x_ cd "${1%/*}"
sha512sum ./"${1##*/}" >> "$2" || \ sha512sum ./"${1##*/}" >> "$2" || $err "!sha512sum \"$1\" > \"$2\""
$err "!sha512sum \"$1\" > \"$2\""
) || $err "failed to create tarball checksum" ) || $err "failed to create tarball checksum"
} }
+3 -6
View File
@@ -36,10 +36,7 @@ vendor_download()
_b="${board%%_*mb}" # shorthand (no duplication per rom size) _b="${board%%_*mb}" # shorthand (no duplication per rom size)
detect_firmware && exit 0 detect_firmware && exit 0
scan_config "$_b" "config/vendor" scan_config "$_b" "config/vendor" && bootstrap && getfiles
build_dependencies_download
download_vendorfiles
} }
detect_firmware() detect_firmware()
@@ -68,7 +65,7 @@ detect_firmware()
printf "Vendor files not needed for: %s\n" "$board" 1>&2 printf "Vendor files not needed for: %s\n" "$board" 1>&2
} }
build_dependencies_download() bootstrap()
{ {
[ -d "$cbdir" ] || x_ ./update trees -f coreboot ${cbdir##*/} [ -d "$cbdir" ] || x_ ./update trees -f coreboot ${cbdir##*/}
for d in uefitool biosutilities bios_extract; do for d in uefitool biosutilities bios_extract; do
@@ -86,7 +83,7 @@ build_dependencies_download()
x_ ./update trees -b coreboot utils $tree x_ ./update trees -b coreboot utils $tree
} }
download_vendorfiles() getfiles()
{ {
[ -z "$CONFIG_HAVE_ME_BIN" ] || fetch intel_me "$DL_url" \ [ -z "$CONFIG_HAVE_ME_BIN" ] || fetch intel_me "$DL_url" \
"$DL_url_bkup" "$DL_hash" "$CONFIG_ME_BIN_PATH" "$DL_url_bkup" "$DL_hash" "$CONFIG_ME_BIN_PATH"
+2 -3
View File
@@ -166,9 +166,8 @@ build_roms()
cbfs "$cbrom" "elf/memtest86plus/memtest.bin" img/memtest cbfs "$cbrom" "elf/memtest86plus/memtest.bin" img/memtest
[ "$payload_seabios" = "y" ] && build_seabios_roms [ "$payload_seabios" = "y" ] && build_seabios_roms
[ "$payload_grub" != "y" ] || build_grub_roms "$cbrom" "grub" [ "$payload_grub" != "y" ] || build_grub_roms "$cbrom" "grub"
[ "$payload_uboot" = "y" ] || return 0 [ "$payload_uboot" = "y" ] && x_ cp "$_cbrom" "$cbrom" && \
x_ cp "$_cbrom" "$cbrom" build_uboot_roms; return 0
build_uboot_roms
} }
build_seabios_roms() build_seabios_roms()
+1 -2
View File
@@ -229,8 +229,7 @@ handle_makefile()
run_make_command() run_make_command()
{ {
check_cmake "$cdir" check_cmake "$cdir" && [ -z "$mode" ] && check_autoconf "$cdir"
[ -z "$mode" ] && check_autoconf "$cdir"
check_makefile "$cdir" || return 1 check_makefile "$cdir" || return 1
[ "$project" = "coreboot" ] && [ -z "$mode" ] && x_ \ [ "$project" = "coreboot" ] && [ -z "$mode" ] && x_ \