Installation Options

So you want to setup a Linksys NSLU2 as an embedded linux system? GREAT! You have a variety of options:

  1. Debian/NSLU2
  2. SlugOS
  3. Unslung

You can find all of the above on the slug firmware website. As of 03/03/07, installing Debian on an external disk is currently b0rked. It would be a great option to use considering I want to get emstar up and running on my NSLU2. But that's another story... To continue with the task at hand. I've highlighted that you can have a fully functional linux distribution on an external disk, but you can also use two other "distributions:" OpenSlug and Unslung. Openslug is not for the faint of heart and is based on the work of the folks at OpenEmbedded. Openslug does not retain any of the Linksys firmware, and thus, you cannot access the "friendly" administrative website located at 192.168.1.77 (user: admin, password: admin). Of course, they also limit you to Winblows only filesystems: why would you want that anyway? Moving on again, we come to OpenSlug. Here is how I proceeded:

OpenSlug Installation

  1. Step #1: Download the firmware from here.
  2. Step #2: Download UpSlug2 and install it using the directions listed on the site.
  3. Step #3: Put the slug into upgrade mode:
  4. Step #4: Flash the slug with OpenSlug using the following command: sudo ./upslug2 -t xx:xx:xx:xx:xx:xx -i debianslug-3.10-beta.bin The series of xx letters split by a colon represent the slugs mac address. You can determine this by doing sudo ./upslug2 -l. If you do this properly, you should see the following on the command line:

    Upgrading LKG7EF947 00:0f:66:7e:f9:47
    . original flash contents * packet timed out
    ! being erased - erased
    u being upgraded U upgraded
    v being verified V verified
    Display:

    +
    Status:
    * timeout occurred + sequence error detected
    7fffff+000000 ...VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
    Rebooting... done

    The line with a lot of 'V' letters on it, will actually change throughout the process, as the codes above the line with 'Display:' indicate. While you watch the progress from the command line, your mote should have a flickering 'Ethernet' light, and the 'Ready/Status' light will be solid red, or alternate red and green. If you want a more detailed explanation of this process go here
  5. Step #5: Log into the slug. You can login to the slug through ssh. Type the following at a command prompt after the slug boots: 'ssh -l root xxx.xxx.xxx.xxx'. The IP address will be whatever your DHCP server assigned the slug on boot. If you don't know how to find this, you can trying a broadcast ping and iteratively check each found address on your network: 'ping -b 192.168.1.255' -- assuming your network is 192.168.1. If not, adjust accordingly. If you cannot find the IP address of the slug, or don't have a DHCP server running, then you're on your own. The slug's root password is 'opeNSLUg'. I recommend changing this ASAP. After you login to the slug, you can treat it like a regular linux machine. I'd advise reading up on 'turnup' and 'ipkg'.
  6. Step #6: After logging in, run 'turnup init'. Follow the on-screen instructions, and then do 'turnup preserve' and reboot.

Helpful Links

DEBIAN IS RUNNING!!!

So I found a really old tutorial on getting Debian Sid running on my slug. Currently I have it running off two USB flash drives: One 512M Memorex for / and another 512M Sandisk for swap. Unfortunately I need to find a wireless adapter for the little bugger and get a bigger flash drive. Woo hoo!!! Here is a printout of the terminal output:

root@192.168.1.106's password:
Linux SLUG 2.6.16 #1 PREEMPT Thu Jun 8 23:38:13 PDT 2006 armv5tel
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
SLUG:~#


Pretty dang cool eh??? Here are some disk stats:

SLUG:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 463M 185M 255M 42% /
tmpfs 15M 0 15M 0% /lib/init/rw
tmpfs 15M 0 15M 0% /dev/shm
/dev/root 6.4M 5.0M 1.4M 79% /initrd
SLUG:~#

Helpful notes for SELAB Users

When following the following tutorial make sure you make the largest partition /dev/sda1 and NOT /dev/sda2. That way you will be able to install a lot of extra packages through ipkg (you can always change the default installation location but who wants to do that???

Here is my configuration:
mke2fs -j /dev/sda1
mke2fs -j /dev/sda2
tune2fs -c 0 -i 0 /dev/sda1
tune2fs -c 0 -i 0 /dev/sda2
mkswap /dev/sda3

then:

cd /sbin
mv fdisk fdisk.old
echo "#!/bin/sh" > fdisk
chmod +x fdisk

then:

cd /sbin
rm fdisk
mv fdisk.old fdisk
unsling disk1

then:

cat > /unslung/rc.unslung << EOF
#!/bin/sh
/sbin/swapoff /dev/sda3
return 1
EOF
chmod +x /unslung/rc.unslung

then:

dd if=/dev/zero of=/unslung/swap.file bs=1M count=25
mkswap /unslung/swap.file
swapon /unslung/swap.file
echo "swapon /unslung/swap.file" > /unslung/rc.local

WHew...I just about tanked my slug!

I fixed it with these directions.