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; Sat, 16 Nov 2024 11:56:04 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-io1-f55.google.com (mail-io1-f55.google.com [209.85.166.55]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AGAu2mr013475 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 16 Nov 2024 11:56:03 +0100 Received: by mail-io1-f55.google.com with SMTP id ca18e2360f4ac-83e5dd390bfsf253666439f.1 for ; Sat, 16 Nov 2024 02:56:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1731754557; cv=pass; d=google.com; s=arc-20240605; b=bPCw1UNPEuZ7StxyUlNEEBE/NcaIyR1jtMgTbArDYhA98w/88npkpw7bIr9u8+hd+w pT4yyrrxB9nrxl3Gw7E8f1YyqZc329Ep2Tz8DcUsKZ0EDofv8pBti6IzIiLQrGdT0/LW zzWR9x124x3nONJlZgL3Dp6KDxoN4umdD/1dgPE+c0UcPfU9YNmsrzZcQigkQ/l0bVIZ BGUHkJIOLWWYyx2ioQQaBxVUoYV9xhGEQbIZlksWmr5JIlm9UJowLVb477i/6G+GziZd 9w9baJrdQWCg2jr6r7bhyDifmxgW1WD11L82KfQJyMSUexEPx6GNKWQfzAcgL35o9xZr iSig== 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:cc:to:from :dkim-signature; bh=a0ag0roZeWRRd8hCYEfB0G8+QZibGgYozfhpkBebsDc=; fh=Dd71O1x6r7Zm+TsNlV3EbZ1bY4YchIAorUJ0OngAb4k=; b=lyTi33Az4BqUpxGe8xZEs/BMGeSdeulfic1Yvf9rtcpo0+ufGz9AsM4lDvDNZqNeSp uVzhqzsvjGoXZ25T7/QYDN7lsf6wppNnyVodbLNIoqJTyy55oM+ESJH1dV+7cRPpjNQy 0dZXu9cI9chElA8bGAnBtmL4eFdHXIR1D5LUD78DWAFTPgenYHmUBQqUKeli2F4QV0tT kNwUP35xXno1agF9YIrilIY+eKIPN87T8TK81OD00/9DvmVjvjn3yJnNf8UnwEXb1p3Z E77n39nL0v2HXE/pb97ijiGzDYHWMAaUhx32bdl4iCNuE83jHT/DlpGyx+wW0ozSIAy1 tYhA==; darn=ilbers.de ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=Xg4sTEZG; spf=pass (google.com: domain of fm-294854-2024111610555464d807605b75a8e291-fi1x_4@rts-flowmailer.siemens.com designates 185.136.65.228 as permitted sender) smtp.mailfrom=fm-294854-2024111610555464d807605b75a8e291-fI1X_4@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=1731754557; x=1732359357; 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:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=a0ag0roZeWRRd8hCYEfB0G8+QZibGgYozfhpkBebsDc=; b=GOmVFNHFE8UmRF0MEXmXIop8T+6H09K5rhS4Ms+MKLPnymnXDfbUYudiE0kvQ159di Kump/j71Ct/dFUPbdujJi9phKWiTzufD1PFTuWlLh9tB5UnAnN0FI9iApMmsXGXF6uWE LKxV68bl3Odl7QmC28cUrIu7bC7OIuaXPEUZ+3yg4i/o48ONeyh5vzJSS2uQrleZX3ds kbhcgx8XUrLpRjpt8ErGmWpluRqPQiQXeiPwau1QxwzkpHERNCG1mQjuS2PyqagC23mj 14AifyYlm96KFQVqHZdJmx+y4aytSNrp1xm/EZ1s2Jo9t7z7pgf4OxJGlSYvF8PBIpc3 N1Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731754557; x=1732359357; 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:cc:to :from:x-beenthere:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=a0ag0roZeWRRd8hCYEfB0G8+QZibGgYozfhpkBebsDc=; b=PmeRirjwf2sE0ya6rJOXm4weSCJPj2BdrKfTO2hniFRuwt6uGurCObfrqwWjCEhK+c Zriwf186rm0cOt7459NcQdWfrZL2oTTIRibdnJGc/p3vCHRsNanGGLxXERHJ74xeo8Ex 0tmjFS25goD5sM9D8J5Z1MBUt+naWR6EoyMY8Tqrij37hre4TGytOzxNNgXpRgw5ls1M +a9iBx9QzUQwHLGoMxEqepGY03ssDu7XEap0Yd6xnO8Q3Zlt/whLwWyxqMhx/0Vaf6fl 06gWtE4NZyXzZDZDlu9sy2sd5k6Nv7983/lDR3RmYw2N3VsPR23h1+LR8pgrHBj4QzpR IhdQ== X-Forwarded-Encrypted: i=2; AJvYcCXqeAYwDjdCn0ujckrYN83WkhsWUrxx/Z+v+wGEaaQdt7lwkKRNW0XC4gjFGvZNDgsMBSzy@ilbers.de X-Gm-Message-State: AOJu0YzF+7YlbjY8WCzKflhYHd13yr+DUB9EbVuTSBRyDdftxO0+Q8Jy HzZZ3AVUGycHvKogeA4plhfC1Y/voDr7yf7heK2wWHTYy23E3Dqv X-Google-Smtp-Source: AGHT+IGO3HT3f3PORDkwE1pm0u9ykFqwNhTXV6jUcXVIEP1tbJfAGov16XKExQ+ubri2a0srJ2IypQ== X-Received: by 2002:a05:6e02:1c86:b0:3a7:319c:9351 with SMTP id e9e14a558f8ab-3a746ffdaa7mr62663435ab.9.1731754557486; Sat, 16 Nov 2024 02:55:57 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a92:bf01:0:b0:3a6:b643:82ee with SMTP id e9e14a558f8ab-3a71e48bc84ls14831065ab.2.-pod-prod-00-us; Sat, 16 Nov 2024 02:55:56 -0800 (PST) X-Received: by 2002:a92:d64c:0:b0:3a7:5ced:af04 with SMTP id e9e14a558f8ab-3a75cedb450mr2247805ab.3.1731754556418; Sat, 16 Nov 2024 02:55:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731754556; cv=none; d=google.com; s=arc-20240605; b=UkyqTgKGwMKaNPoZmL9nqnr5nqbBZYDzX0SFRrScnTG+IGcS0JazIThL2shz4Nf9QG iv2W4TloLF2UkatjbgPGQ8/nedObrU4pYly3V3vEsW+KD5QbK/0Uidx2ZUyagF4e38JR ZIx0gi4eWGOfcIwJu0Qj6ohtnmRYh4E8n9qr6+Yilkupons4aN7jslbup8d5CMSVW6KE 9zAtOOfpOfQM2JHmhx/Og8PAde1SS6OSw6PLtonzRobJ+UFetAmQlKSaEe5o8sAUoJOQ J9leuHasgOWU6gYTHif4+fvoFQAS06806W9cYWHsnUbwMGpEBU2IPon6ZfhaIRld2MXn GtxA== 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:cc:to:from:dkim-signature; bh=MGtnwDmd0nGW5LYz9FhXkLLYF1RdsF2HYPn6RDVj7EA=; fh=TWGwN84gUgHIe5O4CbyH9KISyeWwGbvUX7cnJPxVD70=; b=VJQ3b20eS8ftQk1kFFb6oqIk15P6b2ttd7Ikf2wTCvtuJoK+EkPMmlrCCYWFx2aRx3 MdeWVFBJgBjhqzabPSYEmUPnY89GbWS6oVOhBGTKgBgBuOliJvljrYrh3gdiKAUnx344 rjpo7SvXUwUHpkVMJaKCkAVB2uUvAoGVpXDT+Ja3zqSYePRAGD/1oVlpF8aC5D+NCCyC fZrlVdEafIHL4+Q+jwpn83iQ1nhE9HSofJ5YtvW1wD6xkD5lDAt0FpvbdcdsXW4xCW3r TyJujBCaoikPsheonxDGHxDet74FzFfSGhQC08pvQ3po2SFOYWB7e5NkRWu6902LAAAT 3DOQ==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=Xg4sTEZG; spf=pass (google.com: domain of fm-294854-2024111610555464d807605b75a8e291-fi1x_4@rts-flowmailer.siemens.com designates 185.136.65.228 as permitted sender) smtp.mailfrom=fm-294854-2024111610555464d807605b75a8e291-fI1X_4@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-65-228.siemens.flowmailer.net (mta-65-228.siemens.flowmailer.net. [185.136.65.228]) by gmr-mx.google.com with ESMTPS id 8926c6da1cb9f-4e056f37528si125246173.0.2024.11.16.02.55.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Nov 2024 02:55:56 -0800 (PST) Received-SPF: pass (google.com: domain of fm-294854-2024111610555464d807605b75a8e291-fi1x_4@rts-flowmailer.siemens.com designates 185.136.65.228 as permitted sender) client-ip=185.136.65.228; Received: by mta-65-228.siemens.flowmailer.net with ESMTPSA id 2024111610555464d807605b75a8e291 for ; Sat, 16 Nov 2024 11:55:54 +0100 From: "'Jan Kiszka' via isar-users" To: isar-users Cc: Quirin Gylstorff Subject: [PATCH v3 2/7] doc: Describe initramfs customizations Date: Sat, 16 Nov 2024 11:55:47 +0100 Message-ID: <5dd3ee9388f0c93142d123fc0fde550b8a3cf638.1731754552.git.jan.kiszka@siemens.com> In-Reply-To: References: MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-294854:519-21489:flowmailer X-Original-Sender: jan.kiszka@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=Xg4sTEZG; spf=pass (google.com: domain of fm-294854-2024111610555464d807605b75a8e291-fi1x_4@rts-flowmailer.siemens.com designates 185.136.65.228 as permitted sender) smtp.mailfrom=fm-294854-2024111610555464d807605b75a8e291-fI1X_4@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com X-Original-From: Jan Kiszka Reply-To: Jan Kiszka 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: 6gDnzdAzg0nX From: Jan Kiszka Document to new hook.inc as well as the preexisting initramfs class. Signed-off-by: Jan Kiszka --- doc/user_manual.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/doc/user_manual.md b/doc/user_manual.md index 4b07f903..c20ffd93 100644 --- a/doc/user_manual.md +++ b/doc/user_manual.md @@ -1602,3 +1602,57 @@ CONTAINER_DELETE_AFTER_LOAD = "1" SRC_URI += "docker://debian;digest=sha256:f528891ab1aa484bf7233dbcc84f3c806c3e427571d75510a9d74bb5ec535b33;tag=bookworm-20240701-slim" ``` + +## 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. + +### Creating initramfs 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 +`recipes-initramfs/initramfs-hook/hook.inc`. It is controlled via a number of +variables: + + - `HOOK_PREREQ` defines the prerequisites for running the hook script. + - `HOOK_ADD_MODULES` passes the provided modules names to the + `manual_add_modules` function during initramfs creation. + - `HOOK_COPY_EXECS` identifies the source of the passed executables on the + rootfs that runs mkinitramfs and passes that to `copy_exec`. If an + executable is not found, an error thrown, and the creation fails. + - `SCRIPT_PREREQ` defines the prerequisites for running the boot script. + +If the generated hook script is not sufficient, you can append an own +bottom-half script by providing a `hook` file in `${WORKDIR}`. It will be +appended to the `hook-header` that the helper generates. + +For running a custom script during boot-up, provide a bottom-half file in +`${WORKDIR}`. Its name defines where it is hooked up with the initramfs boot +process: `init-top`, `init-premount`, `local-top`, `nfs-top`, `local-block`, +`local-premount`, `nfs-premount`, `local-bottom`, `nfs-bottom`, `init-bottom` + +See https://manpages.debian.org/stable/initramfs-tools-core/initramfs-tools.7.en.html +for further details. + +The hook recipe should follow the naming convention `initramfs--hook` +so that its scripts will then be called `` in the generated +initramfs. + +See `initramfs-example` 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 +provides the initramfs class. It creates a temporary Debian rootfs with all +those dependencies and generates the initramfs from there, rather than the +target's rootfs. + +This initramfs class should be pulled in by an image recipe. Said recipe +specifies all dependencies of the initramfs via `INITRAMFS_INSTALL` for +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. -- 2.43.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/5dd3ee9388f0c93142d123fc0fde550b8a3cf638.1731754552.git.jan.kiszka%40siemens.com.