Debian on the slug
Sep. 9th, 2007 12:57 pm1. Created a Debian Live CD and used it to boot up one of my spare boxes.
2. Connected my USB disc to the debian box and partitioned the disc as follows:
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 120 963868+ 83 Linux
/dev/sda2 121 60801 487420132+ 5 Extended
/dev/sda5 121 132 96358+ 82 Linux swap / Solaris
/dev/sda6 133 60801 487323711 83 Linux
3. Made the file systems in the usual ways:
sudo mkfs.ext3 /dev/sda1 sudo mkfs.ext3 /dev/sda6 sudo mkswap /dev/sda5
4. Brought up the network on the debian box and set a default route.
5. Mounted up the large partition on the USB disc (/dev/sda6) and grabbed the base.tar.gz package:
wget http://people.debian.org/~tbm/nslu2/etch/base.tar.bz
6. Mounted up the root partition on the USB disc (/dev/sda1) and untarred the base package.
7. Grabbed a slug firmware image that contains the NPE proprietory network driver.
8. Monkeyed around with the image to extract the driver code:
untar debian-4.0.r0.zip slugimage.pl -u -i di-nslu2.bin devio '<< ramdisk.gz; xp $ 4' | zcat | cpio -i
The cpio step produced a whole bunch of errors, but these turned out to be harmless.
9. Copied the driver into place:
cp lib/firmware/NPE-B.01000201 /mnt/lib/firmware cd /mnt/lib/firmware ln -s NPE-B.01000201 NPE-B
10. Changed /etc/network/interfaces to force the network to use a static IP rather than probing for a dhcp address:
iface eth0 inet static address 10.0.0.4 netmask 255.0.0.0 gateway 10.0.0.128
Also set the hostname by changing /etc/hostname.
11. Downloaded the latest debian firmware, put the slug into update mode with a modified vulcan death grip, then flashed the firmware with upslug2 on my BSD machine:
sudo ./upslug2 -d ep0 -i /arc/tmp/deb/sda1-2.6.18.dfsg.1-12.bin
The -d ep0 was needed because the Berzerkeley box doesn't use eth0 as its primary interface.
12. Connected the USB drive to the slug and rebooted. Confirmed that the system was up on the network and logged in as root (default password is root).
13. Made few basic admin changes:
passwd root ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N "" -t rsa ssh-keygen -f /etc/ssh/ssh_host_dsa_key -N "" -t dsa tzconfig
Also created a couple of user accounts.
14. Installed some essential packages:
apt-get update apt-get install ntp apt-get install sudo apt-get install netatalk apt-get install avahi-daemon
15. Published netatalk settings with mDNS by putting the following in /etc/avahi/services/afpd.service:
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
</service-group>
Published ssh settings with mDNS by putting the following in /etc/avahi/sevices/ssh.service:
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_ssh._tcp</type>
<port>22</port>
</service>
</service-group>
16. Finally, an updated and rebooted:
apt-get upgrade reboot
A couple of tests showed everything working more or less expected, although there appear to be a few glitchs with netatalk — files disappearing, minor stuttering whilst playing video files — that I need to sort before I start using the slug in anger.