Martin Michlmayr
A NSLU2 from the front

Installing Debian on the Linksys NSLU2

Requirements and Preparation

In order to install Debian on a Linksys NSLU2, you need the following:

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:

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 and DNS. If you don't specify all information, debian-installer will not be able to bring up the network and there's currently no way to tell the user that an error has occurred. An incomplete network configuration has so far been the most common reasons for problems with these images, so please make sure you have filled in all values.

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 is a 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:

  1. 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.

    Upgrading the firmware via the web interface

    Upgrading the firmware via the web interface

    Upgrading the firmware via the web interface

  2. Using upslug2 from any Linux or Unix machine to upgrade the machine via the network (the software is packaged for Debian).

    First, you have to put your NSLU2 in upgrade mode:

    1. Disconnect any disks and/or devices from the USB ports.
    2. Power off the NSLU2
    3. Press and hold the reset button (accessible through the small hole on the back just above the power input).
    4. Press and release the power button to power on the NSLU2.
    5. 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.
    6. 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.

  3. 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 you can then 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, it 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:

  1. If you have configured your network settings through the Linksys web interface to use a static IP address other than the default address 192.168.1.77, these values will be used (including the hostname). Note that the installer will not start if your network configuration configuration was incomplete (this includes gateway and DNS). In this case, flash the original firmware again and enter the missing values.
  2. Otherwise, DHCP will be used. You can use the MAC address of your NSLU2 to tell your DHCP server to give out a specific IP address to your machine.
  3. If no address can be found via DHCP, the default value which Linksys uses will be used: 192.168.1.77

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:

ssh installer@192.168.1.77

The Installation

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 initramfs 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. You therefore need to manually select which modules to load:

Module selection

In order for the installation to succeed, you need to select the following modules:

If you have a USB stick with only 1 GB the current version of the installer will by default create a swap partition that is too small and your system will run out of memory during the installation and fail (the symptom of this is that your SSH connection will be closed). On such systems, you therefore have to manually partition your hard drive instead of using the guided partition option. Make sure that you have at least a swap partition with at least 256 MB.

Please also note that LVM and RAID are not really supported on this device, although there is an external page with some information about such a setup.

The installation will take roughly 2.5 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 as root or your newly created user via SSH.

Flashing the kernel

Rebooting after d-i finishes

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; otherwise attempts to install new packages might fail due to GPG verification errors (for the first time, you'll probably have to setup the clock manually using the date command).

Success

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 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 NSLU2-Linux wiki has lots of information about Debian and 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.

Troubleshooting

There are some common problems found during or after the installation:

If you find this site helpful, you're welcome to make a donation.