-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMAKEALL
executable file
·111 lines (101 loc) · 2.58 KB
/
MAKEALL
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/bin/bash
usage()
{
cat <<-EOF
Usage: MAKEALL [options] [Blackfin platforms to build]
Options:
-u Update defconfigs after successful build
-a Build for all Blackfin variants (e.g. test BF537-STAMP on BF534/BF536)
-c Build kernel sources with C=1
-cc Build kernel sources with C=2
-h This help screen
If you do not specify any Blackfin platforms, the list will be taken
automatically from all the defconfigs found in arch/blackfin/configs/
EOF
[[ -n $* ]] && printf "\nError: $*\n" 1>&2 && exit 1
exit 0
}
update=false
all=false
makeargs=
while [[ -n $1 ]] ; do
case $1 in
-u) update=true;;
-a) all=true;;
-c) makeargs="C=1";;
-cc) makeargs="C=2";;
-h) usage;;
--) break;;
-*) usage "Unknown argument $1";;
*) break;;
esac
shift
done
jobs=$(grep -cs processor /proc/cpuinfo)
jobs=$((${jobs:-1} * 2))
procs() {
local cpu=$(sed -n '/^CONFIG_BF5[0-9][0-9]=y/{s:CONFIG_::;s:=y::p}' .config)
if ! ${all} ; then
echo ${cpu}
return
fi
case $cpu in
BF51[2468]) echo BF51{2,4,6,8};;
BF52[234567]) echo BF52{2,3,4,5,6,7};;
BF53[123]) echo BF53{1,2,3};;
BF53[467]) echo BF53{4,6,7};;
BF53[89]) echo BF53{8,9};;
BF54[24789]) echo BF54{2,4,7,9,8};;
BF561) echo BF561;;
*) echo FIXME;;
esac
}
# workaround some kconfig dependencies which cannot be fully
# expressed in the kconfig for whatever reasons
check_kconfig() {
# disable MUSB if SOC isnt supported
if ! grep -qs USB_MUSB_SOC=y .config ; then
sed -i '/CONFIG_USB_MUSB_HDRC=y/d' .config
fi
}
make="make -s ARCH=blackfin CROSS_COMPILE=bfin-uclinux-"
export CONFIG_DEBUG_SECTION_MISMATCH=y
if [[ ! -e arch/blackfin/configs ]] ; then
echo "Not in a kernel directory!?"
exit 1
fi
ret=0
[[ -z $* ]] && set -- $(cd arch/blackfin/configs ; echo *_defconfig | sed s:_defconfig::g)
for b in "$@" ; do
b="${b}_defconfig"
echo "### $b"
${make} $b >& /dev/null
for p in $(procs) ; do
echo -n "###### $p: "
rm -f $b.$p.log*
${make} $b >& /dev/null
sed -i \
-e 1iCONFIG_${p}=y \
-e '/^# CONFIG_BF[[:digit:]]* is not set$/d' \
-e '/^CONFIG_BF[[:digit:]]*=y/d' \
.config
yes "" | ${make} oldconfig >& /dev/null
check_kconfig
yes "" | ${make} oldconfig >& /dev/null
${make} ${makeargs} -j${jobs} >& $b.$p.log
if [[ $? -eq 0 ]] ; then
echo "OK"
else
# "normalize" and "minimize" the error log
${make} -j1 >& $b.$p.log.FAIL
${make} -j1 >& $b.$p.log.FAIL
echo "FAIL"
((++ret))
fi
done
if ${update} ; then
diff -u .config arch/blackfin/configs/$b || :
sed -e 4d .config > arch/blackfin/configs/$b
fi
done
exit ${ret}