2 # exynos_cehckpatch.sh - a tool to test build, defconfig and patch format
4 # Dept : S/W Solution Dev Team
5 # Author : Solution3 Power Part
11 smdk7580_defconfig
=smdk7580_defconfig
12 univ5433_defconfig
=universal5433_defconfig
13 univ7580_defconfig
=universal7580_defconfig
14 univ7420_defconfig
=universal7420_defconfig
16 build_log_smdk7580
=build_log_smdk7580
17 build_log_univ5433
=build_log_univ5433
18 build_log_univ7420
=build_log_univ7420
19 build_log_univ7580
=build_log_univ7580
21 def_log_smdk7580
=def_log_smdk7580
22 def_log_univ7580
=def_log_univ7580
24 checkpatch_helper
=scripts
/exynos_checkpatch_helper.py
28 echo -e "\033[31m""$1""\033[0m"
33 echo 'usage: ./scripts/exynos_checkpatch.sh [-b]'
35 echo ' [-c] [# of patch]'
36 echo ' [-i] [testcase]'
37 echo ' [-h or --help]'
40 echo 'Options are as follows:'
41 echo ' -b Run build test with univ5433, univ7420 and univ7580'
42 echo ' -d Run defconfig test with smdk7580 and univ7580'
43 echo ' -c Run checkpatch.pl test'
44 echo ' -i Run custom test with testcase file'
45 echo ' -h Print help message'
54 build_kernel_and_dtb
()
64 build_kernel_and_dtb
"$1" "$2"
66 if [ -e vmlinux
]; then
72 python
${checkpatch_helper} -b "$1" "$2" ${result}
77 if [ -e arch
/arm64
/configs
/"$1" ]; then
80 dummy_build_log
='0xefefefef'
81 python
${checkpatch_helper} -b "$1" ${dummy_build_log} '0'
88 if [ "$3" = "$5" ]; then
94 python
${checkpatch_helper} -d "$1" "$2" ${result}
99 if [ -e arch
/arm64
/configs
/"$1" ]; then
103 diff -u defconfig arch
/arm64
/configs
/"$1" > "$2"
104 num_word
=`wc -c "$2"`
105 expected_num_word
="0 "$2""
106 compare_config
$1 $2 ${num_word} ${expected_num_word}
109 dummy_def_log
='0xfefefefe'
110 python
${checkpatch_helper} -d "$1" ${dummy_def_log} '0'
114 run_checkpatch_test
()
116 python
${checkpatch_helper} -c "$1"
123 test_type
=`echo ${line} | awk '{print $1}'`
124 if [ ${test_type} = 'b' ]; then
125 defconfig
=`echo ${line} | awk '{print $2}'`
126 build_log
=`echo build_log_${defconfig}`
127 run_build_test
${defconfig} ${build_log}
128 elif [ ${test_type} = 'd' ]; then
129 defconfig
=`echo ${line} | awk '{print $2}'`
130 def_log
=`echo def_log_${defconfig}`
131 run_defconfig_test
${defconfig} ${def_log}
132 elif [ ${test_type} = 'c' ]; then
133 num_patch
=`echo ${line} | awk '{print $2}'`
134 run_checkpatch_test
${num_patch}
135 elif [ ${test_type} = '#' ]; then
138 print_log
'Testcase file is corrupted <- FAIL'
145 run_build_test
${univ5433_defconfig} ${build_log_univ5433}
146 run_build_test
${univ7420_defconfig} ${build_log_univ7420}
147 run_build_test
${smdk7580_defconfig} ${build_log_smdk7580}
148 run_build_test
${univ7580_defconfig} ${build_log_univ7580}
149 run_defconfig_test
${smdk7580_defconfig} ${def_log_smdk7580}
150 run_defconfig_test
${univ7580_defconfig} ${def_log_univ7580}
151 run_checkpatch_test
"$1"
156 if [ "$1" = '-b' ]; then
157 run_build_test
${univ5433_defconfig} ${build_log_univ5433}
158 run_build_test
${univ7420_defconfig} ${build_log_univ7420}
159 run_build_test
${smdk7580_defconfig} ${build_log_smdk7580}
160 run_build_test
${univ7580_defconfig} ${build_log_univ7580}
161 elif [ "$1" = '-d' ]; then
162 run_defconfig_test
${smdk7580_defconfig} ${def_log_smdk7580}
163 run_defconfig_test
${univ7580_defconfig} ${def_log_univ7580}
164 elif [ "$1" = '-c' ]; then
165 run_checkpatch_test
"$2"
166 elif [ "$1" = '-i' ]; then
168 elif [ "$1" = '-h' ] ||
[ "$1" = '--help' ]; then
171 run_default_test
"$1"