From 62f23123cb2a5ef594f405053d0b111c6e01de87 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 21 Aug 2023 19:41:49 +0100 Subject: general code cleanup on lbmk shell scripts in update/blobs/download, i saw instances where appdir was being deleted with rm -r, but the more appropriate command would rm -Rf. this is now fixed. other than that, i've mostly just simplified a bunch of if statements and consolidated some duplicated logic (e.g. if/else block for dependencies in build_dependencies() of update/blobs/download one or two functions and/or variables have been renamed, for greater clarity in the code, also removed a few messages that were redundant used printf instead of echo, in a few places, also fixed up the indentation in a few places Signed-off-by: Leah Rowe --- resources/scripts/handle/config/file | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'resources/scripts/handle') diff --git a/resources/scripts/handle/config/file b/resources/scripts/handle/config/file index 6c4bd86e..bbd0ff0c 100755 --- a/resources/scripts/handle/config/file +++ b/resources/scripts/handle/config/file @@ -89,9 +89,8 @@ main() target="${x}" printf "Running 'make %s' for project '%s, target '%s''\n" \ "${mode}" "${project}" "${target}" - if [ "${project}" = "coreboot" ] && [ "${mode}" = "all" ]; then + [ "${project}" != "coreboot" ] || [ "${mode}" != "all" ] || \ ./update blobs download ${target} || err "blobutil" - fi handle_defconfig || exit 1 done @@ -166,35 +165,29 @@ check_cross_compiler() err "check_cross_compiler" if [ "${arch}" = "x86_32" ] || [ "${arch}" = "x86_64" ]; then - if [ ! -d "${cbdir}/util/crossgcc/xgcc/i386-elf/" ]; then - # Even for 64-bit machines, coreboot builds 32-bit ROM - # images, so we only need to worry about i386-elf + [ -d "${cbdir}/util/crossgcc/xgcc/i386-elf/" ] || \ make -C "${cbdir}" crossgcc-i386 CPUS=$(nproc) || \ return 1 - fi case "$(uname -m)" in x86*|i*86|amd64) : ;; *) export CROSS_COMPILE=i386-elf- ;; esac elif [ "${arch}" = "ARMv7" ]; then - if [ ! -d "${cbdir}/util/crossgcc/xgcc/arm-eabi/" ]; then + [ -d "${cbdir}/util/crossgcc/xgcc/arm-eabi/" ] || \ make -C "${cbdir}" crossgcc-arm CPUS=$(nproc) || \ return 1 - fi case "$(uname -m)" in arm|arm32|armv6*|armv7*) : ;; *) export CROSS_COMPILE=arm-eabi- ;; esac elif [ "${arch}" = "AArch64" ]; then - if [ ! -d "${cbdir}/util/crossgcc/xgcc/aarch64-elf/" ]; then + [ -d "${cbdir}/util/crossgcc/xgcc/aarch64-elf/" ] || \ make -C "${cbdir}" crossgcc-aarch64 CPUS=$(nproc) || \ return 1 - fi # aarch64 also needs armv7 toolchain for arm-trusted-firmware - if [ ! -d "${cbdir}/util/crossgcc/xgcc/arm-eabi/" ]; then + [ -d "${cbdir}/util/crossgcc/xgcc/arm-eabi/" ] || \ make -C "${cbdir}" crossgcc-arm CPUS=$(nproc) || \ return 1 - fi case "$(uname -m)" in arm64|aarch64) : ;; *) export CROSS_COMPILE=aarch64-elf- ;; -- cgit v1.2.1