From patchwork Wed Nov 5 12:12:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quirin Gylstorff X-Patchwork-Id: 4551 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Wed, 05 Nov 2025 13:14:17 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-ed1-f56.google.com (mail-ed1-f56.google.com [209.85.208.56]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 5A5CEGrI019012 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 5 Nov 2025 13:14:17 +0100 Received: by mail-ed1-f56.google.com with SMTP id 4fb4d7f45d1cf-64081e1f6a0sf5701038a12.1 for ; Wed, 05 Nov 2025 04:14:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1762344846; cv=pass; d=google.com; s=arc-20240605; b=bgEWrwMWDz4dLQRdR/sSCPVeYUbmPACZleP0P1mBzNH2fyoDp3YGQau55QXev+q9H6 LEFc68hBtfU6tJQ2xZHJsXmRttcdlBdslsuG4wHDHczlJhNQyPBlc+/Wq+ZGCcZwz/7k TRu477lJ7KL34cIuHXr9p7SEl7iAldeOwiU4zhaHL4W9htSvcRkq0HFfQvl6cwLEiyYr 0sXhz9NlMyBk6P6zWq+xS2zi20AcEgLMyBUaJpuhxqHWhcYbfZlsXeVV9XKwYwq3F55W HBAS8p2cCZsFDg8iz9dxDi5PzyzZWbJCeWs6IyCjR6U9N/OeFcuBt430LQgNzBcyACW+ UdeA== 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=8L8JikfTRSoO65k17d01j0+4pueO/+AN9QYQqYz6+/o=; fh=LyH4lr8tU4hP1aPNARkfNgdRXG5uqK3uB5vcYZAL2+4=; b=ZZzPg8VFUMC78gHJQKub864DsScWYF/pNzF00oY/S/i+GwGvPI+4fh8z5T0NuyeYMF eqAMQfozQ+bCmmCnsR5UmBNFAQVOOmwu6nkWF0nBZNcZp5mxRrS+Yuj7g7VAucNJSIS9 CijQn7ykZdOusRO7S1sJ5Aasleh8YN3V5nzHSRTAjbL+JcyKyrKzQ73wtj6zmB38zNkw 3EbZk5iXFTjGXMSVuZUeWGjIPokLWlwUDVs77644BQXH8caUvrMExEe2hhFRhXTTah3P BmBJ/ZJbbPCwijqrUUL3I1voRf2z5MdIxf4qRPr233J4snKfxG2sqovIAdAvPdxD74w3 ihdw==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=nAlzjDHa; spf=pass (google.com: domain of fm-51332-202511051214028477e690a0000207b0-o03ifj@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-51332-202511051214028477e690a0000207b0-o03ifj@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=1762344846; x=1762949646; 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=8L8JikfTRSoO65k17d01j0+4pueO/+AN9QYQqYz6+/o=; b=ZarGoUWoWQ+OfeNWofsyCHje6tbIsVYhdGK70slxvCc528ufs2rgKSmVwKXWTzP1Xo EddhpmKNjYu48MDkkQ2EqVt9rLnvIgSptJdWALqjpm+7APJkQWqJNWDLqfW/zFpgytMx QyDPiEAOg8v6tK4/l4bd67GS2vrJU1CEjlKSARbdNuqekfuFZxirzNNa1ZQc45xM/4y0 szC6pJt2KvtRCMgF5MbTewxLBQxUFWjuhAnrdChyXUFQJcd/Z849EWqa1Z6Z+jpztWzn 7rkCE9vULq4/wg3Q0aMh6rNyz8v+lF2WyDdO3+7C0MvTmn7jGo0zuK7rLtSJ4F+/BeXB FahQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762344846; x=1762949646; 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=8L8JikfTRSoO65k17d01j0+4pueO/+AN9QYQqYz6+/o=; b=q7P35aGXU6K5lPhRrRMN1Lg2SHMcwcwLESoGUzmPpxA2sSLKLBNb6IPnv2qzRrYvwO km7SYYM9e3yQob9FicznlHWIR0NyvDqXZJPqji38SpAclgqM2xGGhSla+V1q/MDpuhgY vIePeYpLaXJAepVX093hEsYydkxkx4EnGVDDTtrqXZNsuW8peI66K/FJNJT0sRQAfLpr 8IFCAVnTWGq+SWFHtCaI/ZspL4L1CbXOKWJapwsH6yOYQj6cD0KebkWOcEhVhcLnBs2w dNDHmwLHeR2w/iPVVhwQzPTbErlXXU46KcKkH9aIx7q9IqrVm/em3MSkF6btt1elmDbd VJ9w== X-Forwarded-Encrypted: i=2; AJvYcCVnFoDwhR263qh+ww5wEUIlZ8n1JRAzfoILvsCDeWkcqtWQHTJlm5aI6rfjG7YrFTg9pekTmzs=@isar-build.org X-Gm-Message-State: AOJu0Yz0K65qNsWxlojqMBKNZNJ8rewva7TYSBmUwRXc0ljdXgNxYCvx +t/hNAyrGOpv2RIWczGB66x1Jiryv+GTer1jese/XUoRpKxj14N7NVtj X-Google-Smtp-Source: AGHT+IEgycX7ClcPO+gfpYLGCcejTBIU7ljY/EkH6XA+v6PhcaS2T4AenA3t78M6/S6qO1U4QXv4vQ== X-Received: by 2002:a05:6402:350e:b0:640:931a:7c1c with SMTP id 4fb4d7f45d1cf-64105b86d20mr2232846a12.29.1762344846344; Wed, 05 Nov 2025 04:14:06 -0800 (PST) X-BeenThere: isar-users@googlegroups.com; h="Ae8XA+ZAXitKlBSUuFnIeGyGUWaHNB7qWUSZXGJnPeM/hyBnkQ==" Received: by 2002:a50:a692:0:b0:640:c3c0:27a5 with SMTP id 4fb4d7f45d1cf-640c3c02a50ls1764383a12.1.-pod-prod-02-eu; Wed, 05 Nov 2025 04:14:03 -0800 (PST) X-Received: by 2002:a17:907:728c:b0:b6d:6a44:5fd9 with SMTP id a640c23a62f3a-b726553aab2mr301437666b.48.1762344842970; Wed, 05 Nov 2025 04:14:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1762344842; cv=none; d=google.com; s=arc-20240605; b=EHtK+WiXdsT65oAabuOMe7ggsdgDDlkKTBpuJ95nFEaZDA32GIbFt8kCtF+D74cM7Z sLcF/j2DDJDu4TxZgbm/LZfJJxwEBDqRrFnnjnYloY4AwFG/riu6R5D6sOFJl5Mt3XqT OqCAGk1eqmCT3pR2rG8mFdhe8WL9+rR4lu8Q344/6JmKxU/4P2+o+ghBxiY1CrhEZ77o 7v3gowIeakuo7JhGVPYCmBHuBMSVXjza9AeisPBgIyCEq2z6tCL5Pz3Jv+90bgbjVout MhxBlImSvkPJt/tTrYv1ItyX5HGPm5iI6lLyXGNFK+AwDIVzld1NzQ8YnIO6MdLfJWvf neuA== 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=blTQUz7aZnZ1URz08BIOGlryZsfskvrWBVtxsy8aow0=; fh=pD9NMAE6punlmxDz2SM7DMFwkWrKOHAvTYxfub7CxRs=; b=PDj0dL+50u0/E27An6gp8LTiXb0bLMRvSnRNnfOmAJf9ZnC+brinm/WofGXdogK60K P6QfxNlwJzFqDD4YA1K6iSXwQ/wk4PvHl4X82/lg4DLIvfcAN9biuUuTMo4UHxbtdUY8 HPzthnQuD4h/ThDMitU5FYqgKErGzJbFjlEL8ZwZuYT3A1k1dFO7Wrz6ipqhSbDZbsob UqnZt8fV0LmmoSV0F2tJbXQUslfFDsIUCY16nJiiiBzrl/fIEWGqNyiX9xKKivSWHu9g VaxoMm0lyKT88/hrTmNWVxaH1a7U4M+4vnCMviH6DuoQY5QQ922u/2E10+1bYIUei7Uz Indw==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=nAlzjDHa; spf=pass (google.com: domain of fm-51332-202511051214028477e690a0000207b0-o03ifj@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-51332-202511051214028477e690a0000207b0-o03ifj@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 a640c23a62f3a-b724130ff62si17951066b.3.2025.11.05.04.14.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Nov 2025 04:14:02 -0800 (PST) Received-SPF: pass (google.com: domain of fm-51332-202511051214028477e690a0000207b0-o03ifj@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 202511051214028477e690a0000207b0 for ; Wed, 05 Nov 2025 13:14:02 +0100 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: [PATCH v7 13/13] user_manual: Add dracut for initramfs generation Date: Wed, 5 Nov 2025 13:12:44 +0100 Message-ID: <20251105121350.114449-14-Quirin.Gylstorff@siemens.com> In-Reply-To: <20251105121350.114449-1-Quirin.Gylstorff@siemens.com> References: <20251105121350.114449-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=fm1 header.b=nAlzjDHa; spf=pass (google.com: domain of fm-51332-202511051214028477e690a0000207b0-o03ifj@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-51332-202511051214028477e690a0000207b0-o03ifj@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 | 73 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 69 insertions(+), 4 deletions(-) diff --git a/doc/user_manual.md b/doc/user_manual.md index ecb1fb2c..e7955c12 100644 --- a/doc/user_manual.md +++ b/doc/user_manual.md @@ -1682,13 +1682,36 @@ CONTAINER_DELETE_AFTER_LOAD = "1" SRC_URI += "docker://debian;digest=sha256:f528891ab1aa484bf7233dbcc84f3c806c3e427571d75510a9d74bb5ec535b33;tag=bookworm-20240701-slim" ``` + +## Switch from initramfs-tools to dracut + +To build a Isar image with dracut as the initramfs generator instead +of initramfs-tools in Debian 13(trixie) or previous versions add dracut +as a package to the image: + +``` +IMAGE_PREINSTALL += "dracut" +``` + +An dracut based initrd contains the file `/usr/lib/initrd-release`. In +case of trixie the file has the following content: + +```bash +NAME=dracut +ID=dracut +VERSION_ID="106-6" +ANSI_COLOR="0;34" +``` + + ## 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 @@ -1725,6 +1748,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 class `dracut-module`. +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 @@ -1738,4 +1788,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