Which minimal but extendable Linux distribution to choose
Let's check a few figures for mainstream distributions (i386 binaries):
- Debian lenny:
cdebootstrap -f minimal lenny lenny-minimal
produces 77MB. Add ~30MB for the package lists. About 9MB is documentation (/usr/share/doc
,/usr/share/man
), and about 25MB is locale data; you can remove these (but upgrades will bring the files back). This includes a minimal Perl setup (add 29MB for the standard library). There's no editor (add 2MB for nvi or nano), and no ssh daemon (add 17MB for OpenSSH, 11MB for lsh). Basic FTP daemons start under 1MB. - NetBSD 5.1 starts at about 84MB (about 33MB in a tar.gz) for a kernel plus the base system, which includes a comprehensive network suite (ftpd, sshd, postfix, ...), an X server, but no perl or X client. There's no documentation, but about 10MB of locales.
- OpenBSD 4.8 starts at about 160MB (about 60MB in a tar.gz) for a kernel plus the base system (including perl with the full standard library, but no X server). There are smaller OpenBSD distributions such as Flashdist, though none looks up-to-date.
Going by the BSD figures, compression lets you fit about 120MB of programs in about 50MB of raw storage. At a 250% gain, you're definitely going to want compression. Under Linux, you have a few choices of read-write compressed filesystems, in particular Jffs2. I don't know what the possibilities are under *BSD. If you have a lot of RAM, you don't need to depend on kernel support for a compressed filesystem, you can have a tar.gz or 7z archive that you uncompress into RAM at boot time.
There is a wide range of small Linux distributions, from single floppies to live CDs. You'd want something in the middle. Damn Small Linux and Puppy Linux are two popular choices; both run from RAM, and you'll need to remaster Puppy to take away stuff you don't need (the main distribution is too big for you).
Damn Small Linux is the only off-the-shelf 50MB distribution that I know of.
It is vaguely debian-ish so one can use apt
and friends if needed.
After quite some research I settled in the end for SliTaz. I can really recommend it, as I haven't found any distribution which is so flexible. There is a minimum system (well under 20 MB--choose from the Live CD flavors), basically giving you just a shell and ssh access. However, there is a huge package repository so you can extend to graphical interface or server daemons etc.