Project

General

Profile

Bug #249 » Compiling_Openwrt_CC_Batman-adv.sh

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

 
#!/bin/bash

# Install prereqs
sudo apt-get update
sudo apt-get -y upgrade
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

#export build_dir=/home/ubuntu/trunk
export build_dir=/home/ubuntu/openwrt
cd ~
# Download OpenWRT source (select Barrier Breaker or Trunk)
# git clone git://git.openwrt.org/14.07/openwrt.git # Barrier Breaker
git clone git://git.openwrt.org/15.05/openwrt.git # Chaos Calmer
#git clone git://git.openwrt.org/openwrt.git # Trunk

cd $build_dir
git pull

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

# CONFIGURE OPENWRT BUILD
make defconfig
make prereq
make menuconfig
# select 'Target System' - <*> Atheros AR7XXX/AR9XXX
# select 'Target Profile' - <*> TP-LINK TL-WDR3600
# select 'Administration' - <*> htop
# select 'Kernel Modules' - 'Network Support' <*> kmod-batman-adv (enable BLA/DAT/Mult/BatmanV)
# select 'Kernel Modules' - USB Support - <*> kmod-usb-core
# select 'Kernel Modules' - USB Support - <*> kmod-usb-ohci
# select 'Kernel Modules' - USB Support - <*> kmod-usb-uhci
# select 'Kernel Modules' - USB Support - <*> kmod-usb2
# select 'Kernel Modules' - Wireless Drivers - <*> kmod-ath9k
# select 'Kernel Modules' - Wireless Drivers - <*> kmod-cfg80211
# select 'Kernel Modules' - Wireless Drivers - <*> kmod-mac80211
# select 'Network' - 'Routing and Redirection' - <*> ip (minimal)
# select 'Network' - <*> alfred (enable vis/bat-hosts)
# select 'Network' - <*> batctl
# select 'Network' - <*> bmon
# Select 'Network' - <*> ethtool
# Select 'Network' - <*> hostapd
# select 'Network' - <*> iperf
# select 'Network' - <*> snmpd
# select 'Network' - <*> tcpdump
# Select 'Network' - <*> wpad
# Desselect 'Network' - < > wpad-mini
# select 'Utilities' - <*> iwinfo
# select 'Utilities' - <*> usbutils
# save and exit


# Compile
cd $build_dir
make -j${nproc} V=s

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