From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Thu, 30 Oct 2025 10:45:43 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-ed1-f64.google.com (mail-ed1-f64.google.com [209.85.208.64]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 59U9jgA1005729 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 30 Oct 2025 10:45:42 +0100 Received: by mail-ed1-f64.google.com with SMTP id 4fb4d7f45d1cf-63c17f5cee1sf964323a12.2 for ; Thu, 30 Oct 2025 02:45:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1761817533; cv=pass; d=google.com; s=arc-20240605; b=l3ef1m6j0rCm0dryZ3INszEiOWG8yK3moYK+42zn2ChWuGdT7w4DhKImCrkOVt/592 Xghs/wVva8SkNfmatwkujqdbUsdqKyUKgpXQzGTgvOeKR57WusqULg/+RbZej0n1x/CT C6z1Iifes40ZRWPmOkFINt9LcunyCv9LcYpjlxJAvOyf63yLJ0JaAzNxU6PC6HGeYm4X ljAo/mclTIAP/m8wY2fzQIslKvANZ1Fg4nVzvl7qf99WtJskda6wWXUq70nYJnZeGAgp U1uqob+k0ncw2+OhAhDDzU+DlWOKtTzdPZ/+yc2q/SDttcBfTfUUEZ1b4vaSuG8kjKpz /YkA== 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=O7t72R2DspbeN6NsdfW9Y6CQOWtVZxDTYgjVGZG7ORw=; fh=hvIjW6KIwOXIYfHbhtk5NKnR+P8lnkQXwqyr0z9ioUE=; b=BGzgRx91s3phsoiKbpP7VAwbAFygroMhWYxKZq6mxsev9xAsJl1KX0IuJ/q/GSqCOX hT6ojBlouUYT0+ugPFC8ZB2R/ENB03INu8CVbeI4/Noo4IQbXUAiaqQjogNF4JSWytdE KpMASkGsNtMoZLsMg8Vp0aI8cB0E8q9G199l6SpJfjGelK4q24S96MrM1GUQjlfrjBVx w8GOX6H8dFmzfUEHPZ601/o5AsSRB3/z+J+tgspsvvNVF1BSAk2yLB6J16e0Sw8wGy4f GMzENAjlR2K0yxIaNiIxa44ugUx2cUHzFuVv48jKFT1iBq2U6nm4KgOeERgymVIXWTEN YwzA==; darn=ilbers.de ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=Nk24qKGm; spf=pass (google.com: domain of fm-51332-20251030094529d3d9983cfb00020706-pyuetk@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-51332-20251030094529d3d9983cfb00020706-PyuEtK@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=1761817533; x=1762422333; darn=ilbers.de; 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=O7t72R2DspbeN6NsdfW9Y6CQOWtVZxDTYgjVGZG7ORw=; b=uNEo6voRUzTVO+N7nOLDBsdvNr4BoYZJ6zPEgSfG2hnYhROr/arUg55jYeSK/iJJ3J QKFnV2fa20w6pgwUNyHt99xhOs8pW6B80gMF6Trf3l1nk8GqZMUyybcE6voVHPhcNosR UWCmbDjl7OuJk71Za5XjBXlG0NlLUldtpAICA9GKTeswak7VM89glFqEUWNxxIXeze7P TlZEM4/EhWIDWtqwqQkqaFwHRJYcad6UBhrwd4cxLLWYDuNwfCsdWaukWxxwqFecZKRN CmE2BH0n7EchSsTCOcD0cCsok3RDyIfAJeVIRioZIZh96oGbtXHSgNM+QRpuBmwJcYq0 sNHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761817533; x=1762422333; 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=O7t72R2DspbeN6NsdfW9Y6CQOWtVZxDTYgjVGZG7ORw=; b=G5kvZeY/MK4GZr7y7gRK0OWVKpF0EUjn+xJifBT16ZamhTQgKblbliQksFxLFV+6ed 20ZvuMRHlk5AmgL8+ku4Wy9meAJ5LEGuU5WKPEDcP+vHcMvgVl/e22ZKF8q/HckVxAnW ova0r6alXP7/wjfENiV8F8Ger2NcnrkACyuRjQqSGdtPvSAQpuIC54AoDZ8wb1Gwn6In ED5Gzjq6je4tey4ADrXWA8svw+HN6TCc1ZpqHLnS+an6BSWU6ZEu6gdbmhYdRwjjQ+jJ 4JK674qRXAPJxRp7SEOzUURfDiu6u/aEvkVuuUo8OSzXz/x73+KR9blHx//3hNNUXxfX Q+TA== X-Forwarded-Encrypted: i=2; AJvYcCVi5atHaCQ9fN3D1m1uIa2mu5zEa9hHJwWuoMWhQ/JaXp3IIdDmEbODYGthQflTk8XK7FJU@ilbers.de X-Gm-Message-State: AOJu0Yy0/fFRfigomqSzyly+61L/5Z6l0SjOQTi942P7Bv2KM9WjUzt/ EYcNyodPFQh3usZCIShxkJZng/55flzMXcXS+1WbjID3j26m3ML9gA84 X-Google-Smtp-Source: AGHT+IECY6nire0Ce2VokiRxhtCpRDbW7dmIaYalkIMHftOfkXmB9dRYB3RqPbCIM2cjTgEfi99Tlg== X-Received: by 2002:a05:6402:358b:b0:638:e8af:35d9 with SMTP id 4fb4d7f45d1cf-6404425e7c8mr5364677a12.23.1761817532878; Thu, 30 Oct 2025 02:45:32 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com; h="Ae8XA+Zzqhxqw0Kx3syUL2XgTXYG05kVCnpHUx3WkEZ+HX4STQ==" Received: by 2002:a05:6402:460f:10b0:63f:b547:f3b7 with SMTP id 4fb4d7f45d1cf-6405fa53b79ls727131a12.2.-pod-prod-03-eu; Thu, 30 Oct 2025 02:45:29 -0700 (PDT) X-Received: by 2002:a05:6402:2354:b0:63b:f1aa:11d1 with SMTP id 4fb4d7f45d1cf-640441aee39mr5053445a12.1.1761817529708; Thu, 30 Oct 2025 02:45:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1761817529; cv=none; d=google.com; s=arc-20240605; b=ZIEQK8OSpdvUrb6oagmSxdWDKhKXcCRQZx34kaj8F4cPIgRUMKKt3WOFA9JCbbLr4s Q+oBzmiHPTOrNVBcqmNe2vR+04pxTaU+17GXL0tRvxBXTKATlwvkdQKyCEYSI08MzzTV dI+17+6GKozz5qq2UFKFu2ivt9sl0MoWqWjirzpMEtiblLifdQm1W0HrH3DbNVh2S9+1 SgMe7Ci36EX2a6lZ2NOwEBzkrb1xnD6082WDonVH3qji3pLI9VIaJHTa/jeCMJaeT1/r vHWBkjqw78ZeiBfXV+Oeky6jltYSFLNoZj+1NOha/NT+lUJ8ho89PVc+/ZG/peIEtr8X EU6w== 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=EbOvfSks+UsJCkETc4TSWdSogrrGONeqdavWIjneF+s=; fh=pD9NMAE6punlmxDz2SM7DMFwkWrKOHAvTYxfub7CxRs=; b=J/lAMNV+F6WeBgMjA0xULEV3GJugVVrOVq0BaXYX82rx9rMZedh8TZraSkAqRDonLI m4H+WluBpGOgYOKx/36SwtBA6MNllTPhhwgKyQyTDhkHxSatNmGEgUhsRKzbXxix568C GLP6t7ZKQ2mhFPGhH+cGYKoNNUOeZzceYCltJ7/CBDmcwXsDS+K2f06Ngow2H1acyNYp f23Omh9Az8Y4aHzOVkpq9cWutNRtz/C0FaAI/uJz0/Gx2J26bBocdCVilTnGmNk7WZTV 1dv26ojXJeXVZImX2tYtRIOuiHEQwL4WfQN9wN1dlGsNOiwD+BDSTU+RCedVhw7ppKCT fULQ==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=Nk24qKGm; spf=pass (google.com: domain of fm-51332-20251030094529d3d9983cfb00020706-pyuetk@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-51332-20251030094529d3d9983cfb00020706-PyuEtK@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-64-228.siemens.flowmailer.net (mta-64-228.siemens.flowmailer.net. [185.136.64.228]) by gmr-mx.google.com with ESMTPS id 4fb4d7f45d1cf-63e811672ddsi326278a12.2.2025.10.30.02.45.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Oct 2025 02:45:29 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-51332-20251030094529d3d9983cfb00020706-pyuetk@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) client-ip=185.136.64.228; Received: by mta-64-228.siemens.flowmailer.net with ESMTPSA id 20251030094529d3d9983cfb00020706 for ; Thu, 30 Oct 2025 10:45:29 +0100 From: "'Quirin Gylstorff' via isar-users" To: isar-users@googlegroups.com, jan.kiszka@siemens.com, felix.moessbauer@siemens.com, cedric.hombourger@siemens.com Subject: [PATCH v5 12/12] user_manual: Add dracut for initramfs generation Date: Thu, 30 Oct 2025 10:44:46 +0100 Message-ID: <20251030094451.1303871-13-Quirin.Gylstorff@siemens.com> In-Reply-To: <20251030094451.1303871-1-Quirin.Gylstorff@siemens.com> References: <20251030094451.1303871-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=Nk24qKGm; spf=pass (google.com: domain of fm-51332-20251030094529d3d9983cfb00020706-pyuetk@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-51332-20251030094529d3d9983cfb00020706-PyuEtK@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 Content-Type: text/plain; charset="UTF-8" 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-TUID: 3UrSFIftiDxa 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..7133b217 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 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 @@ -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 -- 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/20251030094451.1303871-13-Quirin.Gylstorff%40siemens.com.