-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcompileOpenWrt
More file actions
executable file
·57 lines (44 loc) · 1.26 KB
/
compileOpenWrt
File metadata and controls
executable file
·57 lines (44 loc) · 1.26 KB
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
#!/bin/bash
OPENWRT_DIR=/tmp/openwrt
SDK=OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2
SDK_TAR=${SDK}.tar.bz2
SDK_MD5=${SDK_TAR}.md5
PLATFORM_URL=http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic
exitOnFail()
{
echo -e "\n\t\t $1 \n"
exit -1
}
checkSdkDependency()
{
type -f make 2>&1 >/dev/null || exitOnFail "Install make first!"
type -f patch 2>&1 >/dev/null || exitOnFail "Install patch!"
type -f wget 2>&1 >/dev/null || exitOnFail "Install wget!"
type -f ccache 2>&1 >/dev/null || exitOnFail "Install ccache or disable CONFIG_CCACHE in .config"
}
getSDK()
{
wget ${PLATFORM_URL}/${SDK_TAR}
curl -sL ${PLATFORM_URL}/md5sums | grep ${SDK_TAR} > ${SDK_MD5}
md5sum -c ${SDK_MD5} || exitOnFail "MD5 failed!!!"
tar -xf ${SDK_TAR}
}
main()
{
checkSdkDependency
mkdir -p ${OPENWRT_DIR}
pushd ${OPENWRT_DIR}
# Obtain SDK
getSDK
pushd ${SDK}
# Obtain package Definitions
./scripts/feeds update packages
./scripts/feeds install -p packages nano
make package/nano/compile
# Make package index
make package/index
ls -lah bin/ar71xx/packages/packages/
popd
popd
}
main