From owner-svn-src-all@freebsd.org Mon Apr 4 21:06:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE626B03B0F; Mon, 4 Apr 2016 21:06:45 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95D6B139F; Mon, 4 Apr 2016 21:06:45 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u34L6iZO014442; Mon, 4 Apr 2016 21:06:44 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u34L6ivX014440; Mon, 4 Apr 2016 21:06:44 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201604042106.u34L6ivX014440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 4 Apr 2016 21:06:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297564 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Apr 2016 21:06:46 -0000 Author: glebius Date: Mon Apr 4 21:06:44 2016 New Revision: 297564 URL: https://svnweb.freebsd.org/changeset/base/297564 Log: Add early_customize_cmd() that allows to register custom functions run before the build stage. Reviewed by: imp Obtained from: Netflix Modified: head/tools/tools/nanobsd/defaults.sh head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Mon Apr 4 20:33:16 2016 (r297563) +++ head/tools/tools/nanobsd/defaults.sh Mon Apr 4 21:06:44 2016 (r297564) @@ -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 ( ) { Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Mon Apr 4 20:33:16 2016 (r297563) +++ head/tools/tools/nanobsd/nanobsd.sh Mon Apr 4 21:06:44 2016 (r297564) @@ -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