NSLU2 Bootup

I noticed that for some reason some of the bits and pieces I had installed on my NSLU2 were not being restarted at boot time: notably dnsmasq, which is a Domain Name Server and DHCP server. I started using this just for fun, but found that after an NSLU2 reboot I wasn’t able to reconnect to the NSLU2. It turned out that for some reason the imac was being given a bizarre IP address, which wasn’t even on the same subnet as the NSLU2. In fact, IIRC, it wasn’t even a legal private domain IP address! Now, I have several things installed on the NSLU2: cron, inetd, portmap, appweb and dnsmasq. I had also installed mt-daapd at some stage. It turned out that mt-daapd was failing to load, and this was causing the script to bail out, without running the remainder of the items. I think. Moral of the story: ensure that you are only loading stuff you need, and that everything is running smoothly.

NSLU2 on MacOS X

The instructions for installing an NSLU2 are designed for using a Windows box - but it’s easy enough to set it up using any OS. Just use the web server built in, and use an address of 192.168.1.77 and username/password of admin/admin. Following the NSLU2-Linux instructions on unslinging is easy too, except I didn’t know what to do after unslinging and rebooting - ie I cannot telnet back into the box! What you need to do is change the password after connecting the disk but before rebooting: # passwd [enter new password twice] # cp /etc/passwd /share/hdd/conf/passwd # ln -sf /share/hdd/conf/passwd /etc/passwd Then you need to reboot (or maybe you don’t, I did just to test the password stuck!), re-enable telnet login, and you can begin to install packages.

Cross Compilation NSLU2/MacOSX

So, I’ve built the toolchain - it’s about 69Mb raw, which zips to about 26Mb. Tarring and BZip2ing it reduces it to 18Mb. What I want to know is: is it only the stuff in bin/ that is used when cross-compiling? If so, this compresses to around 3.6Mb, which is small enough to post for others to use… Also, it’s possible to just copy the armv5b-softfloat-linux-* files (I used ln, so they are still in the original spot, but take up no extra room) to a place in your path. From what I’ve just read, the only thing really used is the compiler, but surely the linker is too. I have built a hello.c program, but cannot test it until I get my NSLU2.

NSLU2 MacOSX Toolchain

I’ve just paid for (and expect to receive in the next couple of days) a large (160Gb) USB Hard Drive, and in the next week or so I’ll also buy a Linksys NSLU2 NAS device, to share the HDD with all devices in my network. One of the reasons I decided on this route is the extreme hackability of the NSLU2 - it comes with a cut-down version of Linux with only SMB sharing turned on, but by flashing a new ROM it’s possible to set it up as a complete server. I aim to use it for mainly sharing files, but just for fun I’ll try and build python for it. I had a whole lot of experience building python for BeOS/PPC a few years back. It started to run into problems when building sockets and anything that used mmap(), and after about 2.2 I’m not sure I ever got it to work correctly again. Building the cross compilation toolchain to allow me to do this from MacOS X is quite complicated: you have to download about 60Mb of source code, and then build it. More details on this page. My notes on the topic follow: Make sure you reference the nslu2/bin directory in your path before the other location where the tools you installed are. Bash looks in the order they appear in the environment library list, so if expr is in two places, the first one it is found in is used, for example. The good news is, if the files have been downloaded, and the build fails, it is smart enough not to try and re-download them. Make sure you follow the instructions carefully - I did a make install instead of the cp src/expr $HOME/local/nslu2, and it failed dismally.