aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2021-07-15 22:07:51 +0000
committerWarner Losh <imp@FreeBSD.org>2021-07-21 16:13:11 +0000
commit54ff80e07f3a313b810fb5ea79857f93ec80fcab (patch)
tree1e0666fc74d3e49c059667eecb58b7a97870a9e6
parent50b2e5d608d2d8876af2a8d4e5c4e60867f9ad96 (diff)
downloadsrc-54ff80e07f3a313b810fb5ea79857f93ec80fcab.tar.gz
src-54ff80e07f3a313b810fb5ea79857f93ec80fcab.zip
nanobsd: default to -j $hw.ncpu
For paralllel builds, default to using all the CPUs on the system. The old default of -j 3 was too few. Sponsored by: Netflix (cherry picked from commit 7e3a794be3752d21fe760cfb2a38665532c4b6b4)
-rwxr-xr-xtools/tools/nanobsd/defaults.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh
index 7bc74c42170e..77c0e216ec80 100755
--- a/tools/tools/nanobsd/defaults.sh
+++ b/tools/tools/nanobsd/defaults.sh
@@ -67,7 +67,8 @@ NANO_PKG_META_BASE=/var/db
# Make & parallel Make
NANO_MAKE="make"
-NANO_PMAKE="make -j 3"
+NANO_NCPU=$(sysctl -n hw.ncpu)
+NANO_PMAKE="make -j $NANO_NCPU"
# The default name for any image we create.
NANO_IMGNAME="_.disk.full"
@@ -920,6 +921,7 @@ set_defaults_and_export ( ) {
export_var NANO_MAKE_CONF_INSTALL
export_var NANO_MEDIASIZE
export_var NANO_NAME
+ export_var NANO_NCPU
export_var NANO_NEWFS
export_var NANO_OBJ
export_var NANO_PMAKE