aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2016-04-04 21:06:44 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2016-04-04 21:06:44 +0000
commit5b4ca9d716b1891ec08d9284bb8cbf0331317ccb (patch)
treeccb1f9aaecb875704ed6d2c511f659971ea74ffe /tools
parentd79fa8ec77b4d2dea0ed9828f0fc9003316a17bb (diff)
downloadsrc-5b4ca9d716b1891ec08d9284bb8cbf0331317ccb.tar.gz
src-5b4ca9d716b1891ec08d9284bb8cbf0331317ccb.zip
Add early_customize_cmd() that allows to register custom functions run
before the build stage. Reviewed by: imp Obtained from: Netflix
Notes
Notes: svn path=/head/; revision=297564
Diffstat (limited to 'tools')
-rwxr-xr-xtools/tools/nanobsd/defaults.sh28
-rwxr-xr-xtools/tools/nanobsd/nanobsd.sh2
2 files changed, 30 insertions, 0 deletions
diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh
index 3a9864a94298..cb7a2d1ee9d2 100755
--- a/tools/tools/nanobsd/defaults.sh
+++ b/tools/tools/nanobsd/defaults.sh
@@ -83,6 +83,9 @@ NANO_KERNEL=GENERIC
# Use "default" to install all built modules.
NANO_MODULES=
+# Early customize commands.
+NANO_EARLY_CUSTOMIZE=""
+
# Customize commands.
NANO_CUSTOMIZE=""
@@ -450,6 +453,22 @@ native_xtools ( ) (
)
#
+# Run the requested set of early customization scripts, run before
+# buildworld.
+#
+run_early_customize() {
+
+ pprint 2 "run early customize scripts"
+ for c in $NANO_EARLY_CUSTOMIZE
+ do
+ pprint 2 "early customize \"$c\""
+ pprint 3 "log: ${NANO_LOG}/_.early_cust.$c"
+ pprint 4 "`type $c`"
+ { set -x ; $c ; set +x ; } >${NANO_LOG}/_.early_cust.$c 2>&1
+ done
+}
+
+#
# Run the requested set of customization scripts, run after we've
# done an installworld, installed the etc files, installed the kernel
# and tweaked them in the standard way.
@@ -961,6 +980,15 @@ cust_pkgng ( ) (
#######################################################################
# Convenience function:
+# Register all args as early customize function to run just before
+# build commences.
+
+early_customize_cmd () {
+ NANO_EARLY_CUSTOMIZE="$NANO_EARLY_CUSTOMIZE $*"
+}
+
+#######################################################################
+# Convenience function:
# Register all args as customize function.
customize_cmd ( ) {
diff --git a/tools/tools/nanobsd/nanobsd.sh b/tools/tools/nanobsd/nanobsd.sh
index a17db7ad794e..f140a766df7e 100755
--- a/tools/tools/nanobsd/nanobsd.sh
+++ b/tools/tools/nanobsd/nanobsd.sh
@@ -139,6 +139,8 @@ fi
pprint 1 "NanoBSD image ${NANO_NAME} build starting"
+run_early_customize
+
if $do_world ; then
if $do_clean ; then
clean_build