[plug] initrd and custom mp3 players

Matt Kemner zombie at penguincare.com.au
Sat Apr 10 13:50:12 WST 2004


On Sat, 10 Apr 2004, quoth Onno Benschop:

> I stumbled on the idea of building an initrd that does this, but I'm
> also reading conflicting reports that this is fast becoming obsolete.

You only really need an initrd if you need to pre-load a module that is
required to access your disk (because you can't load a module off a disk
you can't access yet) ie scsi or ide-raid drivers, filesystem modules etc.

For what you are describing initrd is overkill and unnecessary.

> Ideally all I want is to devote <2Mb of disk space to a linux install

If you want it cut down _that_ much, then you may as well build your own.

> that leaves my drive in read-only, runs from RAM and plays MP3's off the

All you really need is a kernel, and an "init" which is really just the
first program it runs, and which does not need to resemble sysvinit or
anything like that - can be just a shell script.

You should be able to do what you want, with a small kernel, busybox, your
mp3 player of choice, and a custom shell script (using busybox's shell) :)

It might still take up more than 2Mb, but it wouldn't be much more than
that - ~800kB for a cut down kernel, ~500-800kB for a statically linked
busybox, and then whatever the size of your (statically linked) mp3 player
is.

You could possibly cut it down even more by dynamically linking
against uclib instead, and only including those libc functions busybox and
the mp3player use, but the savings would depend on how much the two have
in common...

Put your shell script in /sbin/init and put #!/bin/sh up the top, then
make sure /bin/sh is a symlink to busybox.

Then after several versions where you add features that you didn't think
you wanted, but later found you couldn't do without, you'll end up with
your very own mp3player distro similar to the ones you've already looked
at.. ;)

 - Matt




More information about the plug mailing list