Powered by Linux
[kernel-build 1/2] kernel: modify build via env — Semantic Matching Tool

[kernel-build 1/2] kernel: modify build via env

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>

---
 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





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux