From: Michael Tremer Date: Wed, 8 Jul 2026 13:50:26 +0000 (+0000) Subject: make.sh: Improve CPU core count detection X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d63331e5c04b050b47df90153b6bafb9fc720641;p=ipfire-2.x.git make.sh: Improve CPU core count detection Signed-off-by: Michael Tremer --- diff --git a/make.sh b/make.sh index b060bfbdf..48e6d90cd 100755 --- a/make.sh +++ b/make.sh @@ -152,7 +152,12 @@ find_base() { } system_processors() { - getconf _NPROCESSORS_ONLN 2>/dev/null || echo "1" + # On some systems, the build system might run in a CPU affinity group + # which means that some CPUs are not available to be used. getconf will + # however report the total number which launches more processes than + # we want. nproc gets this right (without --all) so we will prefer + # nproc, but fall back to getconf. + nproc 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null || echo "1" } system_memory() {