From: Łukasz Stelmach Date: Fri, 26 Mar 2021 14:02:18 +0000 (+0100) Subject: script: Detect number of CPUs X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=52e00acd6d37c1462578d062acd080811964cf86;p=platform%2Fkernel%2Flinux-rpi3.git script: Detect number of CPUs Automatically determine the number of parallel make(1) processes to run. Change-Id: I0ce778e5c15ceb8cf80bbfc2f4bb58c937630ba3 Signed-off-by: Łukasz Stelmach --- diff --git a/build-rpi4.sh b/build-rpi4.sh index 27eac56c8f89..094988cc381b 100755 --- a/build-rpi4.sh +++ b/build-rpi4.sh @@ -1,5 +1,8 @@ #!/bin/bash +NCPUS=`cat /proc/cpuinfo | grep processor | wc -l` +NCPUS=$(($NCPUS * 2)) + if [ $# != 1 ]; then echo "Usage : build-rpi3.sh " @@ -27,7 +30,7 @@ if [ $1 = "arm" ]; then if ! [ -e .config ] ; then make ARCH=arm CROSS_COMPILE="$CROSS_COMPILER" tizen_bcm2709_defconfig fi - make ARCH=arm CROSS_COMPILE="$CROSS_COMPILER" -j8 + make ARCH=arm CROSS_COMPILE="$CROSS_COMPILER" -j $NCPUS if [ ! -f "./arch/arm/boot/zImage" ]; then echo "Build fail" exit 1 @@ -42,7 +45,7 @@ elif [ $1 = "arm64" ]; then if ! [ -e .config ] ; then make ARCH=arm64 CROSS_COMPILE="$CROSS_COMPILER" tizen_bcmrpi3_defconfig fi - make ARCH=arm64 CROSS_COMPILE="$CROSS_COMPILER" -j8 + make ARCH=arm64 CROSS_COMPILE="$CROSS_COMPILER" -j $NCPUS if [ ! -f "./arch/arm64/boot/Image" ]; then echo "Build fail" exit 1