Re: Booting a modular kernel through a multiple streams file

Erik Andersen
2001-12-19T10:12:03Z

On Wed Dec 19, 2001 at 09:27:29AM +0000, James A Sutherland wrote:
>
> What I was suggesting is that using an initfs (whether initrd, initramfs or
> something else) is a better approach than trying to get the bootloader
> grovelling around in the kernel innards - initramfs strengthens this
> argument, I think. Just put the modules into archives, and use initramfs to
> access them and a copy of insmod...

Here is a simple example... Take busybox, disable everything but
insmod and lash (the simplest of the busybox shells). Staticly
link vs uClibc -- the result is 61k (far less then the 440k from
glibc). Now make a root fs that contains just /bin/sh (the
busybox binary), /sbin/insmod (a symlink to /bin/sh), and then
fill up / of your root fs with all the modules you wish to load.
Add in a simple script as /linuxrc or /sbin/init with something
like:

#!/bin/sh
/sbin/insmod /foo.o

Now, gzip the result. With about 60k worth of modules, the final
initrd will compress to about 60k. Simple, easy, small, and all
in userspace,

-Erik

--
Erik B. Andersen http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--