summaryrefslogtreecommitdiff
path: root/resources/scripts/handle
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-08-21 19:41:49 +0100
committerLeah Rowe <leah@libreboot.org>2023-08-21 22:38:00 +0100
commit62f23123cb2a5ef594f405053d0b111c6e01de87 (patch)
tree74d57d43b7e3cf107c183d273d10dcd5278ab138 /resources/scripts/handle
parent7be4706552845824888b58054120dfac99bfdf63 (diff)
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 <leah@libreboot.org>
Diffstat (limited to 'resources/scripts/handle')
-rwxr-xr-xresources/scripts/handle/config/file17
1 files changed, 5 insertions, 12 deletions
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- ;;