mbox series

[v5,00/12] Add support for dracut

Message ID 20251030094451.1303871-1-Quirin.Gylstorff@siemens.com
Headers show
Series Add support for dracut | expand

Message

Quirin Gylstorff Oct. 30, 2025, 9:44 a.m. UTC
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>

Debian intends to change the default initrd generator from
initramfs-tools to dracut[1],[2].

This is a first draft to support multiple initrd generator in
ISAR. I tested it with bookworm and trixie.

You can switch a normal Debian version to a dracut based initrd
by installing the package `dracut`. This similar to a normal Debian
installation.

Customizing the initrd generation should be done with a seperate recipe
which inherit `initrd-dracut`. This is intentionally done to avoid
installing packages which are only used by the initrd generation process.

[1]: https://salsa.debian.org/kernel-team/meetings/-/wikis/20250730
[2]: https://meetbot.debian.net/debian-kernel/2025/debian-kernel.2025-08-06-19.00.log.html

Changes v5:
 - cleanup formatting
 - Add additional comments
 - Add isar-work mount point to the rootfs to copy the initrd to the workdir
 - make the build compatible with ubuntu
 - use the feature to derive the  module name from the installed package

Changes v4:
 - fix extra_modules and extra_drivers
 - extend user_manual to switch normal installation to dracut

Changes v3:
 - drop initramfs patch
 - add examples
 - add user_manual section

Changes v2:
 - extract the initramfs-cmd from the cmdline
 - increase version of enable-fsck
 - add function to print an error in case a invalid package is installed

Quirin Gylstorff (12):
  Add dracut to custom kernel builds
  rootfs: Allow to overwrite the initramfs generation cmds
  rootfs: Add isar-work directory to rootfs mounts
  rootfs: Copy the newly created initrd.img to the work directory
  rootfs: Add dracut to initramfs generator
  initramfs: allow to set the generator command
  Add class to generate custom dracut initramfs
  rootfs: add flag to use dracut if it is not part of the package list
  Add example dracut initramfs
  Add dracut module helper
  Use lighttpd as a example how to add a dracut module
  user_manual: Add dracut for initramfs generation

 doc/user_manual.md                            | 73 ++++++++++++++-
 .../dracut-example-lighttpd_0.1.bb            | 44 ++++++++++
 .../dracut-example-lighttpd/files/install.sh  | 20 +++++
 .../files/lighttpd.conf                       | 52 +++++++++++
 .../files/lighttpd.service                    | 13 +++
 .../files/sysuser-lighttpd.conf               |  2 +
 .../recipes-initramfs/images/isar-dracut.bb   | 25 ++++++
 meta/classes/initramfs.bbclass                | 19 +++-
 meta/classes/initrd-dracut.bbclass            | 58 ++++++++++++
 meta/classes/rootfs.bbclass                   | 41 ++++++---
 .../dracut-module/dracut-module.inc           | 88 +++++++++++++++++++
 .../dracut-module/files/module-setup.sh.tmpl  | 42 +++++++++
 meta/recipes-kernel/linux/linux-custom.inc    |  2 +-
 13 files changed, 461 insertions(+), 18 deletions(-)
 create mode 100644 meta-isar/recipes-initramfs/dracut-example-lighttpd/dracut-example-lighttpd_0.1.bb
 create mode 100644 meta-isar/recipes-initramfs/dracut-example-lighttpd/files/install.sh
 create mode 100644 meta-isar/recipes-initramfs/dracut-example-lighttpd/files/lighttpd.conf
 create mode 100644 meta-isar/recipes-initramfs/dracut-example-lighttpd/files/lighttpd.service
 create mode 100644 meta-isar/recipes-initramfs/dracut-example-lighttpd/files/sysuser-lighttpd.conf
 create mode 100644 meta-isar/recipes-initramfs/images/isar-dracut.bb
 create mode 100644 meta/classes/initrd-dracut.bbclass
 create mode 100644 meta/recipes-initramfs/dracut-module/dracut-module.inc
 create mode 100644 meta/recipes-initramfs/dracut-module/files/module-setup.sh.tmpl