diff --git a/sdk/build-github.sh b/sdk/build-github.sh index 437ec5f8f..f3b25b159 100755 --- a/sdk/build-github.sh +++ b/sdk/build-github.sh @@ -151,7 +151,10 @@ YOCTO_IMGS_DIR="${WORKSPACE}/images" YOCTO_INST_DIR="${WORKSPACE}/dey.$(echo ${DY_REVISION} | tr '/' '_')" YOCTO_PROJ_DIR="${WORKSPACE}/projects" -CPUS="$(grep -c processor /proc/cpuinfo)" +# If CPUS is unset, set it with the machine cpus +if [ -z "${CPUS}" ]; then + CPUS="$(grep -c processor /proc/cpuinfo)" +fi [ ${CPUS} -gt 1 ] && MAKE_JOBS="-j${CPUS}" printf "\n[INFO] Build Yocto \"${DY_REVISION}\" for \"${DY_PLATFORMS}\" (cpus=${CPUS})\n\n" diff --git a/sdk/build.sh b/sdk/build.sh index cb8b75df9..a86aa5831 100755 --- a/sdk/build.sh +++ b/sdk/build.sh @@ -188,7 +188,10 @@ YOCTO_INST_DIR="${WORKSPACE}/digi-yocto-sdk.$(echo ${DY_REVISION} | tr '/' '_')" YOCTO_DOWNLOAD_DIR="${DY_DOWNLOADS:-${WORKSPACE}}/downloads" YOCTO_PROJ_DIR="${WORKSPACE}/projects" -CPUS="$(grep -c processor /proc/cpuinfo)" +# If CPUS is unset, set it with the machine cpus +if [ -z "${CPUS}" ]; then + CPUS="$(grep -c processor /proc/cpuinfo)" +fi [ ${CPUS} -gt 1 ] && MAKE_JOBS="-j${CPUS}" printf "\n[INFO] Build Yocto \"${DY_REVISION}\" for \"${DY_PLATFORMS}\" (cpus=${CPUS})\n\n"