diff --git a/build_chrome.sh b/build_chrome.sh index a834839e5d..9e52fc8a9a 100755 --- a/build_chrome.sh +++ b/build_chrome.sh @@ -20,7 +20,7 @@ DEFAULT_CHROME_DIR="${CHROMEOS_CHROME_DIR:-/home/$USER/chrome}" # The number of jobs to pass to tools that can run in parallel (such as make # and dpkg-buildpackage -NUM_JOBS=`cat /proc/cpuinfo | grep processor | awk '{a++} END {print a}'` +NUM_JOBS=`grep -c "^processor" /proc/cpuinfo` # Flags DEFINE_string chrome_dir "$DEFAULT_CHROME_DIR" \ diff --git a/build_kernel.sh b/build_kernel.sh index 6fd124b149..4efa4667b1 100755 --- a/build_kernel.sh +++ b/build_kernel.sh @@ -126,7 +126,7 @@ then CONCURRENCY_LEVEL=2 else # speed up compilation by running #cpus * 2 simultaneous jobs - CONCURRENCY_LEVEL=$(($(cat /proc/cpuinfo | grep "processor" | wc -l) * 2)) + CONCURRENCY_LEVEL=$(($(grep -c "^processor" /proc/cpuinfo) * 2)) fi # Build the kernel and make package. "setarch" is used so that scripts which diff --git a/build_platform_packages.sh b/build_platform_packages.sh index b911c50426..3ac5f7c854 100755 --- a/build_platform_packages.sh +++ b/build_platform_packages.sh @@ -22,7 +22,7 @@ eval set -- "${FLAGS_ARGV}" set -e # Number of jobs for scons calls. -NUM_JOBS=`cat /proc/cpuinfo | grep processor | awk '{a++} END {print a}'` +NUM_JOBS=`grep -c "^processor" /proc/cpuinfo` PLATFORM_DIR="$SRC_ROOT/platform" diff --git a/common.sh b/common.sh index 25dee4a3ed..8b6fe5809d 100644 --- a/common.sh +++ b/common.sh @@ -12,7 +12,7 @@ # The number of jobs to pass to tools that can run in parallel (such as make # and dpkg-buildpackage -NUM_JOBS=`cat /proc/cpuinfo | grep processor | awk '{a++} END {print a}'` +NUM_JOBS=`grep -c "^processor" /proc/cpuinfo` # Store location of the calling script. TOP_SCRIPT_DIR="${TOP_SCRIPT_DIR:-$(dirname $0)}"