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>
This commit is contained in:
Johannes Kimmel 2021-01-11 08:36:02 +01:00
parent 5469399112
commit c78130b15d
Signed by: jkimmel
GPG Key ID: 6B8F7858CE2AF6A5
1 changed files with 1 additions and 1 deletions

View File

@ -230,7 +230,7 @@ build() {
opath=$(pwd)
cd "$builddir"
cpus=$(grep -c processor /proc/cpuinfo)
cpus=$(nproc)
case "$1" in
"debug")