diff options
author | Leah Rowe <leah@libreboot.org> | 2024-03-27 07:14:47 +0000 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2024-03-27 07:38:16 +0000 |
commit | 332778973c3bca867dd2aa608b89a017a2e44b77 (patch) | |
tree | b28dc9ba3617bad99a0564551c4efc9a1301480c /script/update | |
parent | 6ebab10caa5be6fc1cfd244e745851687d4bd70d (diff) |
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 <leah@libreboot.org>
Diffstat (limited to 'script/update')
-rwxr-xr-x | script/update/release | 7 | ||||
-rwxr-xr-x | script/update/trees | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/script/update/release b/script/update/release index c4101b5a..25ada9da 100755 --- a/script/update/release +++ b/script/update/release @@ -215,11 +215,12 @@ mktarball() mkdir -p "${2%/*}" || $err "mk, !mkdir -p \"${2%/*}\"" if [ "${tar_implementation% *}" = "tar (GNU tar)" ]; then tar --sort=name --owner=root:0 --group=root:0 \ - --mtime="UTC 2024-02-25" -c "$1" | xz -T0 -9e > "$2" || \ - $err "mktarball 1, ${1}" + --mtime="UTC 2024-02-25" -c "$1" | xz -T$threads -9e \ + > "$2" || $err "mktarball 1, ${1}" else # TODO: reproducible tarballs on non-GNU systems - tar -c "$1" | xz -T0 -9e > "$2" || $err "mktarball 2, $1" + tar -c "$1" | xz -T$threads -9e > "$2" || \ + $err "mktarball 2, $1" fi ( [ "${2%/*}" != "${2}" ] && x_ cd "${2%/*}" diff --git a/script/update/trees b/script/update/trees index 40ff1878..ac5743be 100755 --- a/script/update/trees +++ b/script/update/trees @@ -172,7 +172,7 @@ check_cross_compiler() [ -n "${xlang}" ] && export BUILD_LANGUAGES="$xlang" [ -d "${cbdir}/util/crossgcc/xgcc/${_xarch}/" ] && continue - x_ make -C "$cbdir" crossgcc-${_xarch%-*} CPUS=$(nproc) + x_ make -C "$cbdir" crossgcc-${_xarch%-*} CPUS=$threads done } @@ -219,7 +219,7 @@ run_make_command() [ "$project" = "coreboot" ] && [ -z "$mode" ] && x_ \ printf "%s\n" "${version%%-*}" > "$codedir/.coreboot-version" - make $mode -j$(nproc) $makeargs -C "$codedir" || \ + make $mode -j$threads $makeargs -C "$codedir" || \ $err "run_make $codedir: !make $mode" [ "$mode" != "clean" ] && return 0 |