summaryrefslogtreecommitdiffstats
path: root/resources/scripts/helpers/build/roms/withgrub_helper
diff options
context:
space:
mode:
Diffstat (limited to 'resources/scripts/helpers/build/roms/withgrub_helper')
-rwxr-xr-xresources/scripts/helpers/build/roms/withgrub_helper13
1 files changed, 12 insertions, 1 deletions
diff --git a/resources/scripts/helpers/build/roms/withgrub_helper b/resources/scripts/helpers/build/roms/withgrub_helper
index bd1af19..16e861e 100755
--- a/resources/scripts/helpers/build/roms/withgrub_helper
+++ b/resources/scripts/helpers/build/roms/withgrub_helper
@@ -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
if (( $# != 1 )); then
printf "Usage: ./buildrom-withgrub boardname\n"
@@ -98,7 +109,7 @@ do
make clean
mv "config_${romtype}" ".config"
cp "../../grub_${romtype}.elf" "grub.elf"
- make -j$(nproc)
+ make -j${cores}
rm -f "grub.elf"
mv "build/coreboot.rom" "${boardtarget}_${romtype}.rom"
# .config no longer needed