-
Notifications
You must be signed in to change notification settings - Fork 1
/
make-tnetd
executable file
·71 lines (60 loc) · 1.28 KB
/
make-tnetd
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
#!/bin/sh
INSTALL_DIR=~/release
mkdir -p -v download
rm -rf ./dl
ln -s ./download dl
clean_root(){
make clean_root
}
clean_linux(){
rm -rf build_mipsel/linux*
}
clean_build(){
rm -rf build_mipsel
}
install(){
mkdir -p $INSTALL_DIR
cp -a bin $INSTALL_DIR
rm -f bin/openwrt*
}
build(){
local ver=$1
local config=$2
clean_linux
temp=`tempfile -p linux -s -config`
if [ -r target/linux/ar7-$ver/config-$config ]; then
cp target/linux/ar7-$ver/config $temp
cp target/linux/ar7-$ver/config-$config target/linux/ar7-$ver/config
fi
cp target/linux/ar7-$ver/openwrt-config-$config .config
make oldconfig DEVELOPER=1
make --jobs=4 V=99
ret=$?
if [ "$ret" = 0 ]; then
rename "s/.bin/-$config.bin/" bin/*
install
fi
if [ -s $temp ]; then
cp $temp target/linux/ar7-$ver/config
fi
rm $temp
[ "$ret" != 0 ] && exit 1
}
make_snapshot() {
dir=$(basename `pwd`)
cd ..
tar cvjf $INSTALL_DIR/openwrt-midge-snapshot-`date +%Y%m%d`.tar.bz2 \
--exclude $dir/dl \
--exclude $dir/bin \
--exclude $dir/build_mips \
--exclude $dir/build_mipsel \
--exclude $dir/staging_dir_mips \
--exclude $dir/staging_dir_mipsel \
--exclude $dir/toolchain_build_mips \
--exclude $dir/toolchain_build_mipsel \
$dir
}
clean_build
clean_root
build 2.4 midge-tnetd
make_snapshot