Enable make image multicore

This commit is contained in:
2022-12-23 23:40:24 -05:00
parent e7b4ff46ae
commit ba2382ba4c

View File

@@ -263,8 +263,6 @@ sshBackup() {
makeImage() { makeImage() {
debug "${FUNCNAME[0]}" debug "${FUNCNAME[0]}"
declare _nprocs
# Reuse the existing output # Reuse the existing output
if [[ -d "${P_ARR[out_bin_dir]}" ]]; then if [[ -d "${P_ARR[out_bin_dir]}" ]]; then
if askOk "${P_ARR[out_bin_dir]} exists. Rebuild?"; then if askOk "${P_ARR[out_bin_dir]} exists. Rebuild?"; then
@@ -276,9 +274,14 @@ makeImage() {
[[ ! -d "${P_ARR[out_bin_dir]}" ]] && mkdir -p "${P_ARR[out_bin_dir]}" [[ ! -d "${P_ARR[out_bin_dir]}" ]] && mkdir -p "${P_ARR[out_bin_dir]}"
# build image if ! make image \
debug "make image BIN_DIR=${P_ARR[out_bin_dir]} PROFILE=${P_ARR[profile]} PACKAGES=${P_ARR[packages]} FILES=$FILESDIR --directory=${P_ARR[source_dir]} > make.log" BIN_DIR="${P_ARR[out_bin_dir]}" \
if ! make image BIN_DIR="${P_ARR[out_bin_dir]}" PROFILE="${P_ARR[profile]}" PACKAGES="${P_ARR[packages]}" FILES="$FILESDIR" --directory="${P_ARR[source_dir]}" > make.log; then PROFILE="${P_ARR[profile]}" \
PACKAGES="${P_ARR[packages]}" \
FILES="$FILESDIR" \
--directory="${P_ARR[source_dir]}" \
--jobs=$(( $(nproc) - 1 )) \
> make.log; then
echo "Make image failed!" echo "Make image failed!"
exit 1 exit 1
fi fi