Single-Floppy ADSL Linux Router

background

This single-floppy version of Linux came about as a result of a tech-support job that came up in march 2001. A client who had been connecting to the internet via dialup modem was wanting to increase their bandwidth - they were starting to do some web design and authoring work and they were finding that a modem just wasn't fast enough for them any more.

You can read the whole story here.


What is it?

The single-floppy ADSL disk contains a tiny (500k) ext2 filesystem in blocks 0-499, and a compressed root filesystem (2.7Mb uncompressed) in the remaining 940 blocks, starting at block 500.

When booted, it loads linux kernel 2.2.18, dhcpd, named and pppoe. Masquerading and firewalling is done via ipchains and a set of appropriate rules. If you are looking for a single-floppy system to connect your home or small-business to an ADSL service (e.g. here in Australia) then this might be useful to you.


Anatomy

This section describes how to pull apart the 1.44Mb floppy disk image to get at the two embedded filesystems.

Start by mounting (via loopback) the disk image. You will see a 500k filesystem which is stored on blocks 0-499 in the image. (If you don't have the loopback device configured, then go and do that before continuing - it's too useful to live without).

You can look at the lilo.conf file in the /etc directory to see the options passed to lilo which specify a compressed root filesystem, starting at block 500.

To look at the "real" filesystem (stored in blocks 500 - 1439), you can extract and mount it as follows:

	dd if=disk1440.img of=rootfs.gz bs=1k skip=500
	gunzip rootfs.gz
	mount -o loop rootfs /mnt/loop
Reverse this procedure to put it all back together again:
	umount rootfs
	gzip -9 rootfs
	dd if=rootfs.gz of=disk1440.img bs=1k seek=500
An important step is knowing how to make the disk "bootable" after you have changed the linux kernel. This took me a while to work out, so I'll mention it here.


Where is it?

The disk image is here.

It contains:

Warning - the disk image is supplied "as-is". It is already set up to work in the particular case that I had to support, and you would be well advised to look through all the scripts etc so that you can change it around to suit your needs.


Development Environment

I used a RedHat 5.1 system to compile the binaries that went onto the floppy. RedHat 5.1 uses glibc-2.0.7, the same version that is on the floppy. The only drama that I had to solve was installing new libraries into the /lib directory on the floppy and then updating the /etc/ld.so.cache. I discovered the "-r" option to ldconfig (chroot) did the trick.

You can mail me if you have questions/comments.