Newer
Older
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
#!/bin/bash
# syntax ./boundary_insert CONFIG_1 CONFIG_2 ... CONFIG_n
insert_configs=$*;
boards=`ls -d board/boundary/* | sed 's.board/boundary/..'`;
numboards=0;
numsuccess=0;
numfailures=0;
skipped=0;
for board in ${boards} ; do
update_cnt=0;
already_there=0;
if [ -e board/boundary/${board}/Kconfig ] ; then
target=`grep TARGET_ board/boundary/${board}/Kconfig | sed 's.if ..'`;
defconfigs=`git grep -w CONFIG_${target} configs/ | sed 's.configs/..'| sed 's/_defconfig:.*$//'`;
else
defconfigs="";
fi
board_cfgs=":"
for defconfig in ${defconfigs} ; do
cfgs=""
for insert_config in ${insert_configs} ; do
cnt=`sed -n "/${insert_config}=/=" configs/${defconfig}_defconfig`
if [ "${cnt}" != "" ] ; then
already_there=`expr $already_there + 1`;
else
cfgs="${cfgs} ${insert_config}"
fi
done
if [ "${cfgs}" != "" ] ; then
make ${defconfig}_defconfig;
for insert_config in ${cfgs} ; do
echo "${insert_config}=y" >>.config;
done
make savedefconfig;
diff -q defconfig configs/${defconfig}_defconfig;
if [ $? -eq 0 ] ; then
already_there=`expr $already_there + 1`;
else
if [ $? -eq 1 ] ; then
cp defconfig configs/${defconfig}_defconfig;
echo updated ${defconfig}_defconfig;
git update-index configs/${defconfig}_defconfig;
update_cnt=`expr $update_cnt + 1`;
for insert_config in ${cfgs} ; do
if [ `expr "${board_cfgs}" : "[A-Z0-9_:]*:${insert_config}:"` -eq 0 ] ; then
cnt=`sed -n "/${insert_config}=/=" configs/${defconfig}_defconfig`
if [ "${cnt}" != "" ] ; then
board_cfgs="${board_cfgs}:${insert_config}:"
fi
fi
done
else
numfailures=`expr $numfailures + 1`;
echo -e "\n\n\n!!!!!!!! insert failure for ${defconfig}_defconfig !!!!!!!!!!!!\n\n";
read line;
fi
fi
fi
done
if [ ${update_cnt} != "0" ] ; then
echo "${board}: ${update_cnt} defconfigs updated, ${already_there} already there";
numsuccess=`expr $numsuccess + 1`;
if [ ${board_cfgs} != ":" ] ; then
git c -m"${board}: add ${board_cfgs//::/ } to defconfigs";
else
git c -m"${board}: reorder defconfigs";
fi
else
skipped=`expr $skipped + 1`;
fi
numboards=`expr $numboards + 1`;
done
echo "\n\ninsert for ${numboards} boards. ${numsuccess} succeeded and ${numfailures} failed, ${skipped} skipped";