[coreboot-gerrit] Patch set updated for coreboot: a4cb065 abuild: fix and enable USE_XARGS configuration
Patrick Georgi (patrick@georgi-clan.de)
gerrit at coreboot.org
Thu Dec 5 20:19:10 CET 2013
Patrick Georgi (patrick at georgi-clan.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4485
-gerrit
commit a4cb0654dffd5dc513845b64c94ef50c93b8d544
Author: Patrick Georgi <patrick at georgi-clan.de>
Date: Thu Dec 5 19:53:04 2013 +0100
abuild: fix and enable USE_XARGS configuration
USE_XARGS mode builds n boards in parallel (with 1 CPU each) instead of
building 1 board with n CPUs.
This requires the main build system to work under such circumstances.
Change-Id: Ib4571a78dfe78fd61ae5b26c18be9745bd8b3d52
---
util/abuild/abuild | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/util/abuild/abuild b/util/abuild/abuild
index 6148757..706bb2a 100755
--- a/util/abuild/abuild
+++ b/util/abuild/abuild
@@ -47,6 +47,9 @@ configureonly=0
# Did any board fail to build?
failed=0
+# default: single CPU build
+cpus=1
+
# One might want to adjust these in case of cross compiling
for i in make gmake gnumake nonexistant_make; do
$i --version 2>/dev/null |grep "GNU Make" >/dev/null && break
@@ -587,6 +590,7 @@ while true ; do
-T|--test) shift; hwtest=true;;
-c|--cpus) shift
export MAKEFLAGS="-j $1"
+ cpus=$1
test "$MAKEFLAGS" == "-j max" && export MAKEFLAGS="-j" && cpuconfig="in parallel"
test "$1" == "1" && cpuconfig="on 1 cpu"
expr "$1" : '-\?[0-9]\+$' > /dev/null && test 0$1 -gt 1 && cpuconfig="on $1 cpus in parallel"
@@ -633,10 +637,16 @@ fi
USE_XARGS=0
if [ "$cpus" != "1" ]; then
+ # Limit to 32 parallel builds for now.
+ # Thrashing all caches because we run
+ # 160 abuilds in parallel is no fun.
+ if [ "$cpus" = "max" ]; then
+ cpus=32
+ fi
if [ "$target" = "" ]; then
# Test if xargs supports the non-standard -P flag
# FIXME: disabled until we managed to eliminate all the make(1) quirks
- echo | xargs -P 0$cpus -n 1 echo 2>/dev/null >/dev/null # && USE_XARGS=1
+ echo | xargs -P ${cpus:-0} -n 1 echo 2>/dev/null >/dev/null && USE_XARGS=1
fi
fi
@@ -653,12 +663,6 @@ build_all_targets()
done
}
else
-# Limit to 32 parallel builds for now.
-# Thrashing all caches because we run
-# 160 abuilds in parallel is no fun.
-if [ "$cpus" = "" ]; then
- cpus=32
-fi
build_all_targets()
{
# seed shared utils
@@ -672,7 +676,7 @@ build_all_targets()
for MAINBOARD in $( mainboards $VENDOR ); do
echo $VENDOR/$MAINBOARD
done
- done | xargs -P 0$cpus -n 1 $0 $cmdline -t
+ done | xargs -P ${cpus:-0} -n 1 $0 $cmdline -t
}
fi
More information about the coreboot-gerrit
mailing list