summaryrefslogtreecommitdiffstats
path: root/resources/scripts/helpers/build/module/grub
diff options
context:
space:
mode:
Diffstat (limited to 'resources/scripts/helpers/build/module/grub')
-rwxr-xr-xresources/scripts/helpers/build/module/grub13
1 files changed, 12 insertions, 1 deletions
diff --git a/resources/scripts/helpers/build/module/grub b/resources/scripts/helpers/build/module/grub
index f899bc2..5b2c7a6 100755
--- a/resources/scripts/helpers/build/module/grub
+++ b/resources/scripts/helpers/build/module/grub
@@ -24,6 +24,17 @@
[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e
+if [ -z ${NPROC+x} ]; then
+ cores="$(nproc)"
+else
+ case ${NPROC} in
+ ''|*[!0-9]*)
+ printf "value '%s' for NPROC is invalid. non-numeric. Exiting.\n" "${NPROC}"
+ exit 1
+ ;;
+ esac
+ cores="${NPROC}"
+fi
# Build GRUB2 as coreboot payload
@@ -39,5 +50,5 @@ cd grub/
# build
./autogen.sh
./configure --with-platform=coreboot
-make -j$(nproc)
+make -j${cores}
)