Installing OptWare on DD-WRT

Most people think of their home router as simply the little black box with the flashy lights that provides the house with internet. They'd be correct, but there is whole lot more that those black little boxes can do. It is possible to run an embedded version of Linux on selected (mainly Linksys) models. This means that you can make your router perform the same tasks as a dedicated Linux server in your network, at a fraction of the energy costs. This whole project started when Linksys where required to release the source code to their firmware under the terms of the GNU GPL.

The two major versions of Linux firmware available for routers today are OpenWRT and DD-WRT. OpenWRT is the most powerful of the two, but is mainly command line based. This makes it more suited to embedded systems. DD-WRT has the best Web Interface of the two, and it more suited to replacing stock firmware on home routers. People want a nice WebUI when something goes wrong, not looking at /var/log/messages on a terminal. :)

OptWare is a lightweight package system that originated on the NSLU2 Unslung system, but has since become the de facto standard package manager for embedded Linux systems. DD-WRT does not support these packages by default, but can be easily configured to support them. The OptWare package library contains lots of applications that people may already have heard of such as MySQL, Transmission, Asterisk, OpenSSH, Apache, nginx, PHP and Vlc.

If you plan on installing OptWare packages on your router, you will require space to store them. Most routers have lots of RAM space but little NVRAM. The difference being, that the latter does not lose its contents when the power is lost. Clearly, having to reinstall your applications to RAM on every powerup is not going to work in the long term. This means that applications must be installed to a partition that will not be wiped if the power is lost. This can be in the form of USB storage if your router has a USB port, or a JFFS partition if you have left over space in your NVRAM when your firmware is loaded.

Before you install, you must set up your /jffs dir. This can be done by either binding a USB disk to /jffs or using the Web Interface to configure a JFFS filesystem from unused NVRAM.

To install, either telnet or ssh to your router (you may need to enable telnetd or sshd in the web interface first) and type the following command to download the install script:

wget http://dereenigne.org/wp-content/uploads/optware-install-ddwrt.sh -O - | tr -d '\r' > /tmp/optware-install.sh

Then execute the script:

sh /tmp/optware-install.sh

Once your script has completed, you should be ready to go. To see what applications you can install, type:

ipkg-opt update
ipkg-opt list | more

To install, type:

ipkg-opt install PACKAGENAME

I'll do a more posts at a later date with guides how to configure some of the more tricky packages such as setting up a BitTorrent client and enabling SFTP access to the filesystem.

4 thoughts on “Installing OptWare on DD-WRT

  1. root@DD-WRT root $ sh /tmp/optware-install.sh
    sh: '/opt/lib/libc.so.0' is not an ELF executable for MIPS
    Checking system config ...
    Using 176.114.192.1 as default gateway.
    Using the following nameserver(s):
    nameserver 192.168.1.1
    Warning: /opt partition not empty!
    Installing package uclibc-opt_0.9.28-13_mipsel.ipk ...
    Some newer versions of DD-WRT does not show download progress bar,
    so just be patient - or check STATUS -> BANDWIDTH tab for download
    activity in your routers Web-GUI, and then still wait a minute or two.
    Connecting to ipkg.nslu2-linux.org (140.211.169.161:80)
    uclibc-opt_0.9.28-13 100% |*******************************| 832k 0:00:00 ETA
    Updating /opt/etc/ld.so.cache
    /tmp/postinst: line 6: /opt/sbin/ldconfig: Permission denied
    Installing package ipkg-opt_0.99.163-10_mipsel.ipk ...
    Some newer versions of DD-WRT does not show download progress bar,
    so just be patient - or check STATUS -> BANDWIDTH tab for download
    activity in your routers Web-GUI, and then still wait a minute or two.
    Connecting to ipkg.nslu2-linux.org (140.211.169.161:80)
    ipkg-opt_0.99.163-10 100% |*******************************| 75850 0:00:00 ETA
    /tmp/optware-install.sh: line 94: /opt/sbin/ldconfig: Permission denied
    /tmp/optware-install.sh: line 95: /opt/bin/ipkg: Permission denied
    /tmp/optware-install.sh: line 96: /opt/bin/ipkg: Permission denied
    /tmp/optware-install.sh: line 97: /opt/bin/ipkg: Permission denied

    Вот такая вот незадача....

Leave a Reply