From patchwork Wed Oct 22 15:07:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quirin Gylstorff X-Patchwork-Id: 4431 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Wed, 22 Oct 2025 17:08:16 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-wm1-f60.google.com (mail-wm1-f60.google.com [209.85.128.60]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 59MF8FLW020284 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 22 Oct 2025 17:08:15 +0200 Received: by mail-wm1-f60.google.com with SMTP id 5b1f17b1804b1-475c422fd70sf7542115e9.2 for ; Wed, 22 Oct 2025 08:08:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1761145690; cv=pass; d=google.com; s=arc-20240605; b=EnvYxI2akmrnnC6rjZrgMYWPPBBMd7RBiO0qhCGxW4+GWOvijstMlQyQoLG96vhfUr 6HIiL3V91ygT5eFbBdY2YN6KJnbBR26PLbo8kxVvwL8BTlTHHg9qW886hGs6cYwnUR8p IdePd7na1fgSq1SNGnotUZmJM7luibEcp39bbjRjGgSbtV4QrL0KxtXh84cFh2CZDsKW YQYTydn0iNvrv5AgHfD7MxB9mRDh3QQfFTjQkOaGhIeR9LNNYskdIRsoMXbOAYPAJZjZ 2UoK9ryUumzG6N2FwLDmD5QdzcXKDMJLIQwrkWyaoA5LnBm9QU9In8a6HO2PiSabY2IH ug1g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:feedback-id:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=f0cQ3oTcGqLSbmLuFbAVHaOHnuZtUfNKG3O26Wa9OQ8=; fh=E7CCocmNWg+ChavWhdeo8B0NFj46CtxdQka/QcEg2U4=; b=QPLdc8IN0XBkNSIwTwdP+EKPMhzsP9A8uHa00o/b+1X03NhWWQxIAH12sfQnOzx7HA iJjuh0UzygkJ3h3uVitfqOpmzFQBQbfUcBCuW5lrmJCyRnmqTY4wu4Jy8JplP+EbSfPy hQIF5NVpAWhuXJG+UJdmMmIi2x77k214a1Iu+6GNdQPk3PgGZ9RYj+TVV5XNyLj7G/85 21W5wIp4IT2Bpv3JZb82rGjb1CWquyW4XKVXQJbFn1P+c0TeeSn4houFrZc4qbxAfG1a HzJ5a3m7eWttc2vYo9R5PlFp6Fu+vmwMgeOjFCckBR0q/R9PVSsMqIzYRSGD1MeM5Lay uiKw==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b="Ilj/DCSh"; spf=pass (google.com: domain of fm-51332-20251022150806ca7583173a000207e8-81a7xq@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-51332-20251022150806ca7583173a000207e8-81a7Xq@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1761145690; x=1761750490; darn=isar-build.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :mime-version:references:in-reply-to:message-id:date:subject:to:from :from:to:cc:subject:date:message-id:reply-to; bh=f0cQ3oTcGqLSbmLuFbAVHaOHnuZtUfNKG3O26Wa9OQ8=; b=ULnackvkbyVRdupB+PyaY2kbzXwIBE6eOHdbdCkzMZ6QQYKswbP4pPl1U8zGLZ0yzj iLwF5H2e+5IKUyqsIn9x7Q93T2XOudSdHVmewTxg+VyiMRpRqFFc6W/stCM58e8DHreM yrCD8VmXke6Gd60xdUlqsPYlJV6jUaqvl/M+ZHBsylvRubFpitjYm6D7axKkoVHuvAVq f2kNoA15uoat/gKEsVUKwoVKDm2oQE7TnHgSMgwR7uq2KMCLxZtsu+AKBH84rxvsUY2z NZVsoLL9552DpEAJn83t/D1KofrO56hyEX3+k623I+CV6qFWWbCm93XwkTYTHgbp/UAl Bgwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761145690; x=1761750490; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :mime-version:references:in-reply-to:message-id:date:subject:to:from :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=f0cQ3oTcGqLSbmLuFbAVHaOHnuZtUfNKG3O26Wa9OQ8=; b=e9HRxdYmbEpT1g2bJlgTftbq6DRNu2XHXWrI0lC8qplXY9YumbQe/ttmXTL+Gzvjpj MMyQGR/zpEwoc9VatqktTE1EBM99xG9lTe6Qu+M8hsUmXlxfxgTqAicuoklS7E7/IguZ YKomlwJmJbefLWYHyRluotZ3zG0G4fDNSghfSfTxhOScqwAKAmbNqXI7daWWW0bHYwRp UTK8aT/BeWFlTiatcY9Vy4Wob1z7/KOQHZVKq4hVENjMDamJK4Y78sK+iz6Ay3XCW82X /P48uLF6hGXSwXofOHtFyZOe0vFsowl8AdFS5owyYBOEprmyUKPEP2WL4lsPFrJ98UlZ TpPg== X-Forwarded-Encrypted: i=2; AJvYcCUy7ZZdQ2v/22s3HmpR+DK8kzhup3NFLyKxCcCUIx9tC8RCEdukpGse0M0JX9RClwRAOWncWXM=@isar-build.org X-Gm-Message-State: AOJu0YwPdGD7mLCGLEpsS6c1SVy9cJ+dIHSWYuiU+00o6991oijFlAhq 1IN+9/U4JJIESXaTSSPFAy78XyHpc3gQpzbr+tzTzuFJnNKHn0RnJp3b X-Google-Smtp-Source: AGHT+IHG6d2agRcLVevQJV/F2PxlHPb2rMDMZHBtCzKT0y28cwyQbM+CH7kRGfDixdf2tN7iEAzScA== X-Received: by 2002:a05:600c:4e86:b0:471:13fc:4ad3 with SMTP id 5b1f17b1804b1-4711787847bmr184890855e9.2.1761145689931; Wed, 22 Oct 2025 08:08:09 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com; h="ARHlJd43j/EjqsrYLX4DPrMaez7O95sSwpRwwnkskb6zJFfd7g==" Received: by 2002:a05:600d:4394:b0:471:13fa:6cb7 with SMTP id 5b1f17b1804b1-47113fa6e47ls29657285e9.1.-pod-prod-09-eu; Wed, 22 Oct 2025 08:08:07 -0700 (PDT) X-Received: by 2002:a05:600c:8185:b0:471:14e7:e988 with SMTP id 5b1f17b1804b1-47117925d0emr161599865e9.35.1761145686831; Wed, 22 Oct 2025 08:08:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1761145686; cv=none; d=google.com; s=arc-20240605; b=P/H0ZaBv1IIEj0gZ0O+qQm27QJrf28rYakpuThIwQvYaWJ1sdWd6tm364c3S6AizT3 i9e25nxJ1bTAM/FYxdik6s+bjgAmOx+4uF2vqX8FVorfynzv7T7FJWgIDFBMbQ+WFwIa +3KAy9uotb4wbE/D/mQM4Oz8qPQD0nKxYtnU16BYC2i8ANJa1xQsiHPp9NB9QIxPSnFx q5bT8nkEemfnwDQZEqIKs3ob9O9NiFEM6bQuj9pcF6L/hE00VTExPzU3js9FWkOkTKKc 0+BYAMPiR0b3TnWwPDVSyVA7qj1dl7HXttvmyHDod0VkC/8hKw2kjUaa9JQJSWGxv/Hv tXmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=feedback-id:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:to:from:dkim-signature; bh=+SJ/PC7ZWXSDbleFa1D1j+y7+L4DhPtLQ71x60hUG8Y=; fh=AzWnWRpmCf4IZdBJvbC6ssKrEpudtaH0OvZvfrmMWYg=; b=bDc8dkkDyjDjbX4DcugNPnuuMfRIL2/Vu98jSlsUwEXKUdMZIcAnZgxMHiM7YKAu6t 8E+q3nm2ozRwJ32fQQunMzF9tfTAHfGwR/4BzZyixoSNzv5AS4IwogAHZ3BBtKd1bHQR R/g4W+SVY//cGaBUhiFjUXnqMSOiA2+/ck3PvrCrWfOylGwNBGg3kvOkeJqujxfZgV3h o3OCVkSUPTSZAE8Jzq1cQdcjQ5t7c6WsRJhYXzu/isTGjuYJPf4n6Wpye0KyPG5Z/mQa N7p77pedQEhst/xWaKEinnqn3NfGQ9shPbIYVgr/JTTR1Dxe11NmZU/EP7fNUA2j5wZi 7x6A==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b="Ilj/DCSh"; spf=pass (google.com: domain of fm-51332-20251022150806ca7583173a000207e8-81a7xq@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-51332-20251022150806ca7583173a000207e8-81a7Xq@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-65-226.siemens.flowmailer.net (mta-65-226.siemens.flowmailer.net. [185.136.65.226]) by gmr-mx.google.com with ESMTPS id 5b1f17b1804b1-47496b28e1esi1383985e9.2.2025.10.22.08.08.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Oct 2025 08:08:06 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-51332-20251022150806ca7583173a000207e8-81a7xq@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) client-ip=185.136.65.226; Received: by mta-65-226.siemens.flowmailer.net with ESMTPSA id 20251022150806ca7583173a000207e8 for ; Wed, 22 Oct 2025 17:08:06 +0200 X-Patchwork-Original-From: "'Quirin Gylstorff' via isar-users" From: Quirin Gylstorff To: isar-users@googlegroups.com, cedric.hombourger@siemens.com, jan.kiszka@siemens.com, felix.moessbauer@siemens.com Subject: [PATCH v4 10/10] user_manual: Add dracut for initramfs generation Date: Wed, 22 Oct 2025 17:07:00 +0200 Message-ID: <20251022150737.3639891-11-Quirin.Gylstorff@siemens.com> In-Reply-To: <20251022150737.3639891-1-Quirin.Gylstorff@siemens.com> References: <20251022150737.3639891-1-Quirin.Gylstorff@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-51332:519-21489:flowmailer X-Original-Sender: quirin.gylstorff@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b="Ilj/DCSh"; spf=pass (google.com: domain of fm-51332-20251022150806ca7583173a000207e8-81a7xq@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-51332-20251022150806ca7583173a000207e8-81a7Xq@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com X-Original-From: Quirin Gylstorff Reply-To: Quirin Gylstorff Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Status: No, score=-4.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,RCVD_IN_RP_CERTIFIED, RCVD_IN_RP_RNBL,RCVD_IN_RP_SAFE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= From: Quirin Gylstorff Signed-off-by: Quirin Gylstorff --- 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 30d60d4c..af988f1b 100644 --- a/doc/user_manual.md +++ b/doc/user_manual.md @@ -1681,10 +1681,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 @@ -1721,6 +1722,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 @@ -1734,4 +1762,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