The switch from initrd to initramfs for newer Debian kernels

This information is of historical interest only.

Debian kernels require an initial ramdisk to work

Debian has for some time distributed and installed modular kernels by default, depending on the helper package initrd-tools to add the needed modules in a cramfs initrd-image.

2.6 has a newer format, initramfs, which is an cpio gzipped archive. The handoff to early userspace is much earlier. Initramfs allows a cleaner interface. The initrd hacks for nfs root and such are scheduled to be removed for 2.7.

Initrd-tools relies on devfs and on removed or deprecated /proc interfaces. It has no maintainer. Its CodingStyle is weird. There is no support for sata thus responsible for many sarge install failures nor scsi for kernels >= 2.6.10. Its use with recent 2.6 linux kernels is discouraged.

Several tools produce initramfs images, each with some spiffy features and annoying limitations...the comparison below use the following symbols:

Legend

(./)

Great

<!>

Not great

{X}

Bad

{i}

Probably, but needs confirmative tests

Features of the different initrd-tools replacements

Architectures

initramfs-tools

Yaird

amd64

(./) Works (MarcoAmadori, fs)

(./) Works (MarcoAmadori)

arm

(./) Works (tbm)

(./) Works (JonasSmedegaard)

armeb

(./) Works (tbm)

{i} Needs Test

alpha

(./) Works (nobse)

(./) Works (JamesAndrewartha)

hppa

(./) Works (kyle)

{i} Needs Test

i386

(./) Works (Jeff Bailey)

(./) Works (JonasSmedegaard)

ia64

(./) Works (lamont)

{i} Needs Testing

m68k

{i} Needs Test

{i} Needs Test

mips

(./) Works (tbm)

{i} Needs Test

mipsel

{i} Needs Test

{i} Needs Test

powerpc

(./) Works (DannFrazier?)

(./) Works (?SvenLuther)

s390

(./) Works (?FransPop)

{i} Might work by manually editing config (see #340344)

sh

{i} Needs Test

{i} Needs Test

sparc

(./) Works (?JeffBailey)

(./) Works (JurijSmakov)

xen

(./) Works (maximilianattems)

{i} Needs Test

Root Devices

initramfs-tools

yaird

fstab label and UUID

(./) Works1

<!> only ext2 and reiser (see #337065 for workaround)2 (ErikKonijnenburg)

md (fs directly)

(./) Works (maximilianattems)

(./) Works (JonasSmedegaard)

LVM

(./) Works (maximilianattems)

(./) Works (MarcoAmadori)

LVM-over-md

(./) Works (?DanJacobowitz)

(./) Works (MarcoAmadori)

EVMS (fs directly)

(./) Works (Sesse)

(./) Works (MarcoAmadori)

LVM-over-EVMS

(./) Works (Sesse)

(./) Works (MarcoAmadori)

md-over-EVMS

(./) Works (Sesse)

(./) Works (MarcoAmadori)

LVM-over-md-over-EVMS

(./) Works (Sesse)

(./) Works (MarcoAmadori)

Encrypted root (dm-crypt)

(./) Works with cryptsetup (DavidHärdeman)

{i} Works (?ManojSrivasta) (not for all, see #336599)

Encrypted root (luks)

(./) Works with cryptsetup (DavidHärdeman)

(./) Works (?MarcusBetter)

Encrypted root (dm-crypt/luks) over md

(./) Works with cryptsetup (DavidHärdeman)

{i} Needs test

Encrypted root (dm-crypt/luks) over LVM

(./) Works with cryptsetup (DavidHärdeman)

{i} Needs test

LVM over encrypted root (dm-crypt/luks)

(./) Works with cryptsetup (DavidHärdeman)

{i} Needs test

Encrypted root (loop-AES)

{i} Needs test and loop-aes-utils >= 2.12r-15

{X} No

NFS

(./) Works (?VagrantCascadian)

<!> Requires manual editing config file (JonasSmedegaard)

NFSv4

{X} No (see #409271)

{X} No

SCSI

(./) Works (?JeffBailey)

{i} Needs test

SATA

(./) Works (?JeffBailey)

(./) Works (MarcoAmadori)

USB-stick

(./) Works (maximilianattems)

{i} Needs Test

IEEE1394

(./) Works (mikap)

(./) Works (JonasSmedegaard)

Compaq Smart Arrays (cciss)

(./) Works (?KlausIta)

(./) Works

Compaq Smart Arrays (ida)

(./) Works (MattTaggart)

{X} No (see #335601)

dmraid

(./) Works with dmraid (TormodVolden)

{X} No (see #337724)

Fancy graphics

initramfs-tools

yaird

usplash

(./) Yes

<!> Requires manually editing config file

splashy

(./) Yes

<!> Requires manually editing config file

Other features

initramfs-tools

yaird

cramfs initrd 3

{X} No

{X} No

USB keyboard

(./) Works (?TommiVainikainen)

(./) Works (ErikKonijnenburg)

uswsusp

(./) Works (DavidHärdeman)

{i} Needs test

swsusp

(./) Works (DavidHärdeman)

{i} Needs test

swsusp2 4

(./) Works (?FlorianRagwitz)

<!> Requires manually editing config file (?FlorianRagwitz)

External hooks

(./) Yes

<!> Requires manually editing config file

Summary

initramfs-tools

yaird

(./)

40

17

<!>

0

6

{X}

2

5

{i}

4

18

Requirements of the different initrd-tools replacements

Package requirements (risk of delays on some archs)

initramfs-tools

yaird

klibc

<!> Yes

(./) No

busybox

<!> Yes

(./) No

udev

<!> Yes

(./) No

perl

(./) No

<!> Yes

HTML::Template

(./) No

<!> Yes

Parse::RecDescent

(./) No

<!> Yes

Arch: any

(./) No

<!> Yes (includes a few tiny C-based helper tools)

Runtime requirements

initramfs-tools

yaird

sysfs5

<!> Only sometimes6

<!> Yes

/boot/config.<kernelversion>

(./) No

<!> Yes

Boot-time requirements

initramfs-tools

yaird

udev7

<!> Yes

(./) No

Only some kernel versions work

Recent Linux kernels query the ramdisk tool prior to use if it is expected to succeed. Currently the following simplified queries try to handle all of the above contraints:

kernel-package query

initramfs-tools

yaird

Supported host version

any

>=2.6.8

Supported target version

>=2.6.12

>=2.6.8

<!> The above has the consequense of yaird not able to provide an official upgrade path from sarge to etch. As the default debian-installer for sarge installed 2.4.27, which as any 2.4 has no /sys (new driver modell).

Comparable hilites beyond simply working

The main goal of all initrd tools is off course to generate an initial ramdisk to help boot a kernel properly. But beyond that, the tools have fundamental differences in their approach:

Hilite

initramfs-tools

yaird

Composing initramfs

Builds generic initramfs with all relevant ide, scsi, fs modules, and probes at boot time what to load

Builds optimized initramfs containing only modules required to boot the currently running system, loading them all at boot time

Ramdisk size

Relatively large by default - option of relatively small

quite small

Dealing with MD (lvm, md, evms)

Activates all md, evms devices and all logical volumes of the root volume group.

Activates only md and/or LVM volumes needed for mounting rootfs

Dealing with errors at build time

Creates per default an generic initramfs without probing.

Refuses to build initramfs if uncertain it will work.

Dealing with errors at boot time

Drops into a shell to let you fix stuff.

By default simply stops boot process on error - manual editing config file allows for including an error recovering shell instead.

Copying root

Works out of the box. Noticed on boot by the new root bootparam.

Needs a newly regenerated initramfs.

libc used

Both klibc and (externally pulled in) glibc

glibc (can be compiled against klibc if needed)

Hilites not directly comparable

initramfs-tools

yaird


CategoryPermalink

  1. The root partition is passed as a parameter from the bootloader cmdline and can easily be set to /dev/disc/by-label/whatever or /dev/disc/by-uuid/whatever (i.e. no need to parse fstab) (1)

  2. Fstab labels and UUID on yaird works but yuckilly: Needs to be rewritten to blkid, there are good ideas in http://bootutils.sourceforge.net/ (2)

  3. any reason to include this?) (3)

  4. swsusp2 is not in mainline kernel (4)

  5. sysfs required at runtime means to depend on a mounted /sys tree. This limits to installing only from 2.6.8 and newer - specifically making upgrades directly from Linux 2.4.x to Linux 2.6.x impossible (Debian Sarge installed 2.4.x kernel by default on many arches!) (5)

  6. sysfs is required for initramfs-tools at runtime in "dep" mode, but not in "most" mode (the default mode in Debian). Images created in "most" mode might be too big for some arches or bootloaders. (6)

  7. udev required at boot-time limits to installing only Linux 2.6.12 and newer (7)