The next feature of Unslung that we'll explore is the customization feature. Much like we did in my last article, Unslung adds hooks to the standard startup scripts, but it goes much further. Unslung's scripts - called diversion scripts - add a hook to every startup script. The advantage is that you can insert code at any point in the startup sequence.
Additionally, the diversion scripts have a feature that allows you to completely skip or replace the standard Linksys functionality. For example, since I don't use SMB any more, my diversion script simply does a "return 0" which tells the hook in the Linksys script to skip the remaining portion of the Samba startup. This would also allow me to startup Samba with different options or even use my own version of Samba before returning 0. Unslung adds this capability to every Linksys startup script.
The last major feature that Unslung brings to the table is a standardized package system called ipkg, which was originally developed for hand-held Linux systems. Since then, its use has been expanded to other devices with limited resources. Using a standard package system makes it easy to add new features to the box.
For example, it takes a one-line command to add a secure shell server to our little box. The package is then downloaded from the Internet, configured and installed automatically. As of this writing, there were 19 packages available for installation, but work is underway to converge with a more established build system which will bring more than 1500 packages to the NSLU2!
Enough overview, let's try it out. As before, I'm assuming that you've enabled Telnet on your box as specified in my first article. If you haven't, there's now a slightly easier method detailed here.
If you've been following along with my earlier articles, the first thing we need to do is backup all of our previous changes. The Unslung firmware uses some of the same directories that we created in the /share/hdd/conf directory, bin, etc, and rc.d. We'll just move our directories out of the way and let the Unslung installation do its thing. When it's done, we can put our specific changes back in place.
First, Telnet in to the NSLU2 and rename the directories to avoid any conflicts:
cd /share/hdd/conf mv bin bin.old mv etc etc.old mv rc.d rc.d.old
This time we won't be building our own firmware, relying instead on a pre-built firmware, UNSLUNG-1.11-beta.zip, that's available here. Download it to your computer and unzip it into a working directory. You'll end up with three files, a README file and two different firmware files. One firmware image is for using Linux ext3 formated USB flash drives, the other is for using Windows vfat formated USB flash drives. For this article, we'll use the vfat flash image, UNSLUNG-1.11-beta-V23R25.bin, since its behavior more closely follows the standard Linksys firmware. Browse the README file for detailed information on this firmware, and for instructions on how to build it yourself if you so desire.
When you think you're ready to go, shut down your NSLU2 and unplug your hard drive. Power the NSLU2 back up and install the Unslung firmware using the standard Linksys flash upgrade utility. When the box boots back up, enable Telnet as shown in my first article using the Management/telnet.cgi URL. Telnet into the box using root for a user and uNSLUng for a password.