buildscript: count available cpus with nproc
Grepping `/proc/cpuinfo` does not yield the correct number of available cpus when running in a docker container or setting the number of available cpus with taskset. ``` $ taskset 1 grep -c processor /proc/cpuinfo 8 $ taskset 1 nproc 1 ``` This will prevent using too many build jobs on environments where the number of available cpus is reduced. `nproc` is part of `coreutils`. Signed-off-by: Johannes Kimmel <fff@bareminimum.eu> Reviewed-by: Fabian Bläse <fabian@blaese.de> Reviewed-by: Robert Langhammer <rlanghammer@web.de>
This commit is contained in:
parent
5469399112
commit
6e5a6073b8
|
@ -230,7 +230,7 @@ build() {
|
||||||
|
|
||||||
opath=$(pwd)
|
opath=$(pwd)
|
||||||
cd "$builddir"
|
cd "$builddir"
|
||||||
cpus=$(grep -c processor /proc/cpuinfo)
|
cpus=$(nproc)
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
"debug")
|
"debug")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user