[coreboot-gerrit] New patch to review for coreboot: cffe9a5 abuild: fix and enable USE_XARGS configuration

Patrick Georgi (patrick@georgi-clan.de) gerrit at coreboot.org
Thu Dec 5 19:55:14 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 cffe9a54b1fd37ab561b6a16092b518419165e8c
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 35431f9..18f39c3 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
@@ -528,6 +531,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"
@@ -574,10 +578,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
 
@@ -594,12 +604,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
@@ -613,7 +617,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