aboutsummaryrefslogtreecommitdiff
path: root/kbuildtest.sh
diff options
context:
space:
mode:
authorAKASHI Takahiro <takahiro.akashi@linaro.org>2015-10-30 10:44:42 +0900
committerAKASHI Takahiro <takahiro.akashi@linaro.org>2015-10-30 16:26:36 +0900
commitfd8509e2a6f4dbccba19b9f5715f6fc89e1f5010 (patch)
tree49ebdc339bc3e2dbb1a11e0ae7caada4b451b189 /kbuildtest.sh
parentc253b270519992303fe0d1c4c8447cae7ca743dc (diff)
downloadkbuildtest-fd8509e2a6f4dbccba19b9f5715f6fc89e1f5010.tar.gz
add -c option
This allows for using extra config targets, like allmodconfig, in addition to auto-generated config files. For example, $ kbuildtest.sh -c allmodconfig -v HEAD^ ... Creating configs for ca1e96d ... 8: CONFIG_FTRACE=y CONFIG_FUNCTION_TRACER=y CONFIG_DYNAMIC_FTRACE=y CONFIG_FUNCTION_GRAPH_TRACER=y CONFIG_STACK_TRACER=y 9: allmodconfig ... Processing patch ca1e96d (1 2 3 4 5 6 7 8 9) ... ca1e96d/8 PASS ca1e96d/9 PASS
Diffstat (limited to 'kbuildtest.sh')
-rwxr-xr-xkbuildtest.sh82
1 files changed, 63 insertions, 19 deletions
diff --git a/kbuildtest.sh b/kbuildtest.sh
index d5a272a..9d1c0c9 100755
--- a/kbuildtest.sh
+++ b/kbuildtest.sh
@@ -4,7 +4,7 @@
# GPL v2
SELF=$0
-GETOPTARGS="a:A:b:C:e:hi:Il:no:p:Sv"
+GETOPTARGS="a:A:b:c:C:e:hi:Il:no:p:Sv"
ARGS=$(getopt ${GETOPTARGS} $*)
function print_usage() {
@@ -13,6 +13,7 @@ function print_usage() {
echo " -a <config>...: forcedly add these configs"
echo " -A <ARCH>: overide ARCH"
echo " -b <build dir>: passed to 'make' as O="
+ echo " -c <config target>...: more config targets, like allmodconfig"
echo " -C <CROSS_COMPILE>: overide CROSS_COMPILE"
echo " -e <config>...: exclude these configs"
echo " -h : help messages"
@@ -43,6 +44,10 @@ function parse_args() {
-b)
BUILDTMPDIR="$2"
shift 2;;
+ -c)
+ CONFIG_TARGETS="$2"
+ CONFIG_TARGETS=${CONFIG_TARGETS//,/ }
+ shift 2;;
-C)
CROSS_COMPILE="$2"
shift 2;;
@@ -211,6 +216,7 @@ function save_env {
fi
echo EXCL_CONFIGS=\"${EXCL_CONFIGS}\" >> ${PARAMFILE}
echo INCL_CONFIGS=\"${INCL_CONFIGS}\" >> ${PARAMFILE}
+ echo CONFIG_TARGETS=\"${CONFIG_TARGETS}\" >> ${PARAMFILE}
echo LOGDIR=${LOGDIR} >> ${PARAMFILE}
echo BUILDDIR=${BUILDDIR} >> ${PARAMFILE}
echo OFLAGS=\"${OFLAGS}\" >> ${PARAMFILE}
@@ -300,27 +306,64 @@ function create_configs {
xargs echo)
i=1
do_combo "${ADD_CONFIGS}" "${COMBO_CONFIGS}"
+
+ for j in $(seq 1 $(expr $i - 1))
+ do
+ make O=${BUILDDIR} defconfig > ${LOGDIR}/$p/$j/config.log 2>&1
+ cat ${LOGDIR}/$p/$c/kernel_config >> ${BUILDDIR}/.config
+ make O=${BUILDDIR} olddefconfig > ${LOGDIR}/$p/$j/config.log 2>&1
+ if [ $? -eq 0 ]
+ then
+ cp ${BUILDDIR}/.config ${LOGDIR}/$p/$j/kernel_config_build
+ fi
+ done
+
+ for t in ${CONFIG_TARGETS}
+ do
+ mkdir ${LOGDIR}/$p/$i
+ ${ECHO} "$i:" $t
+ make O=${BUILDDIR} $t > ${LOGDIR}/$p/$i/config.log 2>&1
+ if [ $? -eq 0 ]
+ then
+ # just for marking
+ echo $t > ${LOGDIR}/$p/$i/kernel_config
+
+ cp ${BUILDDIR}/.config ${LOGDIR}/$p/$i/kernel_config_build
+ fi
+ i = $(expr $i + 1)
+ done
}
function run_build_test {
- if [ -n "${sflag}" ] && [ -f "${LOGDIR}/$p/$c/kernel\config_build" ]
+ if [ -n "${sflag}" ]
then
- cp ${LOGDIR}/$p/$c/kernel_config_build ${BUILDDIR}/.config
+ if [ -f "${LOGDIR}/$p/$c/kernel_config_build" ]
+ then
+ cp ${LOGDIR}/$p/$c/kernel_config_build ${BUILDDIR}/.config
+ else
+ if [ ! -f "${LOGDIR}/$p/$c/kernel_config" ]
+ then
+ echo $p/$c FAIL config >> ${LOGDIR}/results
+ return
+ fi
+ make O=${BUILDDIR} defconfig > ${LOGDIR}/$p/$c/config.log 2>&1
+ cat ${LOGDIR}/$p/$c/kernel_config >> ${BUILDDIR}/.config
+ make O=${BUILDDIR} olddefconfig > ${LOGDIR}/$p/$c/config.log 2>&1
+ if [ $? -ne 0 ]
+ then
+ echo $p/$c FAIL config >> ${LOGDIR}/results
+ return
+ fi
+ cp ${BUILDDIR}/.config ${LOGDIR}/$p/$c/kernel_config_build
+ fi
else
- make O=${BUILDDIR} defconfig > ${LOGDIR}/$p/$c/config.log 2>&1
- cat ${LOGDIR}/$p/$c/kernel_config >> ${BUILDDIR}/.config
- make O=${BUILDDIR} olddefconfig > ${LOGDIR}/$p/$c/config.log 2>&1
- if [ $? -ne 0 ]
+ if [ -f "${LOGDIR}/$p/$c/kernel_config_build" ]
then
+ cp ${LOGDIR}/$p/$c/kernel_config_build ${BUILDDIR}/.config
+ else
echo $p/$c FAIL config >> ${LOGDIR}/results
return
fi
- cp ${BUILDDIR}/.config ${LOGDIR}/$p/$c/kernel_config_build
- fi
-
- if [ -n "${nflag}" ]
- then
- return
fi
${ECHO} $c: make O=${BUILDDIR} ${OFLAGS}
@@ -333,7 +376,7 @@ function run_build_test {
echo $p/$c PASS warning
else
echo $p/$c PASS
- if
+ fi
else
echo $p/$c FAIL
fi >> ${LOGDIR}/results
@@ -349,15 +392,16 @@ function run_build_test_configs {
if [ -z "${sflag}" ]
then
create_configs
- TESTS=$(seq 1 $(expr $i - 1))
- else
- TESTS=$(cd ${LOGDIR}/$p ; ls -v)
fi
+
+ TESTS=$(cd ${LOGDIR}/$p ; ls -v)
# echo TESTS are ${TESTS}
- if [ -z ${nflag} ]
+ if [ -n "${nflag}" ]
then
- ${ECHO} Processing patch $p "($(echo ${TESTS} | xargs echo))"
+ return
+ else
+ ${ECHO} Processing patch $p "($(echo ${TESTS} | xargs echo))"
fi
error=0