How to run stuff on an Actiontec DSL router
I read somewhere that 2 geeks got BitchX to run on an Actiontec router. The link to the site never worked,
so I set off on my own quest to make it work.
First, your gonna need to setup a toolchain. Dan Kegel’s crosstool produces binaries that work on the router:
http://kegel.com/crosstool/
un tar, move into contrib
next
mkdir -p /opt/crosstool
chown $USER /opt/crosstool
./demo-mips
BitchX needs ncurses and ncurses needs to be re-compiled aginst uClibc to work correctly, so:
Cross compiling ncurses 5.4 for an Actiontec GT DSL Router
Get the source:
http://www.gnu.org/software/ncurses/ncurses.html
extract
./configure
make sources
setup cross-compile environment – heres mine:
export BASE=~jloconne/mips-bin/
#export LINUX=$HOME/snapgear/linux-2.4.x/include/
export TOOLSBASE=/opt/crosstool/mipsel-unknown-linux-uclibc/gcc-3.3.3-uClibc-0.9.23/bin/mipsel-unknown-linux-uclibc
export CC=$TOOLSBASE-gcc
export STRIP=$TOOLSBASE-strip
export RANLIB=$TOOLSBASE-ranlib
export LDFLAGS=”-L/opt/crosstool/mipsel-unknown-linux-uclibc/gcc-3.3.3-uClibc-0.9.23/mipsel-unknown-linux-uclibc/lib -L/accts/jloconne/ncurses-5.4/lib”
export CFLAGS=-I/opt/crosstool/mipsel-unknown-linux-uclibc/gcc-3.3.3-uClibc-0.9.23/mipsel-unknown-linux-uclibc/include/
#export CFLAGS=”-I/accts/jloconne/actiontec-source/linux-2.4.17_mvl21/include/asm/”
export DEST=/accts/jloconne/mips-bin
./configure –host=mipsel-linux –without-ada –without-progs –without-cxx –prefix=$DEST
make
make install
Now, compile BitchX
Get source,
un-tar
Tell autoconf where to find your new ncurses lib
export LDFLAGS=/path/to/ncurses/lib
./configure
make
Now, strip the binary to save space,
/opt/crosstool/mipsel-unknown-linux-uclibc/gcc-3.3.3-uClibc-0.9.23/bin/mipsel-unknown-linux-uclibc-strip BitchX
The easiest way I’ve found to put binaries on the router is by placing it on an ftp or web server, then doing
a wget once your telnetted in.
ftp blah.blah.com
then, telnet to the router, and switch to /var/tmp
wget ftp://IPaddress/BitchX
wget ftp://IPaddress/vt102
mkdir ./terminfo/v
mv vt102 ./terminfo/v
export HOME=.
chmod 700 BitchX
./BitchX
There you have it…