summaryrefslogtreecommitdiff
path: root/script/build/coreboot
diff options
context:
space:
mode:
Diffstat (limited to 'script/build/coreboot')
-rwxr-xr-xscript/build/coreboot/utils31
1 files changed, 11 insertions, 20 deletions
diff --git a/script/build/coreboot/utils b/script/build/coreboot/utils
index 8498897a..9dddc440 100755
--- a/script/build/coreboot/utils
+++ b/script/build/coreboot/utils
@@ -13,14 +13,12 @@ main()
if [ $# -gt 0 ]; then
for board in "${@}"; do
- build_for_mainboard ${board} || \
- err "cannot build cbutils for target, ${board}"
+ x_ build_for_mainboard ${board}
done
else
for boarddir in config/coreboot/*; do
[ ! -d "${boarddir}" ] && continue
- build_for_mainboard ${boarddir##*/} || \
- err "cannot build cbutils for target, ${board}"
+ x_ build_for_mainboard ${boarddir##*/}
done
fi
}
@@ -28,36 +26,29 @@ main()
build_for_mainboard() {
board="${1}"
[ -d "config/coreboot/${board}" ] || \
- err "build_for_mainboard ${board}: boarddir does not exist"
+ err "build_for_mainboard ${board}: boarddir does not exist"
[ -f "config/coreboot/${board}/target.cfg" ] || \
- err "build_for_mainboard ${board}: target.cfg does not exist"
+ err "build_for_mainboard ${board}: target.cfg does not exist"
tree="undefined"
. "config/coreboot/${board}/target.cfg" # source
[ "${tree}" = "undefined" ] && \
- err "build_for_mainboard: improper tree definition for '${board}'"
+ err "build_for_mainboard ${board}: improper tree definition"
buildutils "${tree}"
}
buildutils() {
tree="${1}"
[ -d "coreboot/${tree}/" ] || \
- ./update project trees coreboot $tree || \
- err "buildutils: cannot fetch ${tree}"
+ x_ ./update project trees coreboot ${tree}
for util in cbfstool ifdtool; do
[ -f "cbutils/${tree}/${util}" ] && continue
- [ -d "cbutils/${tree}" ] || \
- mkdir -p "cbutils/${tree}" || \
- err "buildutils: can't mkdir cbutils/${tree}"
+ [ -d "cbutils/${tree}" ] || x_ mkdir -p "cbutils/${tree}"
utildir="coreboot/${tree}/util/${util}"
- make distclean -C "${utildir}" || \
- err "buildutils: cannot clean ${utildir}"
- make -j$(nproc) -C "${utildir}" || \
- err "buildutils: cannot build ${utildir}"
- cp "${utildir}/${util}" "cbutils/${tree}" || \
- err "buildutils: can't cp ${util} cbutils/${tree}/"
- make distclean -C "${utildir}" || \
- err "buildutils: can't clean ${utildir}"
+ x_ make distclean -C "${utildir}"
+ x_ make -j$(nproc) -C "${utildir}"
+ x_ cp "${utildir}/${util}" "cbutils/${tree}"
+ x_ make distclean -C "${utildir}"
done
}