public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "'Quirin Gylstorff' via isar-users" <isar-users@googlegroups.com>
To: isar-users@googlegroups.com, jan.kiszka@siemens.com,
	felix.moessbauer@siemens.com, cedric.hombourger@siemens.com
Subject: [RFC PATCH v3 10/10] user_manual: Add dracut for initramfs generation
Date: Mon,  6 Oct 2025 20:31:12 +0200	[thread overview]
Message-ID: <20251006183214.1593195-11-Quirin.Gylstorff@siemens.com> (raw)
In-Reply-To: <20251006183214.1593195-1-Quirin.Gylstorff@siemens.com>

From: Quirin Gylstorff <quirin.gylstorff@siemens.com>

Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
 doc/user_manual.md | 51 ++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 47 insertions(+), 4 deletions(-)

diff --git a/doc/user_manual.md b/doc/user_manual.md
index 67f91973..a4707f0a 100644
--- a/doc/user_manual.md
+++ b/doc/user_manual.md
@@ -1680,10 +1680,11 @@ SRC_URI += "docker://debian;digest=sha256:f528891ab1aa484bf7233dbcc84f3c806c3e42
 ## Customize the initramfs
 
 Isar supports the customization of initramfs images by providing an
-infrastructure for quickly creating hooks and by allowing to replace the
-Debian-generated image with a separately built one.
+infrastructure for quickly creating hooks in case of `initramfs-tools`
+or modules for `dracut` by allowing to replace the Debian-generated
+image with a separately built one.
 
-### Creating initramfs hooks
+### Creating initramfs-tools hooks
 
 To create an initramfs hook that adds tools or modules to the image and may
 also run custom scripts during boot, use the include file
@@ -1720,6 +1721,33 @@ initramfs.
 
 See `initramfs-example` for an exemplary hook recipe.
 
+### Creating dracut modules
+
+To create a custom dracut module that adds tools, kernel-modules or services
+to the initrd, use the include file `recipes-initramfs/dracut-module/dracut-module.inc`.
+It is controlled by following variables:
+
+- `DRACUT_REQUIRED_BINARIES` defines the binaries required by the module.
+- `DRACUT_MODULE_DEPENDENCIES` defines dependencies to other dracut modules.
+- `DRACUT_MODULE_NO` defines the module number which prefixes the module name
+to define the execution order.The default is `50`.
+- `DRACUT_MODULE_NAME` the name of the module which is used to install the
+module in the initrd or as a dependency to other modules. It defaults to
+`${PN}` without the prefix `dracut-`.
+- `DRACUT_MODULE_PATH` contains the path to the installed module. It is set
+to `${D}/usr/lib/dracut/modules.d/${DRACUT_MODULE_NO}${DRACUT_MODULE_NAME}/`
+
+The `install()` function is added by storing the file `install.sh` in the
+files directory of the dracut module.
+
+Other files can by added to the module by coping them to the Module folder
+with:
+```bash
+install -m 666 ${WORKDIR}/lighttpd.service ${DRACUT_MODULE_PATH}
+```
+
+See `dracut-example-lighttpd` for an exemplary hook recipe.
+
 ### Creating an initramfs image aside the rootfs
 
 To avoid shipping all tools and binaries needed to generate an initramfs, isar
@@ -1733,4 +1761,19 @@ self-built packages and `INITRAMFS_PREINSTALL` for prebuilt ones, analogously
 to the respective `IMAGE_*` variables. Note that the kernel is automatically
 added to `INITRAMFS_INSTALL` if `KERNEL_NAME` is set.
 
-See `isar-initramfs` for an example recipe.
+See `isar-initramfs` or `isar-dracut` for an example recipes.
+
+#### dracut config
+
+A dracut initramfs can be configured by the command line or a configuration file.
+The use configuration files is preferred:
+ - Debian provides dracut-config-* packages
+ - It is easier to upstream and to maintain.
+
+The configuration file can be chosen with the variable `DRACUT_CONFIG_PATH`. This variable
+contains the absolut path to the used configuration in the root file system.
+
+Still there are some use cases like debugging to add modules via the command line.
+For this the recipe meta/classes/initrd-dracut.bbclass provides the following options:
+ - `DRACUT_EXTRA_DRIVERS` add extra drivers to the dracut initrd
+ - `DRACUT_EXTRA_MODULES` add extra modules to the dracut initrd
-- 
2.51.0

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20251006183214.1593195-11-Quirin.Gylstorff%40siemens.com.

      parent reply	other threads:[~2025-10-06 18:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-06 18:31 [RFC PATCH v3 00/10] Add support for dracut 'Quirin Gylstorff' via isar-users
2025-10-06 18:31 ` [RFC PATCH v3 01/10] add dracut to custom kernel builds 'Quirin Gylstorff' via isar-users
2025-10-06 18:31 ` [RFC PATCH v3 02/10] rootfs: Allow to overwrite the initramfs generation cmds 'Quirin Gylstorff' via isar-users
2025-10-06 18:31 ` [RFC PATCH v3 03/10] rootfs Add dracut to initramfs generator 'Quirin Gylstorff' via isar-users
2025-10-06 18:31 ` [RFC PATCH v3 04/10] initramfs: allow to set the generator command 'Quirin Gylstorff' via isar-users
2025-10-06 18:31 ` [RFC PATCH v3 05/10] Add class to generate custom dracut initramfs 'Quirin Gylstorff' via isar-users
2025-10-09  5:22   ` 'cedric.hombourger@siemens.com' via isar-users
2025-10-09  6:52     ` 'Quirin Gylstorff' via isar-users
2025-10-09  6:21   ` 'cedric.hombourger@siemens.com' via isar-users
2025-10-09  6:53     ` 'Quirin Gylstorff' via isar-users
2025-10-06 18:31 ` [RFC PATCH v3 06/10] rootfs: add flag to use dracut if it is not part of the package list 'Quirin Gylstorff' via isar-users
2025-10-06 18:31 ` [RFC PATCH v3 07/10] Add example dracut initramfs 'Quirin Gylstorff' via isar-users
2025-10-06 18:31 ` [RFC PATCH v3 08/10] Add dracut module helper 'Quirin Gylstorff' via isar-users
2025-10-06 18:31 ` [RFC PATCH v3 09/10] Use lighttpd as a example how to add a dracut module 'Quirin Gylstorff' via isar-users
2025-10-06 18:31 ` 'Quirin Gylstorff' via isar-users [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251006183214.1593195-11-Quirin.Gylstorff@siemens.com \
    --to=isar-users@googlegroups.com \
    --cc=Quirin.Gylstorff@siemens.com \
    --cc=cedric.hombourger@siemens.com \
    --cc=felix.moessbauer@siemens.com \
    --cc=jan.kiszka@siemens.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox