From 20beeec38f682b618e44c8b71d099bd008d1d1f8 Mon Sep 17 00:00:00 2001 From: Rafa Couto Date: Thu, 22 Dec 2016 14:35:55 +0100 Subject: [PATCH] Configurable number of jobs to compile. --- README.md | 2 +- scripts/build.sh | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index aaf8f89..448f55f 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,6 @@ shows the help: ## Thanks - [Javi Loureiro](https://twitter.com/StaticBoardsES) who had the idea for Raspberry Pi devices and provided config files for them. -- [OpenWRT community](https://openwrt.org/) for its great product. +- [OpenWRT community](https://openwrt.org/) for the best embedded operating system based on the Linux kernel. diff --git a/scripts/build.sh b/scripts/build.sh index 92b107c..3d65955 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -27,8 +27,11 @@ cp "$OPENWRT_CONFIGS/$OPENWRT_TARGET.diff" "$OPENWRT_SRC/.config" ./scripts/feeds update -a ./scripts/feeds install -a -PROCESSORS=$(cat /proc/cpuinfo | grep '^processor' | wc -l) -JOBS=$(($PROCESSORS - 1)) +# available processors +if [ -z "$JOBS" ] ; then + PROCESSORS=$(cat /proc/cpuinfo | grep '^processor' | wc -l) + JOBS=$(($PROCESSORS - 1)) +fi # compile time ionice -c 3 nice -n 19 make -j $JOBS V=s