mirror of
https://github.com/flatcar/scripts.git
synced 2026-05-04 19:56:32 +02:00
Simplified counting CPUs.
Review URL: http://codereview.chromium.org/501153
This commit is contained in:
parent
d3ab617757
commit
63c42aa811
@ -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" \
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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"
|
||||
|
||||
|
||||
@ -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)}"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user