Skip to Content.
Sympa Menu

sm-discuss - [SM-Discuss] making initrd's a little easier

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: "David Brown" <dmlb2000 AT gmail.com>
  • To: SM-Discuss <sm-discuss AT lists.ibiblio.org>
  • Subject: [SM-Discuss] making initrd's a little easier
  • Date: Sat, 27 Jan 2007 12:15:53 -0800

Okay, I've generated an mkinitrd script and added it to the linux
spell. This is a very simple script and should be considered as such.
I've made this script with the idea of being very minimal just enough
to get the right modules inserted to get the root file system mounted.
It supports lvm and raid root as well.

The script uses klibc for the user space portions and is very similar
to other mkinitrd scripts from other distrobutions. The script works
well with a kernel that's close to allmodconfig. The script also has
module dependency tracking, so you can tell it to use a particular
module and it will insert all the dependent modules as well at boot
time.

I'm not really looking for suggestions on how to make this the
'ultimate mkinitrd script' but just to say if you like it, use it.

The dependencies on the script are dependent on what kind of setup you
have. It depends on klibc by default no matter what setup you have.
If you have lvm root it needs device-mapper and lvm (which you should
have anyway when you setup your root filesystem). If you have raid
root then you should use mdadm, raidtools is older and doesn't support
static compiling as well as mdadm does. With mdadm statically
compiled it makes a very small initrd.

I've gotten several setups to work using this script. Here's a list
along with some sizes of the initrd.

LVM root: -rw-r--r-- 1 root root 1.4M Jan 27 11:46 initrd.img-2.6.20-rc6
RAID root: -rw-r--r-- 1 root root 1.6M Jan 27 11:46 initrd.img-2.6.19.2-raid
just modules: -rw-r--r-- 1 root root 507K Jan 27 11:46 initrd.img-2.6.19.2

I'm not sure what other distros do in their initrd's but I'm seeing
sizes of around 5M for their initrd's.

Try `mkinitrd --version` for a simple usage for more complex additions
to the initrd or removing stuff you'll probably have to rtfc a bit,
until I get some documentation on how to do stuff somewhere.

- David Brown




Archive powered by MHonArc 2.6.24.

Top of Page