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

MLPPP Tomato on the Asus WL-520gu

I picked up the Asus WL-520gu for $20 (after MIR). My hope was to run Tomato/MLPPP as is described at here: dslreports-tomato-mlppp and at fixppp.org. However, that's only for the Linksys WRT54GL and similar devices. With help from Guspaz and dsl_ricer I was able to get it all to build, connect and run with MLPPP (though I haven't verified that it's actually working properly).

Since the dd-wrt and tomato firmware for the WL-520gu also work on the Buffalo WHR-G125, this MLPPP version *should* work on the Buffalo as well, though I don't own one and haven't tried.

DISCLAIMER: this is an account of how I got MLPPP/Tomato working on my Asus WL-520gu. I am not recommending anyone try this, and if you do, I will not be held responsible if you brick your router.

Basically, what we're going to do is flash with dd-wrt, then with basic tomato (ND version), get the router up and running, then flash with the MLPPP version. I'll describe how to build the firmware in another post. I am assuming you have a DSL modem configured to allow the router to perform pppoe negotiation.

1. Follow the steps to flash the router with dd-wrt outlined here: dd-wrt on WL-520gu. Reboot and configure to make sure it works and connects to your ISP.

2. Using a similar procedure as was done in step 1., using the asus recovery tool, flash the router with TomatoND firmware version v1.19. NOTE: you must use the ND version of Tomato. The current version is v1.21, but I used v1.19 because that is what the stable version of MLPPP is based upon. It can be found on the Tomato download page (specifically, here)

3. reboot the router and configure it appropriately to your settings. The WAN side probably won't connect via pppoe via your modem. I followed the advice in this thread to get it to connect:
I found that vlan1ports nvram variable on Tomato was set to "0 5u" I changed this as follows (from telnet login to the router):
nvram set vlan1ports="0 5"
nvram commit
reboot


4. Repeat step 2 using the MLPPP version of the tomatoND firmware that I built.

Now, step 2 may be unnecessary if you want to directly flash with the MLPPP version....I didn't try that though, so I don't know if there'd be any issue.

I use a 2write 2700HG-B modem/router. Had to configure it to bridge mode....this post was super useful (though VPI for Bell is 0, not 8).

Useful links:
http://fixppp.org/
http://www.redflagdeals.com/forums/showthread.php?t=594003

http://www.dslreports.com/forum/r20484600-TomatoMLPPP-released-evade-throttle-or-bond-two-DSL-lineshttp://www.linksysinfo.org/forums/showthread.php?t=57746
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=26194
http://www.dslreports.com/faq/15835
http://www.broadbandreports.com/forum/r21066151-2wire-2700HGB-bridge-mode-simple-tutorial

Saturday, January 19, 2008

video editing in linux

I had some old camcorder videos that I wanted to digitize/transfer to DVD and distribute to family. I borrowed an ATI USB 2.0 TV wonder gadget from a friend and unfortunately was stuck with windoze to capture the streams. After capturing all the videos, I switched back to linux to start chopping up the files as appropriate. This is where it got tough.

I captured to MPEG-2 and simply wanted to split videos at specific times. With AVI files it's easy, just use avisplit which I believe is part of the transcode package. MPEG2 isn't quite as simple. I was hoping to simply load a video into a program, scroll to the split point, mark it and tell the program to split at the nearest I-frame, without re-encoding the file.

So, I soon found Cinelerra, Kino, Avidemux and Kdenlive. A quick search showed that Cinelerra and Kino are both complex, so I started with Kdenlive which was said to be super simple - and it seemed overly complicated as well to me. And it quickly became apparent that it'd want to re-encode my files. So I switched to avidemux - it was great for scrolling through files and finding the split points. However, it wanted to re-encode my files as well :(

More googling pointed me to mpgtx - a command line MPEG toolbox. Perfect. I used avidemux to locate all the split points in all the files, put them into a script file that would call mpgsplit as appropriate. I thought I had this in the bag until I started playing back the files and noticed the split points were just wrong in some files. Ugh. No idea why.

Ok, more searching leads me to GOPchop, which installs but crashes - says my MPEG-2 files have incorrect headers and I-frames. Next is GOPdit. Ok, very simple, but effective. Had to make sure the pereferences were setup. This tool is good, but could use some more effective keyboard shortcuts and editing tools. But for the most part it seemed to work.

Notable mentions include ProjectX which is supposed to be good for fixing up the MPEG-2 files that capture devices often hack up. Didn't manage to get it installed, but may still be of use when I get to 8mm projector files. Also, Lives is supposed to be another good program, but it's not in the repositories either.

Lastly, another good site I am going to mention for searching for linux equivalents of windoze programs: http://www.linuxalt.com/