Project

General

Profile

Bug #249 » Compiling_Openwrt_CC_Batman-adv.sh

Alvaro Antelo, 03/29/2016 12:37 AM

 
1
#!/bin/bash
2

    
3
# Install prereqs
4
sudo apt-get update
5
sudo apt-get -y upgrade
6
sudo apt-get install -y autoconf binutils bison build-essential ccache flex gawk gettext git libncurses5-dev libssl-dev ncurses-term quilt sharutils subversion texinfo unzip xsltproc zlib1g-dev
7

    
8
#export build_dir=/home/ubuntu/trunk
9
export build_dir=/home/ubuntu/openwrt
10
cd ~
11
# Download OpenWRT source (select Barrier Breaker or Trunk)
12
# git clone git://git.openwrt.org/14.07/openwrt.git # Barrier Breaker
13
git clone git://git.openwrt.org/15.05/openwrt.git # Chaos Calmer
14
#git clone git://git.openwrt.org/openwrt.git # Trunk
15

    
16
cd $build_dir
17
git pull
18

    
19
# update and install feeds
20
#./scripts/feeds update -a
21
# add batman-adv development branch
22
#echo "src-git batman https://git.open-mesh.org/openwrt-feed-batman-adv.git" >> feeds.conf.default
23
# Sven Eckelmann test routing feed 2016.1 preview
24
echo "src-git routing https://github.com/ecsv/packages.git;batadv-2016.1preview" >> feeds.conf.default
25
sed -i "/src-git routing https:\/\/github.com\/openwrt-routing\/packages.git/d" feeds.conf.default
26
./scripts/feeds update -a
27
./scripts/feeds install -a 
28

    
29
# CONFIGURE OPENWRT BUILD
30
make defconfig
31
make prereq
32
make menuconfig
33
# select 'Target System' - <*> Atheros AR7XXX/AR9XXX
34
# select 'Target Profile' - <*> TP-LINK TL-WDR3600
35
# select 'Administration' - <*> htop
36
# select 'Kernel Modules' - 'Network Support' <*> kmod-batman-adv (enable BLA/DAT/Mult/BatmanV)
37
# select 'Kernel Modules' - USB Support - <*> kmod-usb-core
38
# select 'Kernel Modules' - USB Support - <*> kmod-usb-ohci
39
# select 'Kernel Modules' - USB Support - <*> kmod-usb-uhci
40
# select 'Kernel Modules' - USB Support - <*> kmod-usb2
41
# select 'Kernel Modules' - Wireless Drivers - <*> kmod-ath9k
42
# select 'Kernel Modules' - Wireless Drivers - <*> kmod-cfg80211
43
# select 'Kernel Modules' - Wireless Drivers - <*> kmod-mac80211
44
# select 'Network' - 'Routing and Redirection' - <*> ip (minimal)
45
# select 'Network' - <*> alfred (enable vis/bat-hosts)
46
# select 'Network' - <*> batctl
47
# select 'Network' - <*> bmon
48
# Select 'Network' - <*> ethtool
49
# Select 'Network' - <*> hostapd
50
# select 'Network' - <*> iperf
51
# select 'Network' - <*> snmpd
52
# select 'Network' - <*> tcpdump
53
# Select 'Network' - <*> wpad
54
# Desselect 'Network' - < > wpad-mini
55
# select 'Utilities' - <*> iwinfo
56
# select 'Utilities' - <*> usbutils
57
# save and exit
58

    
59

    
60
# Compile
61
cd $build_dir
62
make -j${nproc} V=s
63

    
64
# CHECK SHA256 OF COMPILED IMAGE
65
cd $build_dir/bin/ar71xx
66
grep openwrt-ar71xx-generic-tl-wdr3600-v1-squashfs-sysupgrade.bin sha256sums | tee /proc/self/fd/2 | sha256sum --check -
(5-5/5)