For my 1-Wire home automation project, I'm using an old Soekris net4501 that used to be my home firewall/router, running FreeBSD. It has a 486-class CPU and 64 MB RAM, which presented some challenges for this application, as I wanted to use OWFS (which requires FUSE, and thus a Linux kernel).
I looked at a few small Linux distributions, like DSL (rejected because it doesn't appear to have a non-ISOLINUX/SYSLINUX installation method), Pebble (too old and difficult to update), Pyramid (missing Perl, package management, and sane update/upgrade method), and a few others. I had hoped to use a distribution that was already optimized for flash memory (minimal writes) and very small (I was using a 256-MB Compact Flash card).
Then I found these great instructions for installing Debian on a USB flash drive. Also on this site is deb2flash, a Python script for automating much of the installation. I ended up using a slightly-hacked version of the script (mainly small bug fixes, and replacing the 686 kernel with one for 486).
First, I installed a minimal Debian 4.0 in a VMware VM, and added the parted and debootstrap packages. I pulled the CF card from the net4501, put it in a USB CF adapter, assigned the USB device to the VM, ran deb2flash, and answered the prompts. After quite a while, I had a functional Debian installation on my 256-MB CF card, with a whopping 5.7 MB free:
igor:~# uname -a
Linux igor 2.6.22-2-486 #1 Thu Aug 30 23:45:36 UTC 2007 i486 GNU/Linux
igor:~# df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/hda1 238M 220M 5.7M 98% /
(I do have a 2-GB card ordered, but thought I'd start testing with the card I had.)
To make the installation functional on the net4501, I needed to make the following tweaks.
- Mount the CF card and chroot.
mkdir /mnt/cf
mount /dev/sdb1 /mnt/cf
chroot /mnt/cf
mount -t proc none /proc
- Rebuild initramfs with ide_generic support.
echo "ide_generic" >> /etc/initramfs-tools/modules
update-initramfs -t -u
- Edit /etc/inittab to enable serial console on ttyS0.
T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
- Edit /boot/grub/menu.lst for serial console support.
## use serial
serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1
## use terminal
terminal --dumb --timeout=15 serial
Also add console options to each kernel line.
sed -i '/^kernel/ s/$/ console=tty0 console=ttyS0,9600/' /boot/grub/menu.lst
At this point, I was able to put the CF card back in the Soekris and boot it with no problem. I'll have to wait for the larger CF card to start working with OWFS, but that, as they say, is another show.