Initrdrewrite

From FedoraProject

(Difference between revisions)
Jump to: navigation, search
(existing bonghits.)
 
(13 intermediate revisions by 6 users not shown)
Line 1: Line 1:
initrd rewrite.
 
 
 
The current incarnation of mkinitrd sucks for a variety of reasons.
 
The current incarnation of mkinitrd sucks for a variety of reasons.
This page documents some of the plans to replace it with something better.
+
This page documents some of the plans to replace it with something better. This is not yet a feature, it's currently just a playground to try some things out
  
Initial ideas:
+
{{admon/important|Current project page: http://dracut.wiki.kernel.org}}
  
* One initrd to rule them all
+
== Planning ==
Instead of one for the livecd, one for the installer, one for the distro
+
  
* Death to nash.
+
=== Initial ideas ===
The bits of nash that don't currently exist in other tools need factoring out and putting into util-linux or similar packages.
+
* '''One initrd to rule them all''' - Instead of one for the livecd, one for the installer, one for the distro
 +
* '''Death to nash''' - The bits of nash that don't currently exist in other tools need factoring out and putting into util-linux or similar packages.
 +
* '''Same bits''' - Use the same bits the rest of the distro uses instead of custom functionality.  No custom udev, just use the regular one etc.
 +
* '''Diagnostics''' - Include a shell for diagnostic/debugging purposes.
 +
* '''Probe at runtime instead of buildtime''' - Include all drivers, not just the drivers necessary for the hardware being run.  (For storage, the common ones will be built-in to the kernel anyway)
 +
* '''The initrd will be usable on other distros.''' - The idea being that it can be included in the upstream kernel, and changed when kernel interfaces change etc to prevent breaking distros.
  
* Use the same bits the rest of the distro uses instead of custom functionality.
+
=== Major Cases ===
No custom udev, just use the regular one etc.
+
  
* Include a shell for diagnostic/debugging purposes.
+
The first cut of this will just support the simple case of root on a hard disk. Eventually we want to support the numerous esoteric cases the existing initrd supports. Namely root on..
 +
* Disk based devices
 +
** -on-lvm
 +
** -on-dm-crypt
 +
** -on-dmraid
 +
** -on-mdraid
 +
** -on-multi-path
 +
* Network based devices (specified by DHCP root-path or manually)
 +
** -on-iSCSI
 +
** -on-nfs
 +
** -on-nbd
 +
* Special cases to revisit later:
 +
** livecd (/ on dm-snapshot over ext3 on squashfs on iso9660)
 +
** installer
 +
** kdump
  
* Probe at runtime instead of buildtime
+
=== Other tasks performed by the initrd other than mounting rootfs ===
Include all drivers, not just the drivers necessary for the hardware being run.
+
(For storage, the common ones will be built-in to the kernel anyway)
+
 
+
* The initrd will be usable on other distros.
+
The idea being that it can be included in the upstream kernel, and changed when kernel interfaces change etc to prevent breaking distros.
+
 
+
 
+
 
+
The first cut of this will just support the simple case of root on a hard disk.  Eventually we want to support the numerous esoteric cases the existing initrd supports. Namely root..
+
* -on-lvm
+
* -on-dmraid
+
* -on-mdraid
+
* -on-iSCSI
+
* -on-mpath
+
* -on-nfs
+
* -on-nbd
+
* -on-dm-crypt
+
 
+
special cases to revisit later:
+
* livecd (/ on dm-snapshot over ext3 on squashfs on iso9660)
+
* installer
+
* kdump
+
 
+
Other tasks performed by the initrd other than mounting /
+
 
* restore from hibernate
 
* restore from hibernate
 
* start 'pretty' plymouth
 
* start 'pretty' plymouth
Line 47: Line 38:
 
* Loading initial SELinux policy.
 
* Loading initial SELinux policy.
  
Utilities to include in the initrd
+
=== Utilities to include in the initrd ===
 
* libc
 
* libc
 
* udev
 
* udev
 
* switchroot
 
* switchroot
 
* bash (no nash!)
 
* bash (no nash!)
 +
** If you can manage without bashisms (sometimes it's hard), consider dash or posh as much smaller POSIX shells.
  
 +
=== Other stuff ===
 +
* The code in the kernel for creating minimal initramfs's (scripts/gen_initramfs_list.sh & usr/*) is kind of useless. It's probably for the best if this just goes away and gets replaced by something useful.
  
Other stuff.
+
=== Future Enhancement Requests ===
* The code in the kernel for creating minimal initramfs's (scripts/gen_initramfs_list.sh & usr/*) is kind of useless. It's probably for the best if this just goes away and gets replaced by something useful.
+
 
 +
Note that our main concern, especially right now, is proving viability of some of the ideas and then showing it with the things that we already support.  If things work out, then it should be doable to start putting in support for new things that we don't already have support for.  Nothing in this list is guaranteed but if people have ideas about new things, put them here and they'll at least be considered.
 +
 
 +
* run ssh server to enter crypto password or perform debugging ([http://www.mail-archive.com/debian-kernel@lists.debian.org/msg33437.html supported by debian])
 +
* Make it possible to easily extend the initramfs, e.g. by packages that provide additional features to the initramfs, e.g. an ssh server (partly? supported by initramfs-tools in debian. e.g. with /etc/initramfs-tools/hooks)
 +
* Hook in overlay filesystem like aufs/unionfs (necessary for Debian/Ubuntu LTSP and LiveCD etc.)
 +
* switchroot without re-running daemons like udev again (not sure if this is possible)
 +
 
 +
== Bits ==
 +
 
 +
Project Page: https://dracut.wiki.kernel.org
 +
 
 +
There is also an initramfs@vger.kernel.org mailing list for discussion

Latest revision as of 20:55, 16 March 2011

The current incarnation of mkinitrd sucks for a variety of reasons. This page documents some of the plans to replace it with something better. This is not yet a feature, it's currently just a playground to try some things out

Important.png
Current project page: http://dracut.wiki.kernel.org

Contents

[edit] Planning

[edit] Initial ideas

  • One initrd to rule them all - Instead of one for the livecd, one for the installer, one for the distro
  • Death to nash - The bits of nash that don't currently exist in other tools need factoring out and putting into util-linux or similar packages.
  • Same bits - Use the same bits the rest of the distro uses instead of custom functionality. No custom udev, just use the regular one etc.
  • Diagnostics - Include a shell for diagnostic/debugging purposes.
  • Probe at runtime instead of buildtime - Include all drivers, not just the drivers necessary for the hardware being run. (For storage, the common ones will be built-in to the kernel anyway)
  • The initrd will be usable on other distros. - The idea being that it can be included in the upstream kernel, and changed when kernel interfaces change etc to prevent breaking distros.

[edit] Major Cases

The first cut of this will just support the simple case of root on a hard disk. Eventually we want to support the numerous esoteric cases the existing initrd supports. Namely root on..

  • Disk based devices
    • -on-lvm
    • -on-dm-crypt
    • -on-dmraid
    • -on-mdraid
    • -on-multi-path
  • Network based devices (specified by DHCP root-path or manually)
    • -on-iSCSI
    • -on-nfs
    • -on-nbd
  • Special cases to revisit later:
    • livecd (/ on dm-snapshot over ext3 on squashfs on iso9660)
    • installer
    • kdump

[edit] Other tasks performed by the initrd other than mounting rootfs

  • restore from hibernate
  • start 'pretty' plymouth
  • kdump
  • Loading initial SELinux policy.

[edit] Utilities to include in the initrd

  • libc
  • udev
  • switchroot
  • bash (no nash!)
    • If you can manage without bashisms (sometimes it's hard), consider dash or posh as much smaller POSIX shells.

[edit] Other stuff

  • The code in the kernel for creating minimal initramfs's (scripts/gen_initramfs_list.sh & usr/*) is kind of useless. It's probably for the best if this just goes away and gets replaced by something useful.

[edit] Future Enhancement Requests

Note that our main concern, especially right now, is proving viability of some of the ideas and then showing it with the things that we already support. If things work out, then it should be doable to start putting in support for new things that we don't already have support for. Nothing in this list is guaranteed but if people have ideas about new things, put them here and they'll at least be considered.

  • run ssh server to enter crypto password or perform debugging (supported by debian)
  • Make it possible to easily extend the initramfs, e.g. by packages that provide additional features to the initramfs, e.g. an ssh server (partly? supported by initramfs-tools in debian. e.g. with /etc/initramfs-tools/hooks)
  • Hook in overlay filesystem like aufs/unionfs (necessary for Debian/Ubuntu LTSP and LiveCD etc.)
  • switchroot without re-running daemons like udev again (not sure if this is possible)

[edit] Bits

Project Page: https://dracut.wiki.kernel.org

There is also an initramfs@vger.kernel.org mailing list for discussion