From 558ee04a07715d504706fc78e8490c1639a8d3cd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mat=C3=ADas=20Fonzo?= Date: Wed, 15 Feb 2023 17:28:12 -0300 Subject: [PATCH] archive: dragora-tools/build-for-release: Use real cores in the final release build MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Matías Fonzo --- archive/dragora-tools/build-for-release | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/archive/dragora-tools/build-for-release b/archive/dragora-tools/build-for-release index df50d739..44a516cf 100644 --- a/archive/dragora-tools/build-for-release +++ b/archive/dragora-tools/build-for-release @@ -1,7 +1,7 @@ #! /bin/bash - # Specific script for the final Dragora release process. # -# Copyright (c) 2021-2022 Matias Fonzo, . +# Copyright (c) 2021-2023 Matias Fonzo, . # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,13 +14,18 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - # -## ChangeLog (current version is 0.2). +## ChangeLog. +# +#= Version 0.4: +# +# - Build the final system using real cores (instead of threads, +# if possible) to try to guarantee an error-free compilation. +# Instructions taken from https://stackoverflow.com/questions/6481005/how-to-obtain-the-number-of-cpus-cores-in-linux-from-the-command-line # #= Version 0.3: # -# - Use the -f (force) option when building on the phase1. +# - Use the -f (force) option when building on 'phase-1'. # #= Version 0.2: # @@ -61,8 +66,9 @@ qi order /usr/src/qi/recipes/*.order | \ # Parallel jobs for the final system (phase-2) # # The default is to use the maximum number of -# processors (physical/threading) -JOBS="${JOBS:-$(nproc)}" +# installed processors (this should work on +# hyperthreading and non-hyperthreading systems) +JOBS="${JOBS:-$(awk -F: '/^physical/ && !ID[$2] { P++; ID[$2]=1 }; /^cpu cores/ { CORES=$2 }; END { print CORES*P }' /proc/cpuinfo)}" # Declare recipes that do not require reconstruction: exclude_list='!/pass-?|^data\/|docbook\/|xorg\/doc\/|xorg\/font\/|tde\/tde-i18n|devel\/fortify-headers|kernel\/headers|kernel\/generic|kernel\/buildtree-generic|kernel\/firmware|tools\/dragora-installer/' -- 2.11.4.GIT