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 12:13:12 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-il1-f190.google.com (mail-il1-f190.google.com [209.85.166.190]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AGBDBV0014083 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 16 Nov 2024 12:13:12 +0100 Received: by mail-il1-f190.google.com with SMTP id e9e14a558f8ab-3a3da2d46b9sf32876895ab.0 for ; Sat, 16 Nov 2024 03:13:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1731755586; cv=pass; d=google.com; s=arc-20240605; b=FE92Awc1G4BCS49/ZVa66yjmAHjM2bZONNDi+rZJQag8bIgeeMV6bj0bDmpsAvt5AW esRWqjnJ9TYPnv8SPs51eow596CwziX+yg1mjEXc1uJl1uJt+GtyIV+18kdb9/iFA5Gk ZkFhBTMMKA6PUBAFmZhEXlDPWQOnXuEThlCdpQYh2OF1rZbuoN+6lRgCZYM6XVrwhEf5 vbRIqM2Q3WDxSukGhp2jx3LpSKO3t2+5+fNRRz/8/NvN7AqZF+K3S2aKQ1ny1z3p61aK vrhg7HYM41QmXZdZYrYms1QLEeNkwubc0WSveMLuOLfhUYN4JJAycyk+oCuH29hj1hKA bISw== 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=AyVUEsozNYUj6EHBx6BQpzJLJ54qXAhCFDmGDmDybqU=; fh=LFFkvE+6Xu7u3bnnKM6qXmJXytSbpIVJTiNli7y9V0w=; b=dfdyuEe/xBPfyggCQ+n12uAeFUxZg0EvBAlXE1BRmJQcr4TUv1EPynBFmoV+tY2ojp gyB2v6eaQ0pHHEIIAr9KESIj50nQ8RmgGjOqk1cr3l+PCbkdN7nU2u+jySWvfEWTDads Q37Pk/ynmDKJIvs2U2xFDPicP+YWaGHCsTgX1ipSySVhYZgNHiBcyvPZDm6sIQK17GMo SMcbimQbmuzGQt1397RGYA2TSu5lX2kGbmtE/u6GDTG06SmDjOzNfYVGiH7FV8Vn1Jue vD/1XAHyAZ45KjGhPPUyQgk8GZE07GXXcmGuKCzzuO8EgwWQWcJPgTnH61YRVK3YHW3a IJhA==; darn=ilbers.de ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=hZDl93dj; spf=pass (google.com: domain of fm-294854-202411161113022ce735cd6ec374d57d-t7n_51@rts-flowmailer.siemens.com designates 185.136.64.225 as permitted sender) smtp.mailfrom=fm-294854-202411161113022ce735cd6ec374d57d-T7N_51@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=1731755586; x=1732360386; 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=AyVUEsozNYUj6EHBx6BQpzJLJ54qXAhCFDmGDmDybqU=; b=uKV4y4l1NrF3OAZH6BRtwxscB7wZrwjmwLGbhPRsQGmL1AsFIXZOoATWtlEzC/FjYx BKzMjqUJFVP99srHJNVBayXEOYqyz2oxHhpZPn8H8vL4RNu+EQrn8UmQKAYsT5hXIyu+ GSwX8I1oVjVicXb+sjgAM72f4nCGF+/qaq4u5n/2co5AG0nA6tmHNLW/wP+aZZrIsaua 6fL3IpbfqZGCrVbyG2UZx+ZULGZz04TvnB1KnFyh6etX2uw1ZwdCyz47SMydu3qN1evM lIoEHPJjyAKJ+cHo8DdTNq+mkOfGbWprKJdyNzG6JljN9kFdIXM3xrQe4q25c61VeAAj szag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731755586; x=1732360386; 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=AyVUEsozNYUj6EHBx6BQpzJLJ54qXAhCFDmGDmDybqU=; b=JdW2XNE3pDrcLD04bizMygnKrD6a3EIohMASA/dRqWKH9pQMcHIS7Vyf3fIWQ4sz3k 9EWrObuZqnLmdM4qlqdY9E2ApWmzI3cVb2EPwGpmBDoMCqNolxzSLQo4dcnOlChueiIW BQYvfOEiYSVeRhzw3Gdf1zoH7TErQZ1OnS2DnB572S3nB+VpgJ7tpzzT4t1MqW99pxGO HKaznGoXEH1YgIt+NkqBnU89GeV5tfQTnY8gY3xKVUmieLw5RX1q/N4ZP3+8OPMjQmgL k94ZMR+7R6qvpH9VCR7X6iFS27vQpJQitVCoYPsF2WqYOy7FYad6alqO7hR3YFrYOtTy uLOQ== X-Forwarded-Encrypted: i=2; AJvYcCXW3RlpsJhiuOhuhYgS4DkHKZu+8uNtKnIbGjy2YcoV5YXKHAXxXCydy2eTB0f62276fAGr@ilbers.de X-Gm-Message-State: AOJu0YyRo4KIab2HUb98A4hYrGd20LzQ3RMqZJWpZxi7yGo83r93Ud4E mzCG/0AkT80pEP0GRGLfwbZlt3LB6aEz4PH6QTky3rtvZJwd4R3k X-Google-Smtp-Source: AGHT+IFUb8o8UUju0TofnbmzS2epObbJ1JhnniSXW81ZsnulEK7zhFNwNkcA8HGsQredFy9Bev3JxA== X-Received: by 2002:a05:6e02:3203:b0:3a6:c023:7e35 with SMTP id e9e14a558f8ab-3a748012a1amr72177415ab.8.1731755585679; Sat, 16 Nov 2024 03:13:05 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a92:c5c2:0:b0:3a6:acdb:e3f8 with SMTP id e9e14a558f8ab-3a71e3755adls15074445ab.0.-pod-prod-07-us; Sat, 16 Nov 2024 03:13:04 -0800 (PST) X-Received: by 2002:a05:6602:1510:b0:83a:c858:dc3a with SMTP id ca18e2360f4ac-83e6c32ef20mr601195239f.14.1731755584660; Sat, 16 Nov 2024 03:13:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731755584; cv=none; d=google.com; s=arc-20240605; b=a+Z4ctXMaVRXLCZOZIF94njK6BDGXXMS+skzIHJnMYJrag6HnzvTI6nNXPvVXbYlLW NAsbq4IjKDUTmtqeXHhsxvUn8UtN0wBvYZ+PnerIAoS0Lt7eJJ6OjJ2PyRZ0jHQaLzGf otN3wFX4R+b5jvBvu091sfI1Fk9D45o1uXunB+IXKFRym+eOz9obg3rJfFBFVOk7ML0V XsjDkNvhdRNLeq3HgM8z/LBBEevHvbJKuFfOyodhrcmWPIgurzmtXM+auWxjDz/aFL+f ewTkPa3gevuf6/itiMoY2T9wZU00D4czlHVaEHiiII+x6CYmWtRGO/QYe+Qj6zIoOcje HqHA== 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=WBe6if+m5m/CU1+AN48jGGIzRTJZvH0v0fB08kzzEHE5QIRhM63GMPy3lUCmqkxVZd P7f8McfyovSl3Mkh3w87TLTBst1QKJ1OwogmfRtTyrRpcY6SiMGrJShj5lEHCQs4QITk k2Q6+A1qZOisxvwhtRsVk5gF2Zgod3DhXtIc3Fjr95fuB8wnlAVurwwW7xARJRkSb0gm igTwXQO84wGzt1gN/m59H7FK+enZwNTch6qYINUx2VwVJ0qn/4xvyZmWoiO+CjWVCKXm NRLSiLmVB1l6o7aDznWsYpDeqMHtGHrI1DJdHOAR6e2khqfyfepQNntmp7niRtnnNnKw OPMg==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=hZDl93dj; spf=pass (google.com: domain of fm-294854-202411161113022ce735cd6ec374d57d-t7n_51@rts-flowmailer.siemens.com designates 185.136.64.225 as permitted sender) smtp.mailfrom=fm-294854-202411161113022ce735cd6ec374d57d-T7N_51@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-64-225.siemens.flowmailer.net (mta-64-225.siemens.flowmailer.net. [185.136.64.225]) by gmr-mx.google.com with ESMTPS id 8926c6da1cb9f-4e056f37528si125930173.0.2024.11.16.03.13.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Nov 2024 03:13:04 -0800 (PST) Received-SPF: pass (google.com: domain of fm-294854-202411161113022ce735cd6ec374d57d-t7n_51@rts-flowmailer.siemens.com designates 185.136.64.225 as permitted sender) client-ip=185.136.64.225; Received: by mta-64-225.siemens.flowmailer.net with ESMTPSA id 202411161113022ce735cd6ec374d57d for ; Sat, 16 Nov 2024 12:13:02 +0100 From: "'Jan Kiszka' via isar-users" To: isar-users Cc: Quirin Gylstorff Subject: [PATCH v4 2/7] doc: Describe initramfs customizations Date: Sat, 16 Nov 2024 12:12:56 +0100 Message-ID: <3a94408e8cbbd169d6cdd70627338ac6ea201197.1731755581.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=hZDl93dj; spf=pass (google.com: domain of fm-294854-202411161113022ce735cd6ec374d57d-t7n_51@rts-flowmailer.siemens.com designates 185.136.64.225 as permitted sender) smtp.mailfrom=fm-294854-202411161113022ce735cd6ec374d57d-T7N_51@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: IcB45GqBPJcV 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/3a94408e8cbbd169d6cdd70627338ac6ea201197.1731755581.git.jan.kiszka%40siemens.com.