All of lore.kernel.org
 help / color / mirror / Atom feed
* [kernel-build 1/2] kernel: modify build via env
@ 2019-05-09  8:07 Norbert Manthey
  2019-05-09  8:07 ` [kernel-build 2/2] kernel: forward build failures Norbert Manthey
  0 siblings, 1 reply; 4+ messages in thread
From: Norbert Manthey @ 2019-05-09  8:07 UTC (permalink / raw)
  To: smatch; +Cc: Marius Hillenbrand, David Woodhouse, Dan Carpenter,
	Norbert Manthey

For certain kernel builds, additional parameter might be specified
that are not picked up by the build system of the kernel via the
environment. This change allows to modify the build target, as well
as extra build arguments for the kernel build.

The following two environment variables are used to control this
behaviour. The value of the target variable is overriden in case
the environment variable is specified.

SMATCH_ENV_TARGET target to be build
SMATCH_ENV_BUILD_PARAM other parameters to be forwarded to make

Signed-off-by: Norbert Manthey <nmanthey@amazon.de>

---
 smatch_scripts/test_kernel.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/smatch_scripts/test_kernel.sh b/smatch_scripts/test_kernel.sh
--- a/smatch_scripts/test_kernel.sh
+++ b/smatch_scripts/test_kernel.sh
@@ -41,6 +41,10 @@ while true ; do
     fi
 done
 
+# receive parameters from environment, which override
+[ -z "${SMATCH_ENV_TARGET:-}" ] || TARGET="$SMATCH_ENV_TARGET"
+[ -z "${SMATCH_ENV_BUILD_PARAM:-}" ] || BUILD_PARAM="$SMATCH_ENV_BUILD_PARAM"
+
 SCRIPT_DIR=$(dirname $0)
 if [ -e $SCRIPT_DIR/../smatch ] ; then
     cp $SCRIPT_DIR/../smatch $SCRIPT_DIR/../bak.smatch
@@ -55,7 +59,7 @@ fi
 make clean
 find -name \*.c.smatch -exec rm \{\} \;
 make -j${NR_CPU} $ENDIAN -k CHECK="$CMD -p=kernel --file-output --succeed $*" \
-	C=1 $TARGET 2>&1 | tee $LOG
+	C=1 $BUILD_PARAM $TARGET 2>&1 | tee $LOG
 find -name \*.c.smatch -exec cat \{\} \; -exec rm \{\} \; > $WLOG
 find -name \*.c.smatch.sql -exec cat \{\} \; -exec rm \{\} \; > $WLOG.sql
 find -name \*.c.smatch.caller_info -exec cat \{\} \; -exec rm \{\} \; > $WLOG.caller_info
-- 
2.7.4




Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrer: Christian Schlaeger, Ralf Herbrich
Ust-ID: DE 289 237 879
Eingetragen am Amtsgericht Charlottenburg HRB 149173 B


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-05-09 10:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-09  8:07 [kernel-build 1/2] kernel: modify build via env Norbert Manthey
2019-05-09  8:07 ` [kernel-build 2/2] kernel: forward build failures Norbert Manthey
2019-05-09  9:34   ` Dan Carpenter
2019-05-09 10:03     ` Norbert Manthey

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.