Project

General

Profile

Bug #249 » Compiling_Openwrt_CC_Batman-adv.sh

Instructions used to compile the firmware - Alvaro Antelo, 03/25/2016 12:16 AM

 
#!/bin/bash

# Ubuntu x86_64 14.04

# 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 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
./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-devel (enable BLA/DAT/Mult/BatmanV/gpsd)
# 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-devel
# select 'Network' - <*> bmon
# Select 'Network' - <*> ethtool
# select 'Network' - <*> gpsd
# 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 -
(2-2/5)