-
Notifications
You must be signed in to change notification settings - Fork 1
/
cf-sg
executable file
·93 lines (78 loc) · 2.17 KB
/
cf-sg
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
#!/bin/sh
cfg=./.cf-sg
pn=`basename $0`
usage()
{
echo 1>&2 "Usage: $pn {sigrand | zelax | sviazinvest} [-nofw]"
exit 1
}
if test "$#" -lt 1 -o "$#" -gt 2; then
usage
fi
oem=$1; shift
case $oem in
sigrand) make_target= ;;
zelax) make_target= ;;
sviazinvest) make_target= ;;
*) usage;;
esac
nofw=0
if test "$#" -eq 1; then
case $1 in
-nofw) nofw=1;;
*) usage;;
esac
shift
fi
unset NOFW_OLD NOFW_CUR OEM_OLD OEM_CUR
mk_cfg()
{
rm -f $cfg
#echo "creating $cfg, NOFW_OLD: $NOFW_OLD, NOFW_CUR: $NOFW_CUR, nofw: $nofw, make_target: $make_target"
echo "OEM_OLD=$OEM_OLD" >> $cfg
echo "OEM_CUR=$OEM_CUR" >> $cfg
echo "" >> $cfg
echo "NOFW_OLD=$NOFW_OLD" >> $cfg
echo "NOFW_CUR=$NOFW_CUR" >> $cfg
echo "" >> $cfg
echo "MAKE_TARGET=$make_target" >> $cfg
}
if test -e $cfg; then
. $cfg
if test "$oem" != "$OEM_CUR"; then
OEM_OLD=$OEM_CUR
OEM_CUR=$oem;
else
OEM_OLD=$OEM_CUR
fi
if test "$nofw" -ne "$NOFW_CUR"; then
NOFW_OLD=$NOFW_CUR
NOFW_CUR=$nofw;
else
NOFW_OLD=$NOFW_CUR
fi
mk_cfg
else
OEM_OLD="" # force ' OEM_CUR != OEM_OLD' at first time
OEM_CUR=$oem
NOFW_OLD=-1 # force 'NOFW_CUR != NOFW_OLD' at first time
NOFW_CUR=$nofw
mk_cfg
fi
. $cfg
rm -f .config* .tmpconfig.h
cp -a config_$oem .config
if test "$NOFW_CUR" -ge 1; then
echo "Unset FW in .config"
sed -i -r -e 's/^.*(BR2_PACKAGE_KMOD_ARPTABLES)=./\1=n/g' .config
sed -i -r -e 's/^.*(BR2_PACKAGE_KMOD_EBTABLES)=./\1=n/g' .config
sed -i -r -e 's/^.*(BR2_PACKAGE_KMOD_IPT.*)=./\1=n/g' .config
sed -i -r -e 's/^.*(BR2_PACKAGE_KMOD_IMQ.*)=./\1=n/g' .config
sed -i -r -e 's/^.*(BR2_PACKAGE_KMOD_IP6TABLES)=./\1=n/g' .config
sed -i -r -e 's/^.*(BR2_COMPILE_IPTABLES)=./\1=n/g' .config
sed -i -r -e 's/^.*(BR2_PACKAGE_IPTABLES.*)=./\1=n/g' .config
sed -i -r -e 's/^.*(BR2_PACKAGE_IP6TABLES)=./\1=n/g' .config
echo "BR2_LINUX_2_6_SIGRAND5120_NOFW=y" >> .config # target/linux/sigrand5120-2.6/Makefile
fi
mkdir -p log
yes '' | make oldconfig 1>> log/oldconfig-${OEM_CUR}-NOFW-${NOFW_CUR}-$$.log 2>&1