Installing Debian on the Linksys NSLU2
Requirements and Preparation
In order to install Debian on a Linksys NSLU2, you need the following:
- A Linksys NSLU2, obviously.
- An external USB disk (or a big USB stick).
- A network connection.
- Another machine on which you have an SSH client. Every Linux distribution includes an OpenSSH client and there is PuTTY for Windows.
There is one complication: the Ethernet drivers require a proprietary microcode that cannot be included in the official images from Debian. There are basically two ways around this:
- Use an USB Ethernet adapter which has an open source driver. Note that if you choose this option, you will have to change the network cable a number of times. When you flash debian-installer, you have to use the internal Ethernet device whereas debian-installer itself needs the USB gadget.
- Use an unofficial image which consists of the official Debian image plus the proprietary IXP4xx microcode.
Regardless of which image you intend to use, you should configure your network settings (IP address, DNS, hostname) using the web interface before flashing the debian-installer image in case you do not want to use DHCP. Debian's installer will use those settings to bring up the network.
Please note that if you use a static IP configuration, you have to specify all information, including netmask, gateway (if you have one) and DNS. If you specify an incomplete IP configuration, Debian installer will request an IP address through DHCP instead.
Starting the Installer
First, you need to download a debian-installer firmware image which you can then flash to your NSLU2. As mentioned above, the Intel IXP4xx chip used in the Linksys NSLU2 needs some proprietary microcode for the Ethernet driver. As such, it cannot be distributed by the Debian project since we believe in free software and the advantages it offers to our users. While you can download an NSLU2 image directly from Debian this is probably not what you are looking for. It will only work if you use a USB Ethernet adapter. If you wish to use the Ethernet port of your NSLU2, you have to use the unofficial image which consists of copy of the Debian images plus the proprietary Ethernet microcode.
You can choose between one of the following methods to write the installer image di-nslu2.bin to flash:
Using the web interface from the original NSLU2 firmware. Go to the administration section, choose Upgrade, browse your disk for the debian-installer image you have just downloaded. Then press the Start Upgrade button, confirm, wait for a few minutes and confirm again.
- Using upslug2 from
any Linux or Unix machine to upgrade the machine via the network (the
software is packaged for Debian).
- Disconnect any disks and/or devices from the USB ports.
- Power off the NSLU2
- Press and hold the reset button (accessible through the small hole on the back just above the power input).
- Press and release the power button to power on the NSLU2.
- Wait for 10 seconds watching the ready/status LED. After 10 seconds it will change from amber to red (old older NSLU2) or dark orange (on newer machines). Immediately release the reset button.
- The NSLU2 ready/status LED will flash alternately dark orange and green (there is a 1 second delay before the first green). The NSLU2 is now in upgrade mode.
See the NSLU2-Linux pages if you have problems with this.
Once your NSLU2 is in upgrade mode, you can flash the new image:
$ sudo upslug2 -i di-nslu2.bin Password: NSLU2 00:13:10:d6:1e:a7 Product ID: 1 [...] Upgrading LKGD61EA7 00:13:10:d6:1e:a7 . original flash contents * packet timed out ! being erased - erased u being upgraded U upgraded v being verified V verified Display: <status> <address completed>+<bytes transmitted but not completed> Status: * timeout occurred + sequence error detected 2a013f+000000 ...UUUUUUUUUUUUUUUUUUu--------------------[...]
By default, upslug2 will look for the NSLU2 on the network connected to the eth0 interface of your machine. If you have multiple network interfaces and the NSLU2 is not connected to eth0, you have to specify the network interface with the -d option (for example, -d eth1).
Note that the tool also shows the MAC address of your NSLU2, which may come in handy to configure your DHCP server.
After the whole image has been written and verified, the system will automatically reboot:
[...] 7fffff+000000 ...VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV[...] Rebooting... done
Make sure you connect and turn on your USB disk again, otherwise debian-installer won't be able to find it.
- Using a tool for Windows to upgrade via the network.
After you have flashed the debian-installer image, your NSLU2 will boot and start the Debian installer. Since the NSLU2 does not have any IO device, SSH will be used for the installation. The installer will bring up the network, start the OpenSSH server and allow you to connect to the device using SSH. You have to wait approximately five minutes after the debian-installer firmware has been flashed before you can connect, but please be patient as it can sometimes take slightly longer, say 10-15 minutes. When the installer is ready, the status LED will become green and the NSLU2 will beep three times to indicate that you can now login via SSH.
Since the NSLU2 does not have an LCD, the installer cannot tell you which IP address to connect to or which password to use. With regards to the IP address, the following strategy is used:
- If you have configured your network settings through the Linksys web interface to use a static IP address, these values will be used (including the hostname and domain).
- If you configured the NSLU2 to use DHCP, the Debian installer will use DHCP. You can use the MAC address of your NSLU2 to tell your DHCP server to give out a specific IP address to your machine.
- If you configured a static IP address but some values (e.g. DNS) are missing, the installer will try to request an IP address via DHCP.
- If DHCP is used but no address can be found via DHCP, the default IP address which Linksys uses will be used: 192.168.1.77
If you're not able to connect to your NSLU2 after flashing the Debian installer, please use upslug2 to restore the original firmware from Linksys and check the network settings.
Please make sure that the NSLU2 is on a local network to which only you have access since the password from the NSLU2 firmware is not used for the installer but rather the the very generic password install. The user is installer. Connect to the installer:
The installation itself should be pretty standard and you can follow the installation guide. It knows about the NSLU2 and at the end of the installation it will flash a kernel and ramdisk that will automatically boot into Debian.
Since the NSLU2 doesn't have much memory, the installer won't automatically load all installer modules that are available and will give you a list of additional modules to load. With previous versions of the installer, you had to specify some modules from the list for the installation to work. However, this is no longer necessary with the new installer for Debian 5.0 (lenny). The required modules are loaded automatically and not shown in the list. You can therefore continue without loading any additional installer modules.
The installation will take roughly 4 hours (or slightly more if you have a slow Internet connection). At the end of the installation, the installer will write the new kernel to flash. Afterwards you will get a confirmation that the installation is complete. Confirm, wait for the installer to finish and once your SSH session terminates, wait a few minutes before you can connect to your newly installed system vis SSH. You will be able to log in via SSH as root or your newly created user.
When you first login to your new system, it is recommended that you install the ntpdate (or ntp) package to make sure the clock is always up-to-date.
You should now have a complete Debian system running on your NSLU2. You can use apt-get and other tools to install additional software. The NSLU2 is an ARM based device and the ARM architecture (called armel in Debian) is fully supported by Debian. Unlike the original firmware, the Debian port runs in little-endian mode. In case you faced any problems with the installer that couldn't be resolved, it's also possible to install Debian on your NSLU2 by manually unpacking a tar ball which I've prepared.
There are a number of resources where you can find more information about running Debian on your NSLU2. The README file from the nslu2-utils package (/usr/share/doc/nslu2-utils/README.Debian on your newly installed system) includes some important information you should definitely read. Also, there are some tips for running Linux on a flash device (in case you didn't install Debian on a hard drive but a USB flash stick) and for reducing memory usage.
If you run into any problems installing or running Debian on your Linksys NSLU2, please read the troubleshooting page.