From patchwork Mon Oct 6 18:31:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quirin Gylstorff X-Patchwork-Id: 4390 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Mon, 06 Oct 2025 20:32:28 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-qt1-f191.google.com (mail-qt1-f191.google.com [209.85.160.191]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 596IWQ7a029570 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 6 Oct 2025 20:32:27 +0200 Received: by mail-qt1-f191.google.com with SMTP id d75a77b69052e-4e484dccaafsf135775861cf.1 for ; Mon, 06 Oct 2025 11:32:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1759775539; cv=pass; d=google.com; s=arc-20240605; b=gSlwWkWN9+eJXa3YF1M4JDAkeXYeGDke0bqzQuPzV23Otiylrs77TPF0OdJHMDT6S7 s/yRVj9bo70nYG2X0y9hMoI6fezTbNCKf92iRrunDRXmsaX9P7ggrKdOIZI4HP8Mqhkz hSvJLAXFAKzJZ+w3+icIDqlRWzDl3cwExWtrn7J3xlNUWW2+kVuh3keV7Jsss/TPKYMi EUTT/smRtOTcU3tWh8cShyGv+9D2VUPg151l4Mb4lNRZlrJixzhIy4mqb4/aAj70xUe/ r0wCU/1GDHzibpHhnUFLg1o9J7y8dOq1jPJQM0h51C0atDprbocCjtq2XWClTfN5CZMR Q8oA== 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=M0fatJ+shMO01Bo64zS0OhErrl7D4qtA6KE0TtVdkqA=; fh=HK4jG5eXKJvTjPVDe2YH3m1daVvXPSLboq81ZrDmiS0=; b=hPTEKFqIVlwpzq+BA+wcpQVnKlBxCOuCH31yo5TKCs6LJnOrQpJjFf+vLG/z7vvJdH P0nP9PIE5KaZD8QZHzW5Mk7YgiU0ODnTwne8meV/IXR5H5vYdWzpFIKQGGFcQaQXYp4Z miTO4yL/NPdkYhX2UWxUnMQm74yHPaTMgmM3Yd7Eh5DzBl46f716onyAF8O5SeGcR5nC UpfMleKB8Mt31/v6F+6t+fpaCbXQwGfgAM1JsCUg7YcrTDzL9Htlit46e9dzacdlDG6p Z3/UMZSlGdq/3PSuM2PpyHMxO5JPd3dDeYs6biE827Z5PZbkKvlwZCJgF4R82a5JzRd0 TDrw==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=mY0zrmlc; spf=pass (google.com: domain of fm-51332-202510061832178764f69641000207d9-ahwvdw@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-51332-202510061832178764f69641000207d9-AHwVDW@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=1759775539; x=1760380339; 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=M0fatJ+shMO01Bo64zS0OhErrl7D4qtA6KE0TtVdkqA=; b=hSaba8x7DWL/LZY2r9Hs6lXsKFW8bH9yzvORP+42ZF3uAekrdXAsgzLhDgHqZ8+bXG a1RpeT7855Uh2a91PpkLIl3xdj12IlGzOsME3u4uUDzEE8HBw+BQ74lwcw++ublvXJnS KW3wW1DGbklJvGCgXGJlVF14Mw5ArDz8KW6s4yilHDhcIN/S2IMe1ob8ICvkXzey1Pn7 c7CMhulc5t6Q7HD8bIn1L776Ba1HYzwAd1KeyillznWuEC517+W286AuYzMiIGCw16By GNFBVLpoqBZDA9uhKEtfnGuhQQI6q15mTF1nGJ9kgGfvztlv0E7fUdhyi4+SFWPGkNY8 YGLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759775539; x=1760380339; 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=M0fatJ+shMO01Bo64zS0OhErrl7D4qtA6KE0TtVdkqA=; b=sfkFOvl3K623u6lxeW0FrD6Vj9zF+zbF05NnSegLvlR1Zms/RMQ0cDb+O5m4P04S4W 5Z4XPog5cjkR2n8CMpcgx53RmnY0yKuZC1F4MshAvcFlQkK1qSnzotb6w+ZLAgVTw0iz 8TMgDmyJKc39meD/QRvoldvanGtmfAJkPykfVDyym8FwlVwXbvEpa037+nkYamH0LO0t 8DSLPYeWG6UBzA6lVwGaRd7MvKay9bzSBemtRFRER6ss+DY9hJ5XQGvfjjaQx2pb7iCi d0TuZkdrgpOMZuO4AEnVVc+PuzsIi1LKpAk2qXqx1H1i5LMoC67SqouLzSnWJUlSa8Af 9DmQ== X-Forwarded-Encrypted: i=2; AJvYcCXnaUi2CiTzgSCQPL7qXBZToNl1/cOU5vKYJdZlJccKrlt19uxFev1YgKJ7xfDZDd6pDudFFdY=@isar-build.org X-Gm-Message-State: AOJu0YxihOvoheeCKT41s0ElUOto6WmZ1TnPKOWB/ljxzE1i4sTsSC8F xp7ASlnymobygRSAl/eStrFjvXCNLSBnGV3otipTYXF/8/y/3UV+Lu6E X-Google-Smtp-Source: AGHT+IGqNPAH41kZs2skqhAc9EHTdkmLHdTkT/rqwFob7lR2LW3kZxpqvZkfTYJJE0VH2ul2YlAU+A== X-Received: by 2002:ac8:5307:0:b0:4e5:6f2d:97cb with SMTP id d75a77b69052e-4e6de7df07bmr9167781cf.2.1759775539368; Mon, 06 Oct 2025 11:32:19 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com; h="ARHlJd6zzDzKyc4q6FREmrH3M2iwAH3BnbWS+cH0+RBTGUWMtA==" Received: by 2002:ac8:540e:0:b0:4b7:a79d:1601 with SMTP id d75a77b69052e-4e41efed509ls40660971cf.0.-pod-prod-00-us-canary; Mon, 06 Oct 2025 11:32:18 -0700 (PDT) X-Received: by 2002:a05:620a:4411:b0:810:7a53:c62b with SMTP id af79cd13be357-8820c210840mr92577385a.34.1759775538205; Mon, 06 Oct 2025 11:32:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1759775538; cv=none; d=google.com; s=arc-20240605; b=WMSEjk14Et114JlOFcgNOJheB+517l35oRIznyxdfF3SYaLqOSLRJu7uT7cX2x2+sV XCI0JAT9dYHO3qgPmpDibgETfLrevvq57deSZPdkQo8Ensjr1BQrCBYw4fAmnVmrioki 6GBUtewBREJ0SdJl7AbUFl1kNKDDFv6SexsGn6PsH6sB4OK6WRPhisHRoeKxaN/x1HHU 3/U4sdgQ/zbmr9SIzfou7JiXogCljUH6krHqqRohqabBJo3jUI8M1ARJlWnHHDDexQp3 QHDQU/UDNfNZTNjV3VALt0ly8kJWEPWq3KovFwgN07gtJ2PeJpp9lsBiv9t5zlOY6p9K QJ3A== 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=zBUWrYD2T8UqpcXT3kVPMPICqVcLNBhfdCorkrYZzvg=; fh=pD9NMAE6punlmxDz2SM7DMFwkWrKOHAvTYxfub7CxRs=; b=fQhpuAePYoNwFoTd0MAilegi0kxWmAS5O4zCduRqGUwJHDvjbrR//6p+TE70VyeQT7 aLIi0PACOc87I2yBqD6UVeS4d6mfa8aLtNbPr9Bz0kBg3iamFJHaFlayJTohfgRAoVlW m/dZGwKerbtcD2c0hg+tnLGSHdTWFTBsMk2oFe/hX+HpxUWLrw3Dswc7MvG1j6JesXNu UJ3VTjeYOXbmanQQHI2Ni3eKqx7Li83Mim3/WI8+pvYCvdYy91Q1bSUXBhmoX2IpqEgH vkzUNW2EJicYvOwRGmzvBCI4/8TrFjgV3bSuIbXD4EOaw9HblfxKpV4eZoT0SV45shjx uRmw==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=mY0zrmlc; spf=pass (google.com: domain of fm-51332-202510061832178764f69641000207d9-ahwvdw@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-51332-202510061832178764f69641000207d9-AHwVDW@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-64-226.siemens.flowmailer.net (mta-64-226.siemens.flowmailer.net. [185.136.64.226]) by gmr-mx.google.com with ESMTPS id d75a77b69052e-4e55ccdcdf6si26931cf.3.2025.10.06.11.32.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Oct 2025 11:32:18 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-51332-202510061832178764f69641000207d9-ahwvdw@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) client-ip=185.136.64.226; Received: by mta-64-226.siemens.flowmailer.net with ESMTPSA id 202510061832178764f69641000207d9 for ; Mon, 06 Oct 2025 20:32:17 +0200 X-Patchwork-Original-From: "'Quirin Gylstorff' via isar-users" From: Quirin Gylstorff 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 Message-ID: <20251006183214.1593195-11-Quirin.Gylstorff@siemens.com> In-Reply-To: <20251006183214.1593195-1-Quirin.Gylstorff@siemens.com> References: <20251006183214.1593195-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=mY0zrmlc; spf=pass (google.com: domain of fm-51332-202510061832178764f69641000207d9-ahwvdw@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-51332-202510061832178764f69641000207d9-AHwVDW@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 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