From 332778973c3bca867dd2aa608b89a017a2e44b77 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Wed, 27 Mar 2024 07:14:47 +0000 Subject: allow users to specify number of build threads lbmk otherwise uses nproc to set the number of build threads, in these places: * generic make commands in script/update/trees * crossgcc make command in script/update/trees the -T0 option is also used in script/update/release, when running tar. with this change, you can do: export LBMK_THREADS=x where x is the number of threads. when you then run lbmk, your chosen number of threads will override the default. this may be useful on a host that does not have a lot of memory. Signed-off-by: Leah Rowe --- include/option.sh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/option.sh') diff --git a/include/option.sh b/include/option.sh index 64442d15..8fc80aaa 100755 --- a/include/option.sh +++ b/include/option.sh @@ -22,6 +22,14 @@ eval "$(setvars "" CONFIG_BOARD_DELL_E6400 CONFIG_HAVE_MRC CONFIG_HAVE_ME_BIN \ CONFIG_IFD_BIN_PATH CONFIG_MRC_FILE _dest board boarddir \ CONFIG_HAVE_REFCODE_BLOB CONFIG_REFCODE_BLOB_FILE)" +threads= +set | grep LBMK_THREADS 1>/dev/null 2>/dev/null || threads=$(nproc) || : +[ -z "$threads" ] && threads=$LBMK_THREADS +[ -z "$threads" ] && threads=1 # LBMK_THREADS not set, and nproc failed + +expr "X$threads" : "X-\{0,1\}[0123456789][0123456789]*$" \ + 1>/dev/null 2>/dev/null || threads=1 # user specified a non-integer + items() { rval=1 -- cgit v1.2.1