-
Notifications
You must be signed in to change notification settings - Fork 2
/
make-bcm6345
executable file
·132 lines (115 loc) · 3.7 KB
/
make-bcm6345
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/bin/sh
INSTALL_DIR=/home/`whoami`/FlyRouterBIN
mkdir -p ${INSTALL_DIR}/download
rm -rf ./dl
ln -s ${INSTALL_DIR}/download dl
hack_toolchain_wive(){
STAGDIR="staging_dir_mips"
#rm -rf $STAGDIR; mkdir -p $STAGDIR
rm -rf $STAGDIR
tar xvfz dl/0-toolchain_bcm6345.tgz
mv 0-toolchain_bcm6345 $STAGDIR
#
#cp -r /home/builder/0-zero/build_sinus1054/release-20100108/toolchain/* $STAGDIR
ln -f $STAGDIR/mips-linux-uclibc/lib/* $STAGDIR/lib/
#mkdir -p /opt/gcc-3.3.3/toolchain_build_mips/ccache-2.3/cache
#ln -fs `pwd`/${STAGDIR} /home/builder/0-zero/build_sinus1054/release-20100108/toolchain
mkdir $STAGDIR/stampfiles
touch \
$STAGDIR/stampfiles/.toolchain_binutils-compile \
$STAGDIR/stampfiles/.toolchain_binutils-install \
$STAGDIR/stampfiles/.toolchain_binutils-prepare \
$STAGDIR/stampfiles/.toolchain_gcc-compile \
$STAGDIR/stampfiles/.toolchain_gcc-install \
$STAGDIR/stampfiles/.toolchain_gcc-prepare \
$STAGDIR/stampfiles/.toolchain_gdb-compile \
$STAGDIR/stampfiles/.toolchain_gdb-install \
$STAGDIR/stampfiles/.toolchain_gdb-prepare \
$STAGDIR/stampfiles/.toolchain_kernel-headers-prepare \
$STAGDIR/stampfiles/.toolchain_libnotimpl-compile \
$STAGDIR/stampfiles/.toolchain_libnotimpl-install \
$STAGDIR/stampfiles/.toolchain_libnotimpl-prepare \
$STAGDIR/stampfiles/.toolchain_uClibc-compile \
$STAGDIR/stampfiles/.toolchain_uClibc-install \
$STAGDIR/stampfiles/.toolchain_uClibc-prepare
#
echo "3.3.3" > $STAGDIR/gcc_version
echo "0.9.26" > $STAGDIR/uclibc_version
}
clean_root(){
make root_clean
}
clean_linux(){
rm -rf build_mips/linux*
}
clean_build(){
rm -rf build_mips
}
install(){
rev=`cat Revision | head -n 1 | awk '/^Revision:/ { print $2 }'`
#
mkdir -p $INSTALL_DIR/firmware-mips-sinus1054/ $INSTALL_DIR/packages-mips-sinus1054/
cp -af target/linux/image/brcm6345/firmware.bin $INSTALL_DIR/firmware-mips-sinus1054/$1-r${rev}-`date +%Y%m%d%H%M`.bin
rm -f target/linux/image/brcm6345/root_fs trunk/target/linux/image/brcm6345/kernel trunk/target/linux/image/brcm6345/firmware.bin
cp -f bin/packages/* $INSTALL_DIR/packages-mips-sinus1054/
rm -rf bin
}
build(){
local ver=$1
local config=$2
export SINUS_CONFIG=$2
clean_build
clean_root
temp=`tempfile -p linux -s -config`
if [ -r target/linux/brcm6345-$ver/config-$config ]; then
cp target/linux/brcm6345-$ver/config $temp
cp target/linux/brcm6345-$ver/config-$config target/linux/brcm6345-$ver/config
fi
cp target/linux/brcm6345-$ver/system-$config .config
make oldconfig DEVELOPER=1
make --jobs=3
#make --jobs=1 V=99
ret=$?
if [ "$ret" = 0 ]; then
rename "s/.bin/-$config.bin/" bin/*
install $config
fi
if [ -s $temp ]; then
cp $temp target/linux/brcm6345-$ver/config
fi
rm $temp
[ "$ret" != 0 ] && exit 1
}
upload_firmware() {
DESTINATION="vu2049@hosting:~/htdocs/downloads/software"
mkdir -p $DESTINATION/sinus1054/upgrade/2011-testing/
cp ${INSTALL_DIR}/firmware-mips-sinus1054/sinus1054* $DESTINATION/sinus1054/upgrade/2011-testing/
}
upload_packages() {
DESTINATION="vu2049@hosting:~/htdocs/downloads/software"
cp ${INSTALL_DIR}/packages-mips-sinus1054/* $DESTINATION/sinus1054/packages/
}
#
#download_component
rm -rf bin build_mips
#
# rebuild toolchain
rm -rf staging_dir_mips toolchain_build_mips
# or
#hack_toolchain_wive
#
#
### Config section ###
#build 2.4 sinus1054-kernel
#build 2.4 sinus1054-telemetry_beta
build 2.4 sinus1054-telemetry_micro
#build 2.4 sinus1054-arlix_noppx_nonat_noweb
#build 2.4 sinus1054-lottery_ppx_nat_web
#build 2.4 sinus1054-remserial_noppx_nat_noweb
#build 2.4 sinus1054-satm3_ppx_nat_web
#build 2.4 sinus1054-chilli_ppx_nat_web
#build 2.4 sinus1054-admin_packages
#build 2.4 sinus1054-admin_packages_oldver
#
#upload_packages
#upload_firmware