After I read about a quite inexpensive (about 65 to 75€) embedded system on a forum two weeks ago, I needed to get one of these myself. The system has two USB host ports and an ethernet interface, 32MB SD-RAM, 8MB flash memory and a 266MHz ARM (Intel XScale) CPU (underclocked @133 MHz until mid 2006 production dates). It’s running Linux with a modified RedBoot bootloader. It’s originally intended to be a NAS server for USB hard drives but can be flashed with different Linux kernels and images. Unfortunately it’s already getting old (first released in 2004) and was reported to be discontinued so I had to decide to buy it now or never. I bought it:
If that device is completely new to you, the article on Wikipedia (en/de) may provide a good starting point for more information on what is possible. If you get interested in it, nslu2-linux.org provides a great resource to answer almost all your questions.
My goal is to get Asterisk, DHCP, DNS, OpenVPN and maybe a small webserver to run on it. However I haven’t reached that yet. (Click the link below to read more.)I initially booted the original system to verify everything is working. Since I don’t have any USB HDD and intended to attach a cheap 8GB USB flash drive I (surprisingly) couldn’t do anything with Linksys’ firmware: It detects the stick but wouldn’t use it without a real hard drive attached to USB port 1 to install onto. With just 8 minutes uptime I decided to flash it right away.
I wanted to install Gentoo but installation on an embedded system is not that straight at all. Since there are some ready-to-use distros for the slug I flashed SlugOS/BE onto it. As you may guess from the suffix, it’s a Big Endian version of that (Debian-based) distribution. The CPU could switch to Little Endian as well but since the unmodified RedBoot from the NSLU2 expects the system to be in BE mode it’s easier to set it up that way. It booted up with no problems and I could log in and start installing an outdated 2005.0 release of Gentoo using uclibc instead of glibc – unfortunately this is the latest (experimental) release of Gentoo for armeb (ARM Big Endian) using softfloat (to emulate the missing floating point unit) and uclibc (for saving memory).
I got quite far updating the base system but shortly before I could run a world update I experienced a severe blocker issue: uclibc is slowly updated and reported to be bugged in its latest revision, so Gentoo only supports the previous version. Unfortunately that version is reported to be unable to work with kernels/kernel headers >2.6.17 and caused a lot of bugs lately due to its age.
Now I had two options:
1. Forget about Gentoo and use one of the Debian based distros for the slug. However, SlugOS has been released before the critical kernel bugfix from February 2008, so it must be considered vulnerable to attacks if exposed to the Internet. Maybe I could update that system but I didn’t really want to be stuck with Debian.
2. Read into cross-compiling a complete system for embedded systems, manually applying kernel patches and transferring everything to the slug for trial-and-error testing until it finally boots and gives me a remote shell. Eventually this is the way I chose a week ago and that’s where the fun starts.
I just want to give a short introduction with this post. During the next weeks/months however, I will blog more and more articles about the issues I have with getting the system to run. So far I finally understood cross-compiling on Gentoo, got a basic system that could theoretically be chrooted into but since I compiled with a more recent version of glibc than SlugOS has been linked against, it won’t let me in yet. Today I prepared a “TinyGentoo” to (possibly) boot into, but it’s not ready yet. Next I will need to slim the boot system and try to build a kernel and transfer everything onto the slug for a first try to boot it blindly (without soldering the serial port connector onto the board).
Unfortunately I have two exams next monday so it’s unlikely I will get any further this week. I will keep this blog category updated.