-
Notifications
You must be signed in to change notification settings - Fork 0
/
kbuild.sh
executable file
·73 lines (62 loc) · 2.12 KB
/
kbuild.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#Used to configure kernel
#Should be invoked from KERNEL_ROOT directory
config_name=$1
build_modules=$2
config_ext=".txt"
target_name="uImage"
logname="build_log_"$config_name$config_ext
make -j4 distclean > /dev/null
log_init_testcase kernel buildtests $config_name
if [ -e $KBUILDCONFIG/$config_name ]
then
cp $KBUILDCONFIG/$config_name .config
else
$KBUILDCONFIG/intreeconfig.sh $config_name 2>>$RESULTS_DIR/$logname
fi
scripts/config --enable CONFIG_USB_NET_SMSC95XX
scripts/config --enable CONFIG_USB_EHCI_HCD
scripts/config --enable CONFIG_USB_EHCI_HCD_OMAP
scripts/config --enable CONFIG_DEBUG_SECTION_MISMATCH
compstr="$CROSS_COMPILE"gcc
make -j4 CC="$CCACHE $compstr" $target_name 2>>$RESULTS_DIR/$logname
build_success=$?
if [ $build_success == 0 ]
then
mv $BUILD_ROOT/arch/arm/boot/$target_name $RESULTS_DIR/$target_name"_"$config_name
log_finish_testcase kernel buildtests $config_name 500
else
xlogtmp="see $logname for details"
#Log dump to console for easy grepping
cat $RESULTS_DIR/$logname
log_finish_testcase kernel buildtests $config_name 500 "$xlogtmp"
fi
if [ $build_success == 0 -a $build_modules == 'y' ]
then
log_init_testcase kernel buildtests $config_name"-modules"
target_name="modules"
modules_dir=kernelmods
rm -fr $modules_dir
mkdir $modules_dir
make -j4 CC="$CCACHE $compstr" INSTALL_MOD_PATH=$modules_dir $target_name 2>>$RESULTS_DIR/$logname
build_success=$?
if [ $build_success == 0 ]
then
log_finish_testcase kernel buildtests $config_name"-modules" 200
else
xlogtmp="see $logname for details"
log_finish_testcase kernel buildtests $config_name"-modules" 120 "$xlogtmp"
fi
fi
if [ $build_success == 0 ]
then
log_init_testcase kernel buildtests $config_name"-compiler-warnings"
cwcount=`sort $RESULTS_DIR/$logname | uniq | grep -c "warning:"`
echo "Warning count= $cwcount"
if [ $cwcount -gt 10 ]
then
xlogtmp="More than 10 compiler warnings!!.Warning count=$cwcount"
log_finish_testcase kernel buildtests $config_name"-compiler-warnings" 10 "$xlogtmp"
else
log_finish_testcase kernel buildtests $config_name"-compiler-warnings" 10
fi
fi