replacing stuff with busybox

Martin-Éric Racine: You asked about embedding Debian with busybox.

Would anybody happen to have more details about exactly which packages Busybox can replace while still providing just enough functionality to boot a Debian-based system up to an X display manager?

This is in general an impossible question to answer since any given Debian package may or may not work with any given utility from busybox. What we do at work to shoehorn a X-capable embedded Debian-based arm system into 32 mb or so of flash, is to install our set of packages, then tweak things until busybox diverts nearly every utility it supports. Then we snapshot the files used for a shutdown, boot, and the specific use of the system we want to support, and copy just those files over to our image, which ranges from 4 to 32 mb.

For the busybox related parts of this, we use a program I wrote called busybox-links to set busybox up to divert everything cleanly and (semi-)reversably using dpkg-divert (and in some cases update-alternatives).

busybox-links also tweaks a number of init scripts to work with busybox, stuff like editing /etc/init.d/hwclockfirst.sh to run hwclock without the --noadjfile parameter, which busybox lacks, and a dozen or so other such changes. Happily busybox readlink now supports -f, so the main set of things that had to be patches doen't anymore. This set of tweaks likely won't be sufficient for your system, but you can add more in a like vein.

busybox-links is contained in our ads-additions package. As for reducing the tweaked Debian system down to just the files needed to run, we use the adsrootbuilder, which is still quite specific to our systems, but which I hope to eventually make less so. Both these packages can be downloaded from our apt repository:

deb-src http://www.applieddata.net/developers/linux/debian ads main contrib non-free

Of course, that's just one of many ways to do it. Part of the problem of embedding Debian right now is that there are as many ways to do it as there are people doing it, and no agreement on the right way, and so little progress in some areas.

In the future, I for one would like to see a broad agreement in Debian that making init scripts and the like compatable with busybox is worth doing if it doesn't make them significantly slower or uglier. Then I could send all these tweaks in as patches, which would be a better use of my time than maintaining them going forward, and would make Debian an overall more flexible and more useful system for embedding.

(PS, RE what debootstrap installs; it's based on whatever is > standard priority. If you have improvements, might I suggest talking to its maintainer, not blogging?)