Tuesday, October 14, 2008

Building tomatoND with MLPPP for the Asus WL-520gu

Here is an attempt to recount from memory how I built tomatoND with MLPPP for the Asus WL-520gu. It may work for the Buffalo WHR-G125 as well. I may have missed a thing or two....I'll update as/if I find mistakes.

# download and untar WRT54GL source
wget ftp://ftp.linksys.com/opensourcecode/wrt54gl/4.30.11/WRT54GL_v4.30.11_11_US.tgz
tar xzf source/WRT54GL_v4.30.11_11_US.tgz

# download and unpackage the tomato source yielding tomato.tar and tomatoND.tar
wget http://fixppp.org/downloads/TomatoSource_1_19.tar.bz2
tar xjf TomatoSource_1_19.tar.bz2

# download and unrar the tomato MLPPP patch
wget http://fixppp.org/downloads/tomato-mlppp-1.19-mp2_src.rar
unrar e tomato-mlppp-1.19-mp2_src.rar

# rename WRT source folder to tomato
mv WRT54GL-US_v4.30.11_11/ tomato

# Create a symlink in /opt/brcm to tomato/tools/brcm/.
ln -s $PWD/tomato/tools/bcrm /opt/bcrm

# add the cross compiler folders to your path
PATH=$PATH:/opt/brcm/hndtools-mipsel-uclibc/bin:/opt/brcm/hndtools-mipsel-linux/bin
export PATH

# remove files specified in tomato build README file
cd tomato/release/src/
rm -rf et et.4702 wl rts tools .model
cd router/
rm -rf busybox cron dnsmasq httpd iproute2 iptables ipupdate lib libnet libpcap mipsel-uclibc misc nas netconf ntpclient nvram others rc ses shared traceroute udhcpd upnp utils www
cd ../../..

# untar tomato source over the WRT source
tar xf tomato.tar

# untar tomatoND source over the tomato modified WRT source
tar xf tomatoND.tar

# remove .c files that have been pre-built
cd tomato/release/src/shared
rm bcmsrom.c bcmutils.c hnddma.c linux_osl.c sbutils.c sflash.c
cd ../..

# apply the MLPPP patch
patch -p1 < ../tomato-mlppp-1.19-mp2.patch

# enable MLPPP in the kernel
# set CONFIG_PPP_MULTILINK=y in both files
cd release/src/
vim linux/linux/.config
vim linux/linux/.config.old

# on my ubuntu system, make didn't like the curly bracket loops
# as a quick fix I just duplicated the sections for each loop
# (see the loops for {*.asp,*.svg} and {*.js,*.jsx}
vim router/www/Makefile

# build the source
make

# at some point the build will fail - the tomato_profile.h file
# gets an extra "-e " prepended to the file, just remove it
vim ./router/shared/tomato_profile.h

# make again
make

# your image is now in the image folder

No comments: