-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sh
executable file
·50 lines (39 loc) · 1.29 KB
/
build.sh
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
#!/bin/bash
set -ex
export http_proxy=http://localhost:3128
CODENAME=chaos_calmer
VERSION=15.05.1
DEVICE=ar71xx
VARIANT=nand
PROFILE=WNDR4300
SCRIPT=$(readlink -f "$0")
TOPDIR=$(dirname "$SCRIPT")
URL="https://downloads.openwrt.org/$CODENAME/${VERSION}/${DEVICE}/${VARIANT}/OpenWrt-ImageBuilder-${VERSION}-${DEVICE}-${VARIANT}.Linux-x86_64.tar.bz2"
BINDIR="bin/$DEVICE"
FILE=$(basename $URL)
DIR=${FILE%.tar.bz2}
PACKAGES="bash bind-host curl iftop less libiwinfo-lua liblua
libubus-lua libuci-lua lua luci luci-app-cshark
luci-app-ddns luci-app-diag-core luci-app-diag-devinfo
luci-app-firewall luci-app-ntpc luci-app-openvpn
luci-app-sqm luci-app-statistics luci-app-upnp
luci-app-vnstat luci-app-watchcat luci-app-wol luci-base
luci-lib-ip luci-lib-nixio luci-mod-admin-full
luci-proto-ipv6 luci-proto-ppp luci-theme-bootstrap
nginx nginx-syslog openvpn-polarssl rpcd nmap-ssl rsync
stunnel uhttpd uhttpd-mod-ubus wget zile"
if [ ! -e $FILE ]; then
wget $URL
fi
rm -rf build
mkdir -p build
cd build
tar xvfj $TOPDIR/$FILE
cd $DIR
for patch in $TOPDIR/patches/*.patch; do
patch -p1 < $patch
done
make image PROFILE="$PROFILE" PACKAGES="$(echo $PACKAGES)"
cp $BINDIR/*.{tar,img} $TOPDIR
cd $TOPDIR
rm -r build