From patchwork Wed Nov 20 17:02:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 3952 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Wed, 20 Nov 2024 18:03:14 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-qv1-f62.google.com (mail-qv1-f62.google.com [209.85.219.62]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AKH3CgY006919 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 20 Nov 2024 18:03:13 +0100 Received: by mail-qv1-f62.google.com with SMTP id 6a1803df08f44-6d40783aa19sf285276d6.0 for ; Wed, 20 Nov 2024 09:03:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1732122185; cv=pass; d=google.com; s=arc-20240605; b=TvKUFDOWxO3SA8Pc0bpJdn0yNQToX3S3hGCkXoBwzSWQbzvEhPSD9duaFzFc2yRj3a JqbU8VLUzleIyC8tADBiRaWqcU+kSrBT5++N7FkWcS/6OMGm+PIr6EP3SyNKA1U+C9oU QjFxRI5t1NKx0llUPE3Sop6edhE82ji2gfvESlQW8TTZNfjc+W7M61DBRfdchivdx0az EfbBGDJWPMOIc99ufRt+QVpqNKjQTEa7b4TUOlgFYFDVYTFy3he4nzRrsIilcha2EuZX 79EjZzcUsUXIQD3ZtH2IXJ/Yfv1/zri0Ebq9WPOYE+uWAcOoEQ0mMO+W9BOrhZMDi/AC ifUQ== 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=Iv79RXHq4xj9IYc7kX+CrGI/BIf3Hth6zlPC4PRu5Kw=; fh=qcSeF/WFJEOdcaQn/cVg4MpRGRBQCDdFPj015UE4Itg=; b=XXg1boJePJ/UVFK3YCdl+gyb6XxWtD7Bt8wZ2RvmKs815ymyIwejRL/iJbkBZnpA1c LVhvkFEt4/zGoNrjQwLgWE5iOoVhO/cprYTnp0kat00Zz9uN2xdrxegA6pO2okrPqckY Bttivciy7UadOjttnOd/rFPOc4mOQOjSn3BUaxy9m46kfpDghjK4x88Da8uShzn2RaZL UUI6kPTv/EK/dZW8nZOZfuEB5lDtZltQd/9KVOVuIYm4b3huHowTbXZThirFyr8DGJ1/ UHe65hdNLOq7JTDxmsm2UfgepuyRbzuN6Skax44Rqd4lREAdjgVoYK/FSeKdqdjFgDmR 2BMg==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=W5fNZW8Z; spf=pass (google.com: domain of fm-294854-202411201703025ffeba3e1c5bf5765a-dzvbjd@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-294854-202411201703025ffeba3e1c5bf5765a-dZVbJD@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=1732122185; x=1732726985; 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:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=Iv79RXHq4xj9IYc7kX+CrGI/BIf3Hth6zlPC4PRu5Kw=; b=glhYWgGnwW6cWdYJUw5LF1hwFR/9+F8zXdqja9/yBtb0fp3EfiolY0w+vOpxI8xvJs 7mu0jesFyyVkV8Gw+tArjTh5JW0bEMiyI7Qn+vzT8HTzNp5W2edv1LWZiZdEzZ9u7gmF LwYZLK11iblIva9jcvnvxMekHh1/myCzCPTdsH+2ohkU2mZyzXehH2l/oSTwYxFddxZZ FpZy50w7shL9PPfz2KN9bzUB9HGatvO0stIEK0l8Z92WAEHhpCl42eKQWdtp9yAzcFFs bQDb/lYBMWw76NlRcHW/ZlKd+3FXfJ2wUf8erEja1FLSD5A9iXb9yIjh/2vj2h2tmkGz r+dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732122185; x=1732726985; 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=Iv79RXHq4xj9IYc7kX+CrGI/BIf3Hth6zlPC4PRu5Kw=; b=WWwmc17SquVTN4NGcrhaCuKvccJ/IAtTjfvxTfyC9c9QKGvWAJGtlLkt2EFueYHc0t ZuVJAHF0NyXA4uz305tafdHFSYHZ1OHa1eZp26iCEYpyhzKAevmheXFc9zKUR8jHhTHV 1sJ1zXpLxVlc6W+5Zc6Ol9ur2CFf43+XRlql2X8HGfTiAVhQT7YMNi1psgDoMwPi7pz6 QfvA+iKdxv8BogyqlRGy0Gqo5ha5b6B1Smn8fv1QPTDU899B7bR02ufm4ppdngBsoTHJ qTOJ9KZrnip2t1v9PSLrZFJqHaymwcx3+SkEJdUYxE7wX1Wj/4AXbMr5PZfHK4o/O6XR GrAg== X-Forwarded-Encrypted: i=2; AJvYcCU3yDf3E1h/NbFUWFRSZmNr4XgZA8gdaneM7NE81LpAXQMjBzfj6uh3FRlKEwTO7snU4HkPPO4=@isar-build.org X-Gm-Message-State: AOJu0YwSp5vtalMG+22mDnvC90yh9GGJq+MA7kZM/2K9irRCCcuBx63Y 8wQBOr1Rq5XqqiVtrsB9aedZFw3rX5ub7OSupyyhR7MsHU3rvopY X-Google-Smtp-Source: AGHT+IHlznZWRFp6fqpscGqO7dA68TIKq45vH+fKWhS8148zsIc+GT5SJVs2Pd61WKsu95ebBBej1w== X-Received: by 2002:a05:6214:dcc:b0:6ce:34d5:8882 with SMTP id 6a1803df08f44-6d437859d96mr53732396d6.39.1732122185221; Wed, 20 Nov 2024 09:03:05 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6214:f08:b0:6c5:127c:2ebc with SMTP id 6a1803df08f44-6d44241d5d6ls555376d6.2.-pod-prod-05-us; Wed, 20 Nov 2024 09:03:04 -0800 (PST) X-Received: by 2002:a05:6122:1ac5:b0:50d:2769:d741 with SMTP id 71dfb90a1353d-514cfb6e816mr3719216e0c.11.1732122183947; Wed, 20 Nov 2024 09:03:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1732122183; cv=none; d=google.com; s=arc-20240605; b=NT4C3e8/pDTG6cWdTf1TZKDEE9MJ5h6bs6qSwAd27TZ5jL4vAse07zXlb03tdN67tv y4YJIyvgvBJU30nuIMZhoc9kMJ9bHV04iaCw30csXdv1hK3cTAaf5nwUe09mHbNTWjy8 /P2RR3L5GU0JjPlFrhYzqr8TvUDd+7eRnH1XgOEbrmdZXs0IbsvI5n3VKvdfLTh0gF5A q5Ayjdt9qhl8q1BiLC/KHLyTxYflAqpDColxwUwJL3JkIbsSGhYWkunXczXqpvQ+Zekq QssDXBVluDDpjbmPSg9homAQ01nq8OpGCzICAtRCaE6w/Qde+/3cz+5fdqnSqwIp6hpb hp8w== 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=Xl38PQkK7qK1k/zNjnAIrhV98xAbhYcrTbelfD58lHg=; fh=TWGwN84gUgHIe5O4CbyH9KISyeWwGbvUX7cnJPxVD70=; b=JZq7EwuWNH6dHdRP8uroqi+s8sHx3A2Ejw/u8VIyosT+W8OogHm9wXiJmnyJTNrYwz DVm28O9S5yQDqLSOMvq7I6jWnLz+Df/1ku2ti5hkJrUpuHB3a8RdGMCr8RoXgf5lveg5 8qizpnKIM3bcfnjy0wfER9yWSDxv0uvJ/opIT9Cw9dvlQZ5wjY+SPc+CvIAYBNrujKrC ttvSB7W16tvVC96+JB+b7XHnrxVCiI5sW0MVEFfGZijUIK4fevFw3Orbpn3OtHUMWexC csvqf6B0zAk+CRKC5e5lmTa1kx+zfkpmpCmDAquI1dih8qkbc2gTTxmA/KHzZ0bgIyVH PLPA==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=W5fNZW8Z; spf=pass (google.com: domain of fm-294854-202411201703025ffeba3e1c5bf5765a-dzvbjd@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-294854-202411201703025ffeba3e1c5bf5765a-dZVbJD@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 71dfb90a1353d-51479dd7b1asi913678e0c.5.2024.11.20.09.03.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Nov 2024 09:03:03 -0800 (PST) Received-SPF: pass (google.com: domain of fm-294854-202411201703025ffeba3e1c5bf5765a-dzvbjd@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 202411201703025ffeba3e1c5bf5765a for ; Wed, 20 Nov 2024 18:03:02 +0100 X-Patchwork-Original-From: "'Jan Kiszka' via isar-users" From: Jan Kiszka To: isar-users Cc: Quirin Gylstorff Subject: [PATCH v5 1/7] initramfs-hook: Add infrastructure to ease writing hooks Date: Wed, 20 Nov 2024 18:02:55 +0100 Message-ID: <22c10d97f224599c405086346cbadea5c8797919.1732122181.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=fm2 header.b=W5fNZW8Z; spf=pass (google.com: domain of fm-294854-202411201703025ffeba3e1c5bf5765a-dzvbjd@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-294854-202411201703025ffeba3e1c5bf5765a-dZVbJD@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 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: Jan Kiszka This recipe include shall simplify writing of initramfs hooks. It provides the usual headers for the installation hook as well as the boot scripts, allow to generate that code that installs executables and modules into the image, but also supports expanding the scripts with own snippets or defining own ones completely. Signed-off-by: Jan Kiszka --- .../initramfs-hook/files/hook-header.tmpl | 39 +++++++++ .../initramfs-hook/files/script-header.tmpl | 26 ++++++ .../recipes-initramfs/initramfs-hook/hook.inc | 81 +++++++++++++++++++ 3 files changed, 146 insertions(+) create mode 100644 meta/recipes-initramfs/initramfs-hook/files/hook-header.tmpl create mode 100644 meta/recipes-initramfs/initramfs-hook/files/script-header.tmpl create mode 100644 meta/recipes-initramfs/initramfs-hook/hook.inc diff --git a/meta/recipes-initramfs/initramfs-hook/files/hook-header.tmpl b/meta/recipes-initramfs/initramfs-hook/files/hook-header.tmpl new file mode 100644 index 00000000..ee30d691 --- /dev/null +++ b/meta/recipes-initramfs/initramfs-hook/files/hook-header.tmpl @@ -0,0 +1,39 @@ +#!/bin/sh +# +# Copyright (c) Siemens AG, 2024 +# +# Authors: +# Jan Kiszka +# +# SPDX-License-Identifier: MIT +# + +set -e + +prereqs() +{ + echo "${HOOK_PREREQ}" +} + +case $1 in +prereqs) + prereqs + exit 0 + ;; +esac + +. /usr/share/initramfs-tools/hook-functions + +for module in ${HOOK_ADD_MODULES}; do + manual_add_modules $module +done + +for executable in ${HOOK_COPY_EXECS}; do + if exec_path=$(command -v $executable 2>/dev/null); then + copy_exec "$exec_path" + else + echo "(ERROR): Unable to copy $executable" >&2 + exit 1 + fi +done + diff --git a/meta/recipes-initramfs/initramfs-hook/files/script-header.tmpl b/meta/recipes-initramfs/initramfs-hook/files/script-header.tmpl new file mode 100644 index 00000000..faa1a644 --- /dev/null +++ b/meta/recipes-initramfs/initramfs-hook/files/script-header.tmpl @@ -0,0 +1,26 @@ +#!/bin/sh +# +# Copyright (c) Siemens AG, 2024 +# +# Authors: +# Jan Kiszka +# +# SPDX-License-Identifier: MIT +# + +set -e + +prereqs() +{ + echo "${SCRIPT_PREREQ}" +} + +case $1 in +prereqs) + prereqs + exit 0 + ;; +esac + +. /scripts/functions + diff --git a/meta/recipes-initramfs/initramfs-hook/hook.inc b/meta/recipes-initramfs/initramfs-hook/hook.inc new file mode 100644 index 00000000..c80b781d --- /dev/null +++ b/meta/recipes-initramfs/initramfs-hook/hook.inc @@ -0,0 +1,81 @@ +# +# Copyright (c) Siemens AG, 2024 +# +# Authors: +# Jan Kiszka +# +# SPDX-License-Identifier: MIT +# + +FILESPATH:append := ":${FILE_DIRNAME}/files" + +inherit dpkg-raw + +SRC_URI = " \ + file://hook-header.tmpl \ + file://script-header.tmpl" + +TEMPLATE_FILES = " \ + hook-header.tmpl \ + script-header.tmpl" + +TEMPLATE_VARS:append = " \ + HOOK_PREREQ \ + HOOK_ADD_MODULES \ + HOOK_COPY_EXECS \ + SCRIPT_PREREQ" + +HOOK_PREREQ ?= "" +HOOK_ADD_MODULES ?= "" +HOOK_COPY_EXECS ?= "" +SCRIPT_PREREQ ?= "" + +DEBIAN_DEPENDS = "initramfs-tools" + +def get_initramfs_hook_name(d): + name = d.getVar('BPN') + if name.startswith("initramfs-"): + name = name[10:] + if name.endswith("-hook"): + name = name[:-5] + return name + +INITRAMFS_HOOK_NAME ?= "${@get_initramfs_hook_name(d)}" + +do_install() { + if [ -f "${WORKDIR}/hook" ] || [ -n "${HOOK_COPY_EXECS}" ] || \ + [ -n "${HOOK_ADD_MODULES}" ]; then + rm -rf "${D}/usr/share/initramfs-tools/hooks" + install -d -m 0755 "${D}/usr/share/initramfs-tools/hooks" + + install -m 0755 "${WORKDIR}/hook-header" \ + "${D}/usr/share/initramfs-tools/hooks/${INITRAMFS_HOOK_NAME}" + if [ -f "${WORKDIR}/hook" ]; then + cat "${WORKDIR}/hook" >> \ + "${D}/usr/share/initramfs-tools/hooks/${INITRAMFS_HOOK_NAME}" + else + echo "exit 0" >> \ + "${D}/usr/share/initramfs-tools/hooks/${INITRAMFS_HOOK_NAME}" + fi + fi + + for script in init-top init-premount local-top nfs-top local-block \ + local-premount nfs-premount local-bottom nfs-bottom \ + init-bottom; do + if [ ! -f "${WORKDIR}/$script" ] && [ ! -f "${WORKDIR}/${script}-complete" ]; then + continue + fi + + rm -rf "${D}/usr/share/initramfs-tools/scripts/$script" + install -d -m 0755 "${D}/usr/share/initramfs-tools/scripts/$script" + if [ -f "${WORKDIR}/${script}" ]; then + install -m 0755 "${WORKDIR}/script-header" \ + "${D}/usr/share/initramfs-tools/scripts/$script/${INITRAMFS_HOOK_NAME}" + cat "${WORKDIR}/$script" >> \ + "${D}/usr/share/initramfs-tools/scripts/$script/${INITRAMFS_HOOK_NAME}" + else + install -m 0755 "${WORKDIR}/${script}-complete" \ + "${D}/usr/share/initramfs-tools/scripts/$script/${INITRAMFS_HOOK_NAME}" + fi + done +} From patchwork Wed Nov 20 17:02:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 3950 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Wed, 20 Nov 2024 18:03:13 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-oa1-f64.google.com (mail-oa1-f64.google.com [209.85.160.64]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AKH3BWS006891 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 20 Nov 2024 18:03:11 +0100 Received: by mail-oa1-f64.google.com with SMTP id 586e51a60fabf-29683b5dc58sf5017fac.2 for ; Wed, 20 Nov 2024 09:03:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1732122185; cv=pass; d=google.com; s=arc-20240605; b=N8+nPs0aKTwCNdSQ18iQbwu1zj/TkuucQoykGBaxfWiM1N3R/nbDr89RyX3+PlWrkh DAoab2kjIdk4TGiY05oTB8hT98IWeR/SxeVgEto5WmZmZRWh5Aw1j1sUDqvaw5Cyw+II sTs0CPzUMiWu1p3cmRQMTB+jJrW64YtYQl7hQ1edtcQ4//abxXmBPg4clUP2L5VedjAh qm5din+N6Qc78jAIkMi4By875ZcDsYn1QRywrY1AeWnVuVu5boN+d4GVLICNToOAr0fo MaB+Z7N7tFiaFlh+A/26t0dZjZEt64/pWlfBRy/GqFpTyQUhn36vSyX9IgyAs9tY3b6V /hLw== 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=CQ752KkHo7czABHpD7P26TBcdh7fW3ep8nqsK6ACXbs=; fh=oHdgX+p0AvLCkrKJuDkye3YV+QSMizlRymSRQ2Zdm3U=; b=Q1y13iHj5SyNTazmljui/1IBDToGaxLLCarYMoD6ZC9RS9B5RrCvT3RPzuZDeoylVD i2wiaSBxeLUEdWDnKzrblJDdxYe5sy+WSHBJ5ensM415B4USDIKJ53yD2+sEItNr8HSs SKZZrFjK5FDGkV9jBhqUyJByDj8Yi8McN5Azu7PvnHhMaFGzmwcBcBxuszdOBvsXxViI R5pJ+eh8Uwm4demOs/UmEHA987Spi606fLgulqdf11mSBX53FnxFHO6qakLyDBXy3mD/ YUAPFBUi602Pelp+kMJLhu3eXMm0kS2U7SqC/w83icUT4sOKe6lJokRwnNiYOQfGVFbc 3V1g==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b="Ny/Q4+7n"; spf=pass (google.com: domain of fm-294854-20241120170302413b85933058203d75-t399yn@rts-flowmailer.siemens.com designates 185.136.64.225 as permitted sender) smtp.mailfrom=fm-294854-20241120170302413b85933058203d75-t399Yn@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=1732122185; x=1732726985; 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:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=CQ752KkHo7czABHpD7P26TBcdh7fW3ep8nqsK6ACXbs=; b=dA/XwpUkZR/jYAGwK7EoI7oZF9tM2iYjtzuHFnMro5vnWcTjL8wrsHc4I0hMsMdZ0u nZ2v1lYi9r8MQlrYoFWzpVpc1zcZB4QRFQus/Ud/6zNex5LrfUVx9VB6WtG5II/0Uy+b FsETjZEjqGyAAE3BR+ZXCDdRIik9n1HV8m8pu/oVtbxqjKllzVtnFzKcP6P86uWLb/4T rvuCuODeiwvEolUvGh5ACzaP27xRWXFbBbg049lAFf/JQtndLMv54Qozl7EX9crC1a27 wSHwRucyTinwZvAs6nnVitN5U4d5Wk40kfHudc1Idg2NCXu5TqjwLoFg4/OF7BHZo+jP dYMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732122185; x=1732726985; 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=CQ752KkHo7czABHpD7P26TBcdh7fW3ep8nqsK6ACXbs=; b=KR2deGwXhbZR1gDfCsFcykT4r+jYyYg335DLOwqQLSN/t4ol7HlXtW5K9VBF9q1mz+ J+R4DdU+iEPTadhjsQ52EcktWKnUwGQF8Tmp0fyUQyWXbJpRmxNUVUQBdZlo31liLpb8 czGrSsFlAmF9Sydzd00HrF4X5uozzSV1rM6v5iewaOz/dLUKSErISMETIYe31zTzBb6S 0J6X/YtMl/XftRG3iGildRqNA537NGGR1eTA3RKBeukleuhYDXAb69mBwZD6unQLJ+56 W4w5NgsSdOLFJ8Ai1+7Tuk+oLZt0v3tgGYSdLOMgIXrebShE/XDZCuXfiCExDRfsVb5x ulDQ== X-Forwarded-Encrypted: i=2; AJvYcCWUZQKgBT09x/8t/cDTvf95/VWe4hwHCLHkPFVvT3h/oZXqRvo7M7yviVDVPCinoLbPJkzJ22I=@isar-build.org X-Gm-Message-State: AOJu0YwYCTO8qNdrbnbERvQlBACNIC+Q9QOBZQI8sPOdyonvLusEZF4H 89qw63SMyhYn/x2jL7gWrsStXe7Ctqnb9MoIOSAhoAptd+dtFMsF X-Google-Smtp-Source: AGHT+IFM4PzV74mbJLJR2q768fCn7t0AOXu73Mj/8QGsgS2GYqlSoHIOMm7ZO6y3/3bqjhmFY5z12A== X-Received: by 2002:a05:6870:9898:b0:296:e0f7:d690 with SMTP id 586e51a60fabf-296e0f7d91fmr2196967fac.3.1732122185484; Wed, 20 Nov 2024 09:03:05 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6870:aa87:b0:288:5cb4:680 with SMTP id 586e51a60fabf-296fcbf8280ls23470fac.1.-pod-prod-07-us; Wed, 20 Nov 2024 09:03:04 -0800 (PST) X-Received: by 2002:a05:6870:20a:b0:296:cdee:f7de with SMTP id 586e51a60fabf-296d9c025a2mr3086592fac.21.1732122184421; Wed, 20 Nov 2024 09:03:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1732122184; cv=none; d=google.com; s=arc-20240605; b=Lkuv3mLFKVMzQ2LHaCCPProaZsYzXV9VAcomnigk+53vBFJ4kJla2WZknFEaochoP/ /UmXOLES6p4NLJeOE5MuZCrBUXvCKyE2JpDf9Ya8dZtJa/xTfxxqu7J9eC8rPsPQJSmq eQUw4FmaFtiKcmwyqHNrmuG+7Eby/jAm/VJu6kMWsoR/4Kg+SM+ZgNyE1fJ6pvjsKIsn ljD0QNANCbVZTHvu3XwfmTdtZrhVc/2wDCLFuocXR4MH04+aWlAWriX/yLmJKRYEFLg3 Qt3yT2sOJPuWVe+5dNOJvQ8Q6AshdDrVwo+trKY33+H8DTCnSSsYSdNS237SQgjgM3lP MCKQ== 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=QQMS82QvwYSc+U6k/DHJN8/W8srN8wb3/sW85AmsiYo=; fh=TWGwN84gUgHIe5O4CbyH9KISyeWwGbvUX7cnJPxVD70=; b=QFtNKkZO479liJlWwk3NWvIo8M9cWWU8qeLbSudH0ghH+7QODWQCdgG79clJGz+6a0 3W7Mf3Eo8/VjOfXfLwNlw1ZA4VBiivbdMk2wptTVai9AcWwqpqGScFxE+RSKLPFMaUFC 46L/dU5ORJFlBTVGg7TuTZrXMlhvegXUNIT0TI/rMSCPqsR8QbkI6d1aubuHWumDk6Hb 7MzvhvewiJpZNVVOxgE9kf5KeecY4VLJaRn6rkNUxnE5B16PcGRqnKSzD1oKgP37a8fA jj5brs+lCn4twM/taAa87rV/Ah4SI5LgnXKdUEGxPpBNfZfHdFFByqahkBomfXVOxtaO 2jRw==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b="Ny/Q4+7n"; spf=pass (google.com: domain of fm-294854-20241120170302413b85933058203d75-t399yn@rts-flowmailer.siemens.com designates 185.136.64.225 as permitted sender) smtp.mailfrom=fm-294854-20241120170302413b85933058203d75-t399Yn@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 586e51a60fabf-29651a04bd8si460913fac.1.2024.11.20.09.03.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Nov 2024 09:03:04 -0800 (PST) Received-SPF: pass (google.com: domain of fm-294854-20241120170302413b85933058203d75-t399yn@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 20241120170302413b85933058203d75 for ; Wed, 20 Nov 2024 18:03:02 +0100 X-Patchwork-Original-From: "'Jan Kiszka' via isar-users" From: Jan Kiszka To: isar-users Cc: Quirin Gylstorff Subject: [PATCH v5 2/7] doc: Describe initramfs customizations Date: Wed, 20 Nov 2024 18:02:56 +0100 Message-ID: <3e9a467f3d939ff03091b5fcd0ceca54c6fdceb5.1732122181.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=fm2 header.b="Ny/Q4+7n"; spf=pass (google.com: domain of fm-294854-20241120170302413b85933058203d75-t399yn@rts-flowmailer.siemens.com designates 185.136.64.225 as permitted sender) smtp.mailfrom=fm-294854-20241120170302413b85933058203d75-t399Yn@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 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: Jan Kiszka Document to new hook.inc as well as the preexisting initramfs class. Signed-off-by: Jan Kiszka --- doc/user_manual.md | 58 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/doc/user_manual.md b/doc/user_manual.md index 8f745214..1e505c66 100644 --- a/doc/user_manual.md +++ b/doc/user_manual.md @@ -1611,3 +1611,61 @@ 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(s). + +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`. +If you do not benefit from the script header with its static `SCRIPT_PREREQ`, +you may instead provide `init-top-complete`, `init-premount-complete` etc. to +still use automatic installation while defining the boot script completely +yourself. + +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. From patchwork Wed Nov 20 17:02:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 3951 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Wed, 20 Nov 2024 18:03:14 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-oa1-f60.google.com (mail-oa1-f60.google.com [209.85.160.60]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AKH3Cd2006911 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 20 Nov 2024 18:03:13 +0100 Received: by mail-oa1-f60.google.com with SMTP id 586e51a60fabf-2964720a511sf5883fac.3 for ; Wed, 20 Nov 2024 09:03:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1732122185; cv=pass; d=google.com; s=arc-20240605; b=ld7T+TXRRM+Mdq/CsYvP+UUBM/hFHV60M5piMAaFZ32bb4jWauShMXVpf/rsqqor18 eo7g9YVA00U7wZQbL9AOK7fxAPNiIAI4Ky/hLnP3wkEFv3/EG0jmjsvxBJQ5zZS4gtU1 SZoZsp7Eoy0KsGXMAwIGdEUQYjJzKlJSmUzEiqI8SRb2AdbYU9wySTbKrgM+blzuQ7+4 TTP1XAWcWzOrA1VAKQQQNpK8d35iuHbEk42T2iLFEP7fF8r/VFk+KMTocdtGNVxdlHWj Js2XigiciVAaC91fycRWbSNUGKG4mmczlo8lkl0qKqJvlSa1+k4OLiGhs+bI4I9fnPMR 1ckA== 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=yXl1Bo3CIbW33m/6LE49vtUx0p7gAaVSPsnb6x2ZU0Y=; fh=u++wxdn2GklhpswHb1u2mEYC7AiJ5tcjTkhAzqk7LGA=; b=EMGr4Z4ybBZj8xVNsYv404vDX+ieaFvWPqAU/4ottu8LZ8exDzYrYbl21wGumQ4w7o KEHgVR4mDaOC6u79jYncGe4spbTV52is+CSnfCYHjhEB9Rk3Vle9C67ilbfkkgzAJ1nK skkNaVgGanvtU4egoi7BwsVetTaSMNkjiRETlPSRM7UuZ6luJSjGxYvbulH7x188O7rf vGc7H5r+FKFn5B9NKX/i5m8sVhUcEzng+r0EGs1OKkSkZpXodqt4EIupl/R2idXvDZS/ w4JWL9HyW3J02povyoHQZ8mInHrPyBLhZ2y7YKGK3pVBmtWRMjpNo4vN42nMsBXrnvRe r2Yw==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=i9wbFDXH; spf=pass (google.com: domain of fm-294854-20241120170302dd1540d0693787fb4c-swqsve@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-294854-20241120170302dd1540d0693787fb4c-sWqsvE@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=1732122185; x=1732726985; 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:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=yXl1Bo3CIbW33m/6LE49vtUx0p7gAaVSPsnb6x2ZU0Y=; b=OPlGc/ytwtb4golvFas1jEzcXQl1e//3bwfc/Bg4AcNXZlfaCnUujcRdK+KtrPW8jl VA2bJEF9HpkmpB/uTAD/hTKs5C8qx1umNyW9vKdkbfHEBIb6fAEF8KlXV0xph9fVNjJD Q4ijetZ+sVpPwn1UIrcWeJMvu7QoJO/D2i0WXyFeSkIq5iFyTGGMrsPOf/QxlNDgMCW7 JLekRH9qnirDVWU1TZI6pdAylysQNx2xmXqBB+jb/elV0E4HUS2gt0r2V09mcbVwnCKh j8zorlcSxFOnC6xPliQuSKyfM3fPaFcyPiqUm0+m5KVq3uzxTPoJ95wGxVSAhOZ4MLBx iEbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732122185; x=1732726985; 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=yXl1Bo3CIbW33m/6LE49vtUx0p7gAaVSPsnb6x2ZU0Y=; b=uDT8yX8zZMsH8WxEQQpoOjWoRRmSApJVngKDCBtDzhKJbWB71SNcRvc9FQYShrpy23 hlOkk5eusmtRBX9BINaMtfyvTLv2c+zimZWcKgvsmU2JIUKJeLqLBkT6ZPpDOp65yXKv taKJ/sjlkQm85caLqMY2GZ98806LfntpnfVK//UeRLsA9piINYhLdxNFHkEJXFUsfKd/ PHiB9RY3GgmY+D64Va294JVE+et0fEz/RYyLR7UdCk1VY4I7MmgMWwXGrH9XPESTvr77 IrL118xtKuz2n8E3QIuXjkz1u8mrB5pqYNSuwDDiDTb5m9x8bgWO8+uW0tACs8fScEHQ gSfg== X-Forwarded-Encrypted: i=2; AJvYcCUi+qvdek9VCX6dX4k1+UMsA9+g4US8WEuCcrUKmZ30Lr+YptK2uaVyYc/RAUAIARb0uSAd+Vs=@isar-build.org X-Gm-Message-State: AOJu0Yw8YiSljutmsdIMina/b0C6dzC8WJsyOReGXKI4fKh2ObZ7dKbx Bvglbw19vLsUdnwhJQ0LIptfZl5HTv1SuQiQCYZJQr95DnaxQwzn X-Google-Smtp-Source: AGHT+IFR409f8m4Ug1TGrKAA8wR2t1A1TnhOEO7nSKkoGgWv8BRrHRt3WtkXNTx38QCMoMeprcr32A== X-Received: by 2002:a05:6870:d2a7:b0:296:e491:b244 with SMTP id 586e51a60fabf-296e491b61dmr1945560fac.32.1732122185558; Wed, 20 Nov 2024 09:03:05 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6870:4949:b0:26f:e0d3:95d4 with SMTP id 586e51a60fabf-296fc567830ls74356fac.0.-pod-prod-05-us; Wed, 20 Nov 2024 09:03:04 -0800 (PST) X-Received: by 2002:a05:6871:e493:b0:294:cac8:c780 with SMTP id 586e51a60fabf-296d9ae0812mr4001869fac.6.1732122184724; Wed, 20 Nov 2024 09:03:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1732122184; cv=none; d=google.com; s=arc-20240605; b=JWmpC9uu15t7ae0pocm1/aRoU8ToIjh85T4mDX1GiU4d9zzyGCEGfxMKytaisJHjEs YptViUyvThBVfaPJMzMuJwW6EyaaDrkyOfL6gB5DuWzSiguZ/bxbhsW0Fk2ANW6ENhR1 ayuZFLY3z5ZOKqKf8taw9iKVHCwguJOywOwMyU8fY68xWRL7VvOftrR3/lAy90EIXoIi nziCScvfE+LvBu13xHJBOiLSNqHAXBDWoJC4GvlBx1NfkWnwJGzRIp0/E5mz2Y/3NH9j XDM9pmgLfUHsH8u8AM8sUY72Wt3/5pmLqzM/XV50NYrF4d9q4ZlkiSeWjh0ne2/G9O71 O+rw== 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=hd+Ra0mXFjq5wVHelyhO/fJKkwklcL3HIN/UivOBJwM=; fh=TWGwN84gUgHIe5O4CbyH9KISyeWwGbvUX7cnJPxVD70=; b=kVGjtghVfwRm3mOC0Gy8MiVu5G56IlC0HrxYdL0o1utqKHeT+W7XQV13IaReGLaRf4 OpbTY2swC36XXUIfXmzMPzB0yBWBNBUXU2TV8/RKaUr+3Cc795HpZjnh7St8cFR6CuIv XMXZskdw5YupKFUo4WKEhPvYsOq5FD4h/lg3dzPzz/PuqEh9fP92snZfjPVQ1PT9jwjr xvuzYRp86OnYLQ6A6Qm9F0B0fX57XQ/TzYpZVuYoCq84Z4bn5k7/fl48IOe/Kw6PFQ4L 883wlaUjZPrFPO+zi6bEuGQLxnN5gj7nuqfgmT3CuNJuVl42iZ37lcgAuDzolUhajL41 4BOw==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=i9wbFDXH; spf=pass (google.com: domain of fm-294854-20241120170302dd1540d0693787fb4c-swqsve@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-294854-20241120170302dd1540d0693787fb4c-sWqsvE@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-65-227.siemens.flowmailer.net (mta-65-227.siemens.flowmailer.net. [185.136.65.227]) by gmr-mx.google.com with ESMTPS id 586e51a60fabf-29651e6f0bcsi403931fac.5.2024.11.20.09.03.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Nov 2024 09:03:04 -0800 (PST) Received-SPF: pass (google.com: domain of fm-294854-20241120170302dd1540d0693787fb4c-swqsve@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) client-ip=185.136.65.227; Received: by mta-65-227.siemens.flowmailer.net with ESMTPSA id 20241120170302dd1540d0693787fb4c for ; Wed, 20 Nov 2024 18:03:02 +0100 X-Patchwork-Original-From: "'Jan Kiszka' via isar-users" From: Jan Kiszka To: isar-users Cc: Quirin Gylstorff Subject: [PATCH v5 3/7] isar-initramfs: Add initramfs-fsck-hook-ext4 Date: Wed, 20 Nov 2024 18:02:57 +0100 Message-ID: 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=fm2 header.b=i9wbFDXH; spf=pass (google.com: domain of fm-294854-20241120170302dd1540d0693787fb4c-swqsve@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-294854-20241120170302dd1540d0693787fb4c-sWqsvE@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 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_H3,RCVD_IN_MSPIKE_WL, 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: Jan Kiszka Ensure basic CI coverage for this hook recipe. Signed-off-by: Jan Kiszka --- meta-isar/recipes-initramfs/images/isar-initramfs.bb | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-isar/recipes-initramfs/images/isar-initramfs.bb b/meta-isar/recipes-initramfs/images/isar-initramfs.bb index aaa0350a..4df9e0b8 100644 --- a/meta-isar/recipes-initramfs/images/isar-initramfs.bb +++ b/meta-isar/recipes-initramfs/images/isar-initramfs.bb @@ -15,4 +15,5 @@ INITRAMFS_PREINSTALL += " \ # Recipes that should be installed into the initramfs build rootfs. INITRAMFS_INSTALL += " \ initramfs-example \ + initramfs-fsck-hook-ext4 \ " From patchwork Wed Nov 20 17:02:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 3954 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Wed, 20 Nov 2024 18:03:15 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-il1-f185.google.com (mail-il1-f185.google.com [209.85.166.185]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AKH3Dtk006936 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 20 Nov 2024 18:03:14 +0100 Received: by mail-il1-f185.google.com with SMTP id e9e14a558f8ab-3a7776959fdsf26504825ab.1 for ; Wed, 20 Nov 2024 09:03:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1732122188; cv=pass; d=google.com; s=arc-20240605; b=kVsPOj3mBI/zAhQuZHN9P0kJ4oNGBc8WrR6fSrGOsuLwF/jawkU0wWlHPzbhoTLFgb TNiyj3d5d16DLTg8hGsN+BRZX1aW1YrIBzlenV3zgaEmsQLbfPYwrapwKFLMu/r79ZiO pTPmTcc934yEHrLQBws2v8q60SXzzGY3D04daSI2uaL9K2B5soM7afFj0RuGBb51zJOm ZvU8XxJt1XOPlJcaWlyst1fgpwShFzNsaok6sjxVSNsZJYVN5/6kfGwsqa6Zl95MJuH0 6RWTz0+TaCfNKKM7S4KdhP0juqm7EwwfCjBwhtXNusqQssC0VkFsFDvQVeBnTUXN4aFd dNaQ== 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=Y+dDoFa9xPv7fsejXBaHlS3IwQCec6S8LXz92KTVHtI=; fh=ZW+vM47bX0o4nJGs5Iri0Y4MVKlqfWZRkz18FX7u4fs=; b=Q1ccyPNK+M9WrIDSSGKyK3/UVFTUwwNhpvfyU+S1W9ry3bU+Hj+MtdGumHOzj9pnFI y3C9IpTDiFJYU3rAaemnMhJkU6BcajJ1UKug8SU1IZHMvfqJg/t3CfM1MvrixnMy8q6j pHK7Af+2xA2TRYSc9ZS7DZzE8AYuY55Nu4rd6HHA3FXuN2NIXC4HmxAETwbWJeN2h+0P mmDXw6QMALETcGEetJX8f+twP/OnrglGG/7CZ7RqfMRLC9P5xmGJ6NEDkMWNkC8XWiRv P9yznQapjqxBuFLZnBed6u2PjaK3GzlslFVKHUZ/Q+iG9H8VJPG/7zpaLZhKTZAhqoLa q/BA==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=S2gITWUH; spf=pass (google.com: domain of fm-294854-202411201703029c1639590a1bcd864a-g3cphj@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-294854-202411201703029c1639590a1bcd864a-G3Cphj@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=1732122188; x=1732726988; 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:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=Y+dDoFa9xPv7fsejXBaHlS3IwQCec6S8LXz92KTVHtI=; b=eG9SgZxOm3FbgqJFru8JUpupgqv0ErSeFaPXy5dF5oRljm83tQ90UvQrMlXuNRv/gV KLFE7mQNVCJLQHjQ9exWxc3dy/ggEoAVPlbkJDmgpwnsDtLL7mZ/jFp0Qvc99yXTgFT8 E53jGoYqBp2l+2WGA1eh6SY5Amlr91xTsqh8KGrDliQKgCQ9kbvmSQ+7o2C9RXkwLTOJ IDxu6o3Odwf0A8EmJ6uBlQ4T47CFI3sv8caPbl4eCYUXMFItqMLZfqPuwKSDRIWZskAO 8wesJQOU6vCRb1EZ7A4PxaYQAQNO8WRCIYEoVBbupH8FVyQxf0sVwV2ZHd16IiISd6Pu 0+cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732122188; x=1732726988; 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=Y+dDoFa9xPv7fsejXBaHlS3IwQCec6S8LXz92KTVHtI=; b=vPvKGSWjOOGG9WpZwGGy8JMMeHis5zRdVsL0CTSg/5WU5oVIxiP0poWhX+bSwVIOsb CIabClQMZexAoUq/j+8EntMafoHGXzw4Ul4G0ypvry+VOhhJpA0DCB/QA8BZBAoyeekk 1QVfFyFbtnqw8HLBUEPcuR3ygSEdLblRW84XvLA/fDB06wz4CKoFrsj7I7+cSZuY9/rj kOk78xyG++GQN/OuNhhSt24ibJfzF9YrUh+zDLzG6jL3hDI1Erfb00pSldQj32f46Zh/ 5Zgp2JsNEDqs/rgA7Cwlq/6DaD+ymkNkUHer+lY0iegAldK7a42k9tYTGbZfhwmy0juM T+1w== X-Forwarded-Encrypted: i=2; AJvYcCUEASX6IpsA1gLjj0oJLrl1CPAnVY2kyu2Gk7iaoMCGDJVW1TwwOel20YvCJYfOEHacgc1fvpE=@isar-build.org X-Gm-Message-State: AOJu0Yy7Dix2SIoRXYD00TBDEu66xiRj0S9A1AP7uzNB5ZnZx0DHjk3S CMN6WuQapO7wjyv8FMpIk5y1xCZAiOKc9X1F98zRGOzyzxpA4qjZ X-Google-Smtp-Source: AGHT+IEhex771+1hYKrYC3cX/5njdWQh/FWxQLyVZOBEWRteGYaJBwpK44xVJ8jphKeGrjsYsZoBSw== X-Received: by 2002:a05:6e02:1c22:b0:3a7:8ff2:2849 with SMTP id e9e14a558f8ab-3a78ff228abmr2544535ab.10.1732122188128; Wed, 20 Nov 2024 09:03:08 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6e02:3093:b0:3a7:1f66:5837 with SMTP id e9e14a558f8ab-3a7903c44c2ls54835ab.2.-pod-prod-02-us; Wed, 20 Nov 2024 09:03:05 -0800 (PST) X-Received: by 2002:a05:6602:2d83:b0:83a:95fc:b242 with SMTP id ca18e2360f4ac-83eb5fefbc6mr350378439f.7.1732122184830; Wed, 20 Nov 2024 09:03:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1732122184; cv=none; d=google.com; s=arc-20240605; b=kRTboGuMpvDboRtNMV2dZoejPnlsqzYVCGW4ZTKmhzqWBTUOhu3h3WoPdJjDx81AIm fmoKNgyGMuQkAxvxpdE4TdLyNoW39CAOANIBMh2feWRXU0mLPHrCo6pqG2IuWCCSpFFf luc/mQ22uvmUqGOs7dAQKnhU5VIhZkXiyFxmvA8porrX2UaD00ghCi1oMI6LdaMkITpN 4AOoYZSKeEgcd4zqNrAlIel3mvxB3dUJHKWQFNCzLTXXNg2sBdGJ00b+yOxEfCGOFZQ+ knK6Q2cDzkvvGCafGW8R96ug6agDVpesnqIx2Y6N9npQCqjiyuJEJT6CpIFCZ2pEf8L5 4rjg== 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=3NmuJ+CYB4NjLAWvkKRcIcbaRDM33YIGEP1V/+MRMTE=; fh=TWGwN84gUgHIe5O4CbyH9KISyeWwGbvUX7cnJPxVD70=; b=XYPMEJ6ctB2tE56HftF0WEJZ/IJJ/mr/T6f7gVSZaxUw2+iSHQqTYSgFGIzqCdW6lh q7qkSMhP/M9k5bTfI6jwNMoHrWCsWHNqMUaX/DqyjHYnRhd5bkgO3VSTqVWztmIj4RWJ 4NNPyKP5dqitLG1be6woGD+Dw2Eki1p5RLwfbAImy+feQWQ0gYE/iukpO9AD61K7cU+G syWQmvFiuPUPV/XjGFOuGHOBUTeJgIyb8SxcVgCQZwfn9+OPO13CJOR6bmsyacQOuaHe wbe7RAgLHAhkpmH+yYoqzu7Sq8GfVsaYMnAazCRQOhYUy7xDbTyW65embQ5xiTuzjqE+ yOZA==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=S2gITWUH; spf=pass (google.com: domain of fm-294854-202411201703029c1639590a1bcd864a-g3cphj@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-294854-202411201703029c1639590a1bcd864a-G3Cphj@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-65-226.siemens.flowmailer.net (mta-65-226.siemens.flowmailer.net. [185.136.65.226]) by gmr-mx.google.com with ESMTPS id ca18e2360f4ac-83e6e12036bsi49320039f.4.2024.11.20.09.03.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Nov 2024 09:03:04 -0800 (PST) Received-SPF: pass (google.com: domain of fm-294854-202411201703029c1639590a1bcd864a-g3cphj@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) client-ip=185.136.65.226; Received: by mta-65-226.siemens.flowmailer.net with ESMTPSA id 202411201703029c1639590a1bcd864a for ; Wed, 20 Nov 2024 18:03:03 +0100 X-Patchwork-Original-From: "'Jan Kiszka' via isar-users" From: Jan Kiszka To: isar-users Cc: Quirin Gylstorff Subject: [PATCH v5 4/7] initramfs-isar-example-hook: Convert recipe over to new hook.inc Date: Wed, 20 Nov 2024 18:02:58 +0100 Message-ID: <6c191d6604638d20238be879ed546176bc3d040f.1732122181.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=fm2 header.b=S2gITWUH; spf=pass (google.com: domain of fm-294854-202411201703029c1639590a1bcd864a-g3cphj@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-294854-202411201703029c1639590a1bcd864a-G3Cphj@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 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: Jan Kiszka Allows to drop the own hook recipe and makes the local-top boot script effectively a one-liner. Signed-off-by: Jan Kiszka --- .../images/isar-initramfs.bb | 2 +- .../initramfs-example/files/example.hook | 21 ----------------- .../initramfs-example/files/example.script | 23 ------------------- .../initramfs-example/files/local-top | 3 +++ ....bb => initramfs-isar-example-hook_0.1.bb} | 21 ++++++----------- 5 files changed, 11 insertions(+), 59 deletions(-) delete mode 100644 meta-isar/recipes-initramfs/initramfs-example/files/example.hook delete mode 100644 meta-isar/recipes-initramfs/initramfs-example/files/example.script create mode 100644 meta-isar/recipes-initramfs/initramfs-example/files/local-top rename meta-isar/recipes-initramfs/initramfs-example/{initramfs-example.bb => initramfs-isar-example-hook_0.1.bb} (63%) diff --git a/meta-isar/recipes-initramfs/images/isar-initramfs.bb b/meta-isar/recipes-initramfs/images/isar-initramfs.bb index 4df9e0b8..71dbaa43 100644 --- a/meta-isar/recipes-initramfs/images/isar-initramfs.bb +++ b/meta-isar/recipes-initramfs/images/isar-initramfs.bb @@ -14,6 +14,6 @@ INITRAMFS_PREINSTALL += " \ # Recipes that should be installed into the initramfs build rootfs. INITRAMFS_INSTALL += " \ - initramfs-example \ + initramfs-isar-example-hook \ initramfs-fsck-hook-ext4 \ " diff --git a/meta-isar/recipes-initramfs/initramfs-example/files/example.hook b/meta-isar/recipes-initramfs/initramfs-example/files/example.hook deleted file mode 100644 index ba848c92..00000000 --- a/meta-isar/recipes-initramfs/initramfs-example/files/example.hook +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -# Example hook script. -# -# See "HOOK SCRIPTS" in initramfs-tools(7) for details. - -set -e - -PREREQ="" -prereqs() -{ - echo "$PREREQ" -} -case $1 in -prereqs) - prereqs - exit 0 - ;; -esac - -. /usr/share/initramfs-tools/hook-functions -# Begin real processing below this line diff --git a/meta-isar/recipes-initramfs/initramfs-example/files/example.script b/meta-isar/recipes-initramfs/initramfs-example/files/example.script deleted file mode 100644 index c55e9ea7..00000000 --- a/meta-isar/recipes-initramfs/initramfs-example/files/example.script +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# Example boot script. -# -# See "BOOT SCRIPTS" in initramfs-tools(7) for details. - -set -e - -PREREQ="" -prereqs() -{ - echo "$PREREQ" -} -case $1 in -prereqs) - prereqs - exit 0 - ;; -esac - -. /scripts/functions -# Begin real processing below this line - -log_success_msg "Hello from ISAR!" diff --git a/meta-isar/recipes-initramfs/initramfs-example/files/local-top b/meta-isar/recipes-initramfs/initramfs-example/files/local-top new file mode 100644 index 00000000..66e382b4 --- /dev/null +++ b/meta-isar/recipes-initramfs/initramfs-example/files/local-top @@ -0,0 +1,3 @@ +# Script header is provided by initramfs-hook/hook.inc + +log_success_msg "Hello from ISAR!" diff --git a/meta-isar/recipes-initramfs/initramfs-example/initramfs-example.bb b/meta-isar/recipes-initramfs/initramfs-example/initramfs-isar-example-hook_0.1.bb similarity index 63% rename from meta-isar/recipes-initramfs/initramfs-example/initramfs-example.bb rename to meta-isar/recipes-initramfs/initramfs-example/initramfs-isar-example-hook_0.1.bb index c336dda9..8c600639 100644 --- a/meta-isar/recipes-initramfs/initramfs-example/initramfs-example.bb +++ b/meta-isar/recipes-initramfs/initramfs-example/initramfs-isar-example-hook_0.1.bb @@ -4,37 +4,30 @@ # # This software is a part of ISAR. +require recipes-initramfs/initramfs-hook/hook.inc + DESCRIPTION = "Sample initramfs module for ISAR" MAINTAINER = "Your name here " -DEBIAN_DEPENDS = "initramfs-tools" # If the conf-hook enables BUSYBOX=y, busybox is needed: DEBIAN_DEPENDS .= ", busybox" -SRC_URI = " \ +SRC_URI += " \ file://example.conf-hook \ - file://example.hook \ - file://example.script \ + file://local-top \ " -inherit dpkg-raw - do_install[cleandirs] += " \ ${D}/usr/share/initramfs-tools/conf-hooks.d \ - ${D}/usr/share/initramfs-tools/hooks \ - ${D}/usr/share/initramfs-tools/scripts/local-top \ " -do_install() { +do_install:append() { # See "CONFIGURATION HOOK SCRIPTS" in initramfs-tools(7) for details. install "${WORKDIR}/example.conf-hook" \ "${D}/usr/share/initramfs-tools/conf-hooks.d/isar-example" - # See "HOOK SCRIPTS" in initramfs-tools(7) for details. - install "${WORKDIR}/example.hook" \ - "${D}/usr/share/initramfs-tools/hooks/isar-example" + # See "HOOK SCRIPTS" in initramfs-tools(7) for details on + # hook-header[.tmpl] + hook. # Note that there are other places where a boot script might be deployed to, # apart from local-top. See "BOOT SCRIPTS" in initramfs-tools(7) for details. - install "${WORKDIR}/example.script" \ - "${D}/usr/share/initramfs-tools/scripts/local-top/example.script" } From patchwork Wed Nov 20 17:02:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 3953 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Wed, 20 Nov 2024 18:03:15 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-oo1-f56.google.com (mail-oo1-f56.google.com [209.85.161.56]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AKH3Dmj006929 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 20 Nov 2024 18:03:14 +0100 Received: by mail-oo1-f56.google.com with SMTP id 006d021491bc7-5eb9fe126f8sf1603942eaf.1 for ; Wed, 20 Nov 2024 09:03:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1732122186; cv=pass; d=google.com; s=arc-20240605; b=ZQ/2mjcaykF4/25/uDtPiwHCjS84STTwVV/uV+xCmOsq5Zjc9/b57Th1Kjs2bAt71V qEErFRNDMFCezWzlXhoGg+zJD5sc0iqknNoclQdRI37s9P/LU6IaMl+4Z48/lncmTQ7o Arr3G1FsSDBFoGVPJU5P7iVdW7MwVLEsxhP6tnbjljSaVTdgV9iyo7zhRny9xBt3dyeV OWYidPzPtrpAK/3nWORtW3vMpVs19m4Exh9keVKBwCon1iAWHqNp3J2QQmE62lfxFlA7 FSzftMvi9QtclPxXavDQpZYnKRKHJnLSra9/ZHSgvvouh5Hndq9dyydUvXMNdYZJTToy tI1w== 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=uWp4hWE4WlKQrVketSi5gc8h/PfYFqjKm+P6AIOf3ZY=; fh=N6HMyzo8v+SUugtsXJraX+3J4r6c9XbvThyjJ39V/H8=; b=BLSvvtoJJa5AfSEDN+nrg9GZ1Ce3oFQW8BlwqXtgHdg0+bH+wjKWQk3ymzsR2XOpMS Pxt9CUFU7HHdyGGVt6jekzY8NhOwHqt4VG0rMcCygF7Cp9jfHXSt/G4iH+kVxzh1kg7I 6f1lW97ef0soIxdC8oay3mi9nU1IQSyTgN0xAxfcJwoJ+IuhxoDokiffmUDYkWvgMV0y /FdM5sviry5BsXGjwI9Xn1+o/Og+CughGfNN5x3diAH/vqRRpOL6nojowDnWyTXcNLHv ru4aWXiy8wE0osSBWD/xxJnqjeov8o0AB4fPc3n2nVA+JCZAqu9X8XehMkjXnIp3Ev3D +3oQ==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=BxT6fu0U; spf=pass (google.com: domain of fm-294854-20241120170303b12ea24870a93b0bc4-zl3qvy@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-294854-20241120170303b12ea24870a93b0bc4-zL3qVY@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=1732122186; x=1732726986; 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:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=uWp4hWE4WlKQrVketSi5gc8h/PfYFqjKm+P6AIOf3ZY=; b=PBHroaTUakTUK4oN9B36hftmEKo5UFWfCRTrvDNUtS3MNkIfIZpr4p7soW/EnnZXU3 HqgC7WQpFvA1NAIftgeFzHO5apBk/x6xx5Rnooo/WI68G+AWmPojlPN5K07OkWcDHOsV hXJQ/u+gPuT3ytXp9EiA0b2D87OHmhlJcZoV3DIg0smfd6nhC8XqrlU76bVaCyiUIYGw 5BPGp2S8KpUYwRbmz3eat06lAS9Y5eR6hRoQdd8XJ5w3GRHZkj215yGT9pCHz3x5gpiW MqRIq4okPC/x5L2Kytx7hjoH0zOF93eb7BMIc0CDoJAgtTHawf1uU3u2upiNSMPbK54m RuKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732122186; x=1732726986; 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=uWp4hWE4WlKQrVketSi5gc8h/PfYFqjKm+P6AIOf3ZY=; b=volnrC9WTVtnNVmIoqWnSqykwecfIlz008qEkclAZAyFMXkE2D3H/q2GZSOuzHfwo8 vDpiPbFNTZQBvOPkUPxwvq/96s4I3O+xfYvbdcCsKg+OiqeicSDmA4YMovhfDBXxAPKi Q4f+PFfyCmTBHlSA5XbMmIFGFAGekwgjjGu8ak055i6MTDZO2XlbNWEAmEKGSrNhOFap JUCTfiZybPTGqscCtnob8TKmPG2E2GfAy0IZ6ALsWah5zgPF96XekMwoWJ6evuKC6PDP eU5138j+hfsDmM8kAPSBwOodW7lUgV87HXhW+q1tv6po8XzzNa88XtPMBVjQ6J40w5kT j/NQ== X-Forwarded-Encrypted: i=2; AJvYcCUal5Wu+NXoqdDfBk3vF0rrcrJ+Yo5VqSubgfopE8SGevQHbVeNXa5Cp+HyguMrG3nfdKMN3ak=@isar-build.org X-Gm-Message-State: AOJu0YybVXVSEF61/M0Y3InmuV5DOnZpt4KK+uch+k+hW3C3kaVztP7i /wZ5QMgg5jEVCQsz44gSjm6ZrftCo7vyJxTb3zZNP6qCzPVS5jd9 X-Google-Smtp-Source: AGHT+IG6wVCTXk+TUbS5qrG1ftc9Tn/UzPd+E8ki0+XbJQ8IQaJzg4oJf2qWnaqNAWM4e7BW+zWSLw== X-Received: by 2002:a05:6820:4c11:b0:5ee:de1e:980e with SMTP id 006d021491bc7-5eee828fb62mr3475566eaf.7.1732122185917; Wed, 20 Nov 2024 09:03:05 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6820:2205:b0:5eb:6ac9:e863 with SMTP id 006d021491bc7-5ef3c4cb0dals20830eaf.1.-pod-prod-07-us; Wed, 20 Nov 2024 09:03:05 -0800 (PST) X-Received: by 2002:a05:6830:b82:b0:718:c7f:5cbd with SMTP id 46e09a7af769-71ab31c5d70mr4021118a34.28.1732122184969; Wed, 20 Nov 2024 09:03:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1732122184; cv=none; d=google.com; s=arc-20240605; b=UHzHrL5b1Iwp3rX4A575fiWnVDfGyunukjuxxt0HTcpV82qsQKMYXO+aJVdljv84+O D/kFIwGihrts0pglhre99/IWlEzukcJjnP3duZ4xiHnUy2w3aRYpScQXW5Zp0gQ7RiU0 RFFXD75+65IitriOlZvxHMm/xjbbPDgFCbFeRtc9mIRSrIuqbPe3dsQHMgdTr0WBHnbc YypGjtBEYkaNaW6YucDov4/kylvu2CpC6/kYJCxSMRujHP2U86imjuJtoaqMObBomuXR M7Orkgp3Hn4pN8D6cV9OP3CU1r6KfCh7sefP5uvHQuaZGZyg2V2ssaiY5Ud6dGTeOQNF C/1w== 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=1SmGJD8sNAT8lI5B4I8KeLxB2HgGvxa/go9kgLfOnLc=; fh=TWGwN84gUgHIe5O4CbyH9KISyeWwGbvUX7cnJPxVD70=; b=iKoa1SG1/fFeTdVj7vbKK5tAbzMTUKcKj4Go9xzWfP/9UTNZQYItpmQse8FhMv6ukT /m+BR0k7CCibYRfn4+iipFAYllke9mPZ59trfVj8cT8Wj/JCVnbbJOkxloZKryJg+1/R 5ltTlb9X5LQLkglRNUSImAor1fAtIlKWOZBIWCV6jDRVGnRz+Xh2bytl9oo4z8+KMeue 4tgScec03gwhJ88uyHl+KMgDwEfOOcncyUPtNWME+nQ792+Snbh09zRJWxZSi/r4Gwd5 t3mnSC/wKC1o12DMIgcDCn/qFz048eqJSO6XjIUU+Hu+aTDGEkPJnDFfeULmevXrjykY kmJw==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=BxT6fu0U; spf=pass (google.com: domain of fm-294854-20241120170303b12ea24870a93b0bc4-zl3qvy@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-294854-20241120170303b12ea24870a93b0bc4-zL3qVY@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-65-227.siemens.flowmailer.net (mta-65-227.siemens.flowmailer.net. [185.136.65.227]) by gmr-mx.google.com with ESMTPS id 46e09a7af769-71a781e7bc0si507505a34.3.2024.11.20.09.03.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Nov 2024 09:03:04 -0800 (PST) Received-SPF: pass (google.com: domain of fm-294854-20241120170303b12ea24870a93b0bc4-zl3qvy@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) client-ip=185.136.65.227; Received: by mta-65-227.siemens.flowmailer.net with ESMTPSA id 20241120170303b12ea24870a93b0bc4 for ; Wed, 20 Nov 2024 18:03:03 +0100 X-Patchwork-Original-From: "'Jan Kiszka' via isar-users" From: Jan Kiszka To: isar-users Cc: Quirin Gylstorff Subject: [PATCH v5 5/7] initramfs-fsck-ext4-hook: Convert to hook.inc and improve Date: Wed, 20 Nov 2024 18:02:59 +0100 Message-ID: <0c4bdba32d59b3e97b2962ffc7edfde9659b6ae0.1732122181.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=fm2 header.b=BxT6fu0U; spf=pass (google.com: domain of fm-294854-20241120170303b12ea24870a93b0bc4-zl3qvy@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-294854-20241120170303b12ea24870a93b0bc4-zL3qVY@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 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_H3,RCVD_IN_MSPIKE_WL, 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: Jan Kiszka Use the convention and helping features of the new initramfs hook.inc to simplify this hook. We move it under recipes-initramfs to align with other recipes there. Another change is making fsck.ext4 mandatory, both as dependency and while copying it in via the helper - there is no reason for this recipe to almost silently ignore any unavailability. Signed-off-by: Jan Kiszka --- .../images/isar-initramfs.bb | 2 +- .../files/initramfs-fsck-hook-ext4.triggers | 0 .../initramfs-fsck-ext4-hook_0.3.bb | 14 +++++++ .../files/initramfs.fsck.ext4.hook | 39 ------------------- .../initramfs-fsck-hook-ext4_0.2.bb | 18 --------- 5 files changed, 15 insertions(+), 58 deletions(-) rename meta/{recipes-support => recipes-initramfs}/initramfs-fsck-hook/files/initramfs-fsck-hook-ext4.triggers (100%) create mode 100644 meta/recipes-initramfs/initramfs-fsck-hook/initramfs-fsck-ext4-hook_0.3.bb delete mode 100644 meta/recipes-support/initramfs-fsck-hook/files/initramfs.fsck.ext4.hook delete mode 100644 meta/recipes-support/initramfs-fsck-hook/initramfs-fsck-hook-ext4_0.2.bb diff --git a/meta-isar/recipes-initramfs/images/isar-initramfs.bb b/meta-isar/recipes-initramfs/images/isar-initramfs.bb index 71dbaa43..d2a946f7 100644 --- a/meta-isar/recipes-initramfs/images/isar-initramfs.bb +++ b/meta-isar/recipes-initramfs/images/isar-initramfs.bb @@ -15,5 +15,5 @@ INITRAMFS_PREINSTALL += " \ # Recipes that should be installed into the initramfs build rootfs. INITRAMFS_INSTALL += " \ initramfs-isar-example-hook \ - initramfs-fsck-hook-ext4 \ + initramfs-fsck-ext4-hook \ " diff --git a/meta/recipes-support/initramfs-fsck-hook/files/initramfs-fsck-hook-ext4.triggers b/meta/recipes-initramfs/initramfs-fsck-hook/files/initramfs-fsck-hook-ext4.triggers similarity index 100% rename from meta/recipes-support/initramfs-fsck-hook/files/initramfs-fsck-hook-ext4.triggers rename to meta/recipes-initramfs/initramfs-fsck-hook/files/initramfs-fsck-hook-ext4.triggers diff --git a/meta/recipes-initramfs/initramfs-fsck-hook/initramfs-fsck-ext4-hook_0.3.bb b/meta/recipes-initramfs/initramfs-fsck-hook/initramfs-fsck-ext4-hook_0.3.bb new file mode 100644 index 00000000..c4d10c44 --- /dev/null +++ b/meta/recipes-initramfs/initramfs-fsck-hook/initramfs-fsck-ext4-hook_0.3.bb @@ -0,0 +1,14 @@ +# This software is a part of ISAR. +# Copyright (C) Siemens AG, 2019-2024 +# +# SPDX-License-Identifier: MIT + +DESCRIPTION = "Recipe to add fsck hook to the initramfs" + +require recipes-initramfs/initramfs-hook/hook.inc + +SRC_URI += "file://initramfs-fsck-hook-ext4.triggers" + +HOOK_COPY_EXECS = "fsck fsck.ext4 logsave" + +DEBIAN_DEPENDS .= ", e2fsprogs, logsave" diff --git a/meta/recipes-support/initramfs-fsck-hook/files/initramfs.fsck.ext4.hook b/meta/recipes-support/initramfs-fsck-hook/files/initramfs.fsck.ext4.hook deleted file mode 100644 index 259b73b4..00000000 --- a/meta/recipes-support/initramfs-fsck-hook/files/initramfs.fsck.ext4.hook +++ /dev/null @@ -1,39 +0,0 @@ -# This software is a part of ISAR. -# Copyright (C) Siemens AG, 2019 -# -# SPDX-License-Identifier: MIT - -#!/bin/sh - -set -e - -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -prereqs) - prereqs - exit 0 - ;; -esac - -. /usr/share/initramfs-tools/scripts/functions -. /usr/share/initramfs-tools/hook-functions - -if [ ! -x /sbin/fsck ]; then - echo "Warning: couldn't find /sbin/fsck!" - exit 0 -fi - -copy_exec /sbin/fsck -copy_exec /sbin/logsave - -if prog="$(command -v fsck.ext4)"; then - copy_exec "$prog" -else - echo "Warning: /sbin/fsck.ext4 doesn't exist, can't install to initramfs, ignoring." -fi diff --git a/meta/recipes-support/initramfs-fsck-hook/initramfs-fsck-hook-ext4_0.2.bb b/meta/recipes-support/initramfs-fsck-hook/initramfs-fsck-hook-ext4_0.2.bb deleted file mode 100644 index 9860dbc8..00000000 --- a/meta/recipes-support/initramfs-fsck-hook/initramfs-fsck-hook-ext4_0.2.bb +++ /dev/null @@ -1,18 +0,0 @@ -# This software is a part of ISAR. -# Copyright (C) Siemens AG, 2019 -# -# SPDX-License-Identifier: MIT - - -DESCRIPTION = "Recipe to add fsck hook to the initramfs" - -inherit dpkg-raw -SRC_URI = "file://initramfs-fsck-hook-ext4.triggers \ - file://initramfs.fsck.ext4.hook \ - " - - -do_install() { - install -m 0755 -d ${D}/etc/initramfs-tools/hooks - install -m 0740 ${WORKDIR}/initramfs.fsck.ext4.hook ${D}/etc/initramfs-tools/hooks/fsck.ext4.hook -} From patchwork Wed Nov 20 17:03:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 3955 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Wed, 20 Nov 2024 18:03:15 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-pf1-f192.google.com (mail-pf1-f192.google.com [209.85.210.192]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AKH3DRx006932 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 20 Nov 2024 18:03:14 +0100 Received: by mail-pf1-f192.google.com with SMTP id d2e1a72fcca58-724229e625asf3051b3a.3 for ; Wed, 20 Nov 2024 09:03:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1732122187; cv=pass; d=google.com; s=arc-20240605; b=eeVWafXDbl8vz3KMlcd/o1SOR/j6eKEv/dw4SY9GoQSon4gWts4FKMTh5d2DRJdsyG Q1QejTbIJM3vWG4LNxm3fabBVKZJLm+rcmXYnKKbxiXZFUCHK7/QSGOVaMNZrfGOBi4v gAmNy/8wiyUjPK5Yy4Ic0bwcMPWsnQsgrnki31zBt3YHrdC5tgHpw5iEcFlUy/b56S7s w4jG1vYWad2AvLs9ETY3ckjRNTuIywpZuTlSJ0ooV+mFljAEztvYb82C2SeCwHRwKIR4 FkVfgnO8DWcApbCiCZRHety8kHIv16LZqVytwVAr8Qw7JSIII63AI3EiWpPdBqf17rpS ZjUw== 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=H0EoHt3z7exmkUma8/Cuo/gl1EdPCxSIcbGNLDNLxjc=; fh=RA0VLrkGu6XRIITgasQqqfimWl4AqWZOkrb0e0dGQ+w=; b=e17IyoChRpVLBjyjmHhOZVjHmy0ACUtiOe8SU9vUF8rlRRzrjiNiZYpbdWlhpHv4gW ka9pEgOEQpCKtrNlF5uuQ6FZmfz3NhK9td9PglBf43Gtq2B8/b8p9Hi8fzYq99C9wldQ 25TD1TVtGCqoD5p42wEzvdm4RyV1D4MCYTE0w87uAKxx9qSJpAiS/NWBz+DFJXEH/PvD wwN9jXsiUl7rpcgfAU0je0Iq+JV0RTB2TUCVu8cMay9jYpB6Ed+QHFpvfqCiML4WdoSw 8IwVblV1BeFxv2Ik2jbsZJylNTkz3RiAbHxnvjU+rY8trfCNJeYunOkYpN/CsbiUa8GJ YfyA==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=fkmACf3c; spf=pass (google.com: domain of fm-294854-2024112017030323a88823b8a2693bd2-wlh7m1@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-294854-2024112017030323a88823b8a2693bd2-Wlh7M1@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=1732122187; x=1732726987; 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:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=H0EoHt3z7exmkUma8/Cuo/gl1EdPCxSIcbGNLDNLxjc=; b=IWJJuhU9lsfSI5SZ8csDnkrfdbA4MQxDlLcVp7ulghbyw928IQkgr7zBKdH9wDfstB AeIU+XfwTr6DhLkgH3BMM4T1jgEdpM1RB9caw5A/QBi2OWQ2ON+J0U89Ic7oTnUoprVL 69dPLX4nvkaJ9aoEMsJPHWTatmT4JjAJzYNZHydp7OiQU0R6rMUfUoN61TeZ7UM/Wqy2 YOOxRhEt1/5EsuMavwwXRIF3Vu5S4BXvMYyRZrNlEe+qB1TO6jBHvmknfdLbBKq/SRnv Bs+dW1BVxhNMHdMotXFrabd/nnEab1ka0/6xY4Z3xoM4NiRIUi6/zmrehtd+FH03Fde6 RvDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732122187; x=1732726987; 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=H0EoHt3z7exmkUma8/Cuo/gl1EdPCxSIcbGNLDNLxjc=; b=bvbkVLsCyTu+knJYTj1dji1+UTFZECnDgR33+KnNOJNB+LKYBDkV4OLzUznMZdLw1u jywq/EUxt+yrTHAnJn+AQrBMGcbPm3knpI5cdAJ16YsIpEq+CEK/zg+z7wHKAHKF31bL pskDbOx/g7TGOrFkClJtrOHBTi7QOvebkWLwEfVEp+rprJUZFulMBeHuXKha8LhfjJEB xd/IC3wQuNjk/FVZ8fsqqY/P1F2wDqngXuVkogPb8El1UBZ/TIRC5tsA2k9afX7nIfZp hys6ayfB7YGmUi2NFQnpHWOkFbSsevptyZ62Ey8MqQUAe1sVTFx5QbHM2pg6nu4aaoW/ eBdQ== X-Forwarded-Encrypted: i=2; AJvYcCUpv1xqIkG/rx3OSF5atD/eOpnnvuGUBw7S4YDtUp8lqij0V/T9GORW8zqtmi41IlRxpVc0GD4=@isar-build.org X-Gm-Message-State: AOJu0YyCMs0UIwrMx7bTGXgI4irRd1C9DfHj2E2ws7VFCmyb7g7tfbS9 KPAedOuUVVOfb4R7jJjhmO5IUFnqh4/0F+hcV8qDVl3hW/QNW+hq X-Google-Smtp-Source: AGHT+IGYkKNG/j98+mLW0HrfSCHi6r0rP0Sy7xnZ7VXz1tr2M0DcJahJnhJRpuuc5pfPBtpYp3hdxg== X-Received: by 2002:a17:90b:3146:b0:2ea:3d61:1847 with SMTP id 98e67ed59e1d1-2eaca7eb664mr3394303a91.32.1732122187111; Wed, 20 Nov 2024 09:03:07 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:90b:1186:b0:2e1:1d4a:962a with SMTP id 98e67ed59e1d1-2eaebc26f4cls21898a91.1.-pod-prod-04-us; Wed, 20 Nov 2024 09:03:05 -0800 (PST) X-Received: by 2002:a17:90b:3510:b0:2ea:aa30:5ee3 with SMTP id 98e67ed59e1d1-2eaca6d6b2emr3767310a91.2.1732122185579; Wed, 20 Nov 2024 09:03:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1732122185; cv=none; d=google.com; s=arc-20240605; b=EjvH+2KXDp+MgLzugAytwWjtdA62pUwhsjvuLsXK/XDflX8qGuYe7HJ3mOfYhOpNM5 Wra7RsNdVpzfAaFyWwytYP/qDw2yGs21KPW6LNlPZi5mXUieeWbLxP7CeA/j/PFEJFmQ qMBMFhbu21KCVCRC5EQ6EgkwwD6TI7i7o02D2Ys4aRJ8Zwgx2d4uK7SC9CRiAeS4MAio QJqW9Tx1N6Lz8NeInxoeTo6WaDQrB5ALEt3kThuiYxa0HqiVfQQay2B9MyZOWMgfMx/A sQEr/fPRBln6oh7ACZiXCj13HjhUTminPKrWwKPgV6o1w8CKQanZ9Tn4KDnakDwGENRQ 9JnA== 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=damBkMLDbvyJroW1CNbqTpW5Nz8l3TrrIrRhSEEXQtM=; fh=TWGwN84gUgHIe5O4CbyH9KISyeWwGbvUX7cnJPxVD70=; b=Pv0LVuRTeCyRTMTsc+4QWjQNci/ZD3arrO0D6tqo3l3br/BMDR/PC3dJtyPrGYZrJS 2Gw+NXYkx4LmqbgsZuSd3+OZ3XSLnuIpf+cyrnYrYzgusDIWX/UdhsAs2CI4nDUDzQO4 tAvqfjEW4GGUPy9iruqQS3AYtNQ+bAXNtnCSOUJzTfJniq6KMm+pQ2npmUhp5RCUKo2n SD2tWQm2r4xszZHWSHP+bSUdiGuo8mchlTp5dgbmx8WWXvhGgWUbwKE6oMsWTiIUzZov yHJhB130oSn9I3nIxZtxzV6/EkGoeqXN4keBRxCiGKfG7WkHEzYuMtbMulNulkCGMcDq S4xg==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=fkmACf3c; spf=pass (google.com: domain of fm-294854-2024112017030323a88823b8a2693bd2-wlh7m1@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-294854-2024112017030323a88823b8a2693bd2-Wlh7M1@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-65-227.siemens.flowmailer.net (mta-65-227.siemens.flowmailer.net. [185.136.65.227]) by gmr-mx.google.com with ESMTPS id 98e67ed59e1d1-2eaca6fce6dsi271177a91.1.2024.11.20.09.03.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Nov 2024 09:03:05 -0800 (PST) Received-SPF: pass (google.com: domain of fm-294854-2024112017030323a88823b8a2693bd2-wlh7m1@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) client-ip=185.136.65.227; Received: by mta-65-227.siemens.flowmailer.net with ESMTPSA id 2024112017030323a88823b8a2693bd2 for ; Wed, 20 Nov 2024 18:03:03 +0100 X-Patchwork-Original-From: "'Jan Kiszka' via isar-users" From: Jan Kiszka To: isar-users Cc: Quirin Gylstorff Subject: [PATCH v5 6/7] initramfs-tee-ftpm-hook: Convert to hook.inc Date: Wed, 20 Nov 2024 18:03:00 +0100 Message-ID: <9c99494b0bbaf84f50cd70388372d5309224afc2.1732122181.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=fm2 header.b=fkmACf3c; spf=pass (google.com: domain of fm-294854-2024112017030323a88823b8a2693bd2-wlh7m1@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-294854-2024112017030323a88823b8a2693bd2-Wlh7M1@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 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: Jan Kiszka Reduces the own bits significantly. Signed-off-by: Jan Kiszka --- .../files/{tee-ftpm.script => local-top} | 18 +----------- .../files/tee-ftpm.hook | 28 ------------------- .../initramfs-tee-ftpm-hook_0.1.bb | 27 ------------------ .../initramfs-tee-ftpm-hook_0.2.bb | 15 ++++++++++ 4 files changed, 16 insertions(+), 72 deletions(-) rename meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/{tee-ftpm.script => local-top} (75%) delete mode 100644 meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.hook delete mode 100644 meta/recipes-initramfs/initramfs-tee-ftpm-hook/initramfs-tee-ftpm-hook_0.1.bb create mode 100644 meta/recipes-initramfs/initramfs-tee-ftpm-hook/initramfs-tee-ftpm-hook_0.2.bb diff --git a/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.script b/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/local-top similarity index 75% rename from meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.script rename to meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/local-top index 3355a7e0..989bf288 100644 --- a/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.script +++ b/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/local-top @@ -1,4 +1,4 @@ -#!/bin/sh +# # Copyright (c) Siemens AG, 2023 # # Authors: @@ -7,22 +7,6 @@ # SPDX-License-Identifier: MIT # -set -e - -PREREQ="tee-supplicant" -prereqs() -{ - echo "$PREREQ" -} -case $1 in -prereqs) - prereqs - exit 0 - ;; -esac - -. /scripts/functions - FTPM_DEV=/dev/tpmrm0 # The tee-supplicant would take some time to be discovered, 30 seconds should diff --git a/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.hook b/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.hook deleted file mode 100644 index e80f00b4..00000000 --- a/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.hook +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# Copyright (c) Siemens AG, 2023 -# -# Authors: -# Su Bao Cheng -# -# SPDX-License-Identifier: MIT -# - -set -e - -PREREQ="tee-supplicant" -prereqs() -{ - echo "$PREREQ" -} -case $1 in -prereqs) - prereqs - exit 0 - ;; -esac - -. /usr/share/initramfs-tools/hook-functions - -# The tpm_ftpm_tee.ko does not exist in any stock debian kernels, it could be -# provided by customized kernel. -manual_add_modules tpm_ftpm_tee diff --git a/meta/recipes-initramfs/initramfs-tee-ftpm-hook/initramfs-tee-ftpm-hook_0.1.bb b/meta/recipes-initramfs/initramfs-tee-ftpm-hook/initramfs-tee-ftpm-hook_0.1.bb deleted file mode 100644 index 82fec1bb..00000000 --- a/meta/recipes-initramfs/initramfs-tee-ftpm-hook/initramfs-tee-ftpm-hook_0.1.bb +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) Siemens AG, 2023 -# -# Authors: -# Su Bao Cheng -# -# SPDX-License-Identifier: MIT -# - -inherit dpkg-raw - -SRC_URI += " \ - file://tee-ftpm.hook \ - file://tee-ftpm.script \ - " - -DEBIAN_DEPENDS = "initramfs-tools" - -do_install[cleandirs] += " \ - ${D}/usr/share/initramfs-tools/hooks \ - ${D}/usr/share/initramfs-tools/scripts/local-top" - -do_install() { - install -m 0755 "${WORKDIR}/tee-ftpm.hook" \ - "${D}/usr/share/initramfs-tools/hooks/tee-ftpm" - install -m 0755 "${WORKDIR}/tee-ftpm.script" \ - "${D}/usr/share/initramfs-tools/scripts/local-top/tee-ftpm" -} diff --git a/meta/recipes-initramfs/initramfs-tee-ftpm-hook/initramfs-tee-ftpm-hook_0.2.bb b/meta/recipes-initramfs/initramfs-tee-ftpm-hook/initramfs-tee-ftpm-hook_0.2.bb new file mode 100644 index 00000000..9f77c158 --- /dev/null +++ b/meta/recipes-initramfs/initramfs-tee-ftpm-hook/initramfs-tee-ftpm-hook_0.2.bb @@ -0,0 +1,15 @@ +# Copyright (c) Siemens AG, 2023-2024 +# +# Authors: +# Su Bao Cheng +# +# SPDX-License-Identifier: MIT +# + +require recipes-initramfs/initramfs-hook/hook.inc + +SRC_URI += "file://local-top" + +HOOK_PREREQ = "tee-supplicant" +HOOK_ADD_MODULES = "tpm_ftpm_tee" +SCRIPT_PREREQ = "tee-supplicant" From patchwork Wed Nov 20 17:03:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 3956 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Wed, 20 Nov 2024 18:03:16 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-pl1-f188.google.com (mail-pl1-f188.google.com [209.85.214.188]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AKH3ELv006951 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 20 Nov 2024 18:03:15 +0100 Received: by mail-pl1-f188.google.com with SMTP id d9443c01a7336-2124debb33csf10053945ad.0 for ; Wed, 20 Nov 2024 09:03:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1732122188; cv=pass; d=google.com; s=arc-20240605; b=CmD4FtJsLYUOxgzD5ojV5HpZKBIZoQN0txdZpPamzRPtjO64KA50+wsbkhdaazLPZn bXgPHE6yQPz6PP38ktK+9D4oKtwneMZ7opisikPliQIm8Xrd1EA+BqB9a9mYDBfSPQyJ xrCo9JB9ulU9NjajxQfChxfOz4ZyrNFr94qnt6N6+l55RTsgYBeoJYJKp7fPfy0kxU2T uX8UtTW6QeEF6KvtPu9KOLOkdJ7MWmHVlxMP++/k8zb0is37OtJ+vJcGhsVJ+vSyMGjY M3Z6GrQLTMwhnm6golJp0tadZQT7QUykjJpZ6vtiLiLL10c/oeie/3EIWBNykzETYrSk VmzA== 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=HH44jfIvrkJJy+MvIDMtoAicDlcWwN8lK4Xhn/Fk3zw=; fh=JzXCeBK2pyvxh1K4GG8OsBl0bj6jdFhOp60bEFQe2wU=; b=EG78YXC6qhYegC8xFSoc2d7AZq0TbVGPEK+qIkavRJiQqtfFSXRpiMS8cypLEOAkNv d751ULnUVqAEZaaSOYBSPggxFhS8UrQH/5aNQGZ9PLLi6HQODs69cdSbvzRGEgprBi0h CCFNf5SL2a2c2RC8Vl5A22S01vHuZqzhXv77w+UYGR4cILc/hR3HXYrTQFMMLNws2XmQ teTefv76CNPEW1rG3jPHzLORUTRAde3Q3zrKBZHThFE0xS0rRoXP38TfcAA6Ss6FN1gu F5Aj2fM9kGUazjy1PsPFhfJeeRY9a2FrUuMRKY0Fx5mjaVLcMHX7QQlCieFpD7s5j5By ncig==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=HrpOteHC; spf=pass (google.com: domain of fm-294854-202411201703032aa330eb552b43fb66-jungy2@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-294854-202411201703032aa330eb552b43fb66-jUNgY2@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=1732122188; x=1732726988; 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:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=HH44jfIvrkJJy+MvIDMtoAicDlcWwN8lK4Xhn/Fk3zw=; b=L+Fp9kztUcLwg22PABQWRF8PPlVxI3M2EVZPMQg4vfQmJM4aXJGgMkQHq2K/6DwJbv WFPDNmlyr1wgKVnsHFqZ8NcpaBdgGuZjFG49Pg5tWrwf3nSzXnUvN0adWrn7UAJg2X48 RwgyGmIZJajSj2b5iVlh/k7Oij3pv1DWe8b6UhEEg/amvFgmZBFgYtkRUbiMv4V0ObJr 94duyeHKJE6XxWQNw9P1kjj3DfdELXZaqwhIOhVjwSOHtasNX8XLJrJnM1uehINNV4ns XsmWaVE5T3aw040bY1J3yRQ2v7FPYRl8VfPzEZRnFsxwXG4FlTT3h8EdLIznKAp72Rva aqaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732122188; x=1732726988; 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=HH44jfIvrkJJy+MvIDMtoAicDlcWwN8lK4Xhn/Fk3zw=; b=LQ6MCtqQQ8GWoSV2EZDP56PSDh8Iie/0XSesV5qIY4BP6v/TnGKpVuuJa5GYjIbn5I qdiyME/NE34YCXp8VbjFSuU+SjfubfRjiwoOGXTqHrxXnZhG/CGzp0ZNWxitqrLCWCH9 ZYIeSUOej671CCJYwF0802BTCXfwgXXgXSzyu6B142e4KxHPlK2XSNbmMOQnXF4Rcn5N 2muDzVPQK4eHkapjepr7yLKBl/pToXbIDkiAA1ArHTv0hT9sAb6x8YQ2cLU3KR7Ycrwt oD3M69oScaNtnRax4TWZT22xWtlpulBxfdgOLb3NVmj8q4YbJaDh3bDqFWPQ42KiesS0 ngRA== X-Forwarded-Encrypted: i=2; AJvYcCXClfe57gLwb4OrJV+/P9RsxNJlgv9mIbuTQUqUiZRVeqF6dfIBqoRqUGTz2SogeIjcQCJw+1I=@isar-build.org X-Gm-Message-State: AOJu0Yx/H+5vbkUAZ9qkhNBnUXVOX+iP8j0sjl3se19pjCWr083IYu66 zLa6Pzl/aa3hRRLQXGHKRKwwOoi9qHsjc+rKYnbk7H4eWwCK5Uou X-Google-Smtp-Source: AGHT+IEhkan7OxkXrAzjUM1NzVI3lYYxiRQyD+kgpNZGk4mM3+tDKq4/1idEIoV/QL6QAp5mK9gEhA== X-Received: by 2002:a17:902:e848:b0:20f:c225:f2a5 with SMTP id d9443c01a7336-21283a409e8mr217005ad.10.1732122187604; Wed, 20 Nov 2024 09:03:07 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:903:650:b0:212:2223:27a7 with SMTP id d9443c01a7336-21222232ec9ls15238195ad.2.-pod-prod-00-us; Wed, 20 Nov 2024 09:03:06 -0800 (PST) X-Received: by 2002:a17:902:ce84:b0:20b:db4:d913 with SMTP id d9443c01a7336-2128376a8ddmr1589515ad.11.1732122185916; Wed, 20 Nov 2024 09:03:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1732122185; cv=none; d=google.com; s=arc-20240605; b=Qy2u3uBnVFbC7JNDDUfvcLyZ3Pq/fKrKbSKa6PNb09dsucazy+SYsbiR0TnYNUTwza KqUw7SBSTrGZVD1CZVTUuDqzuTPKK6glhrXmkdVC6Kdh36TeZJY3AnAjEsXvqd/h/pIE J9BFrwFTLepF1SBB/2PAJlBBPTqekoH4Sktilf31fP1AzL3Se+gkajpcDrlZqD/5xJ6u sUuGMImV99ASAn3CrDNa1kC17GpAZ5Fsbi0fKiQkjfNsQIwz4sLRd5A5fyjFhPGY3uZC Uggxegn7V1y/A1c6k7E8dNzcjoPnNUlznjkyUEZCLYyHIQkZHQR/pECQx+EWI2q+5cXO GNZg== 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=K/9H8H130CK5JxJctldzaMoS23gMPdsPHcrHTmkexo8=; fh=TWGwN84gUgHIe5O4CbyH9KISyeWwGbvUX7cnJPxVD70=; b=NdQDe4anKwGPvDKNRYBQ/vr+MRWD5lC+8bkRNtXHVdTuDFOAes4WCHNMHOEwnCeWtA xdI7e5Tsi//nLFTniaAx9WW6B0seDIxSdL3uot7HTpnpij+2WRSgGIRhIV3ZCUjZqruY CO/36wd4xPHKgZVz1FbKy5qgkr67Bf2FQMMTCqjEGdyc7V13fI9dGDsnPg8bVQpUB7eI B7N9lWcJyxRnDgyVEe2eiD30XukK/W1CISf4dFDmfJdlTsUA47z2dv7q5KIJxxJqRFPI zPAroV9M+rn3OMtnn2ap1RIFO37ItY4bN+jRFnJ2qqbglIfvQSLTjPq6kguACqPUb1h2 IMTg==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=HrpOteHC; spf=pass (google.com: domain of fm-294854-202411201703032aa330eb552b43fb66-jungy2@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-294854-202411201703032aa330eb552b43fb66-jUNgY2@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 d9443c01a7336-211d0d23127si6078085ad.0.2024.11.20.09.03.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Nov 2024 09:03:05 -0800 (PST) Received-SPF: pass (google.com: domain of fm-294854-202411201703032aa330eb552b43fb66-jungy2@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 202411201703032aa330eb552b43fb66 for ; Wed, 20 Nov 2024 18:03:03 +0100 X-Patchwork-Original-From: "'Jan Kiszka' via isar-users" From: Jan Kiszka To: isar-users Cc: Quirin Gylstorff Subject: [PATCH v5 7/7] initramfs-tee-supplicant-hook: Convert to hook.inc Date: Wed, 20 Nov 2024 18:03:01 +0100 Message-ID: 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=fm2 header.b=HrpOteHC; spf=pass (google.com: domain of fm-294854-202411201703032aa330eb552b43fb66-jungy2@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-294854-202411201703032aa330eb552b43fb66-jUNgY2@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 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_H3,RCVD_IN_MSPIKE_WL, 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: Jan Kiszka Reduces the own bits significantly. Signed-off-by: Jan Kiszka --- .../{tee-supplicant.script => local-top} | 18 +--------- .../files/tee-supplicant.hook | 36 ------------------- .../initramfs-tee-supplicant-hook_0.1.bb | 27 -------------- .../initramfs-tee-supplicant-hook_0.2.bb | 16 +++++++++ 4 files changed, 17 insertions(+), 80 deletions(-) rename meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/{tee-supplicant.script => local-top} (68%) delete mode 100644 meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplicant.hook delete mode 100644 meta/recipes-initramfs/initramfs-tee-supplicant-hook/initramfs-tee-supplicant-hook_0.1.bb create mode 100644 meta/recipes-initramfs/initramfs-tee-supplicant-hook/initramfs-tee-supplicant-hook_0.2.bb diff --git a/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplicant.script b/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/local-top similarity index 68% rename from meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplicant.script rename to meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/local-top index ac01d7ec..575a742d 100644 --- a/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplicant.script +++ b/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/local-top @@ -1,4 +1,4 @@ -#!/bin/sh +# # Copyright (c) Siemens AG, 2023 # # Authors: @@ -7,22 +7,6 @@ # SPDX-License-Identifier: MIT # -set -e - -PREREQ="" -prereqs() -{ - echo "$PREREQ" -} -case $1 in -prereqs) - prereqs - exit 0 - ;; -esac - -. /scripts/functions - /usr/sbin/modprobe optee /usr/sbin/tee-supplicant -d diff --git a/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplicant.hook b/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplicant.hook deleted file mode 100644 index 3e2f4016..00000000 --- a/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplicant.hook +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# Copyright (c) Siemens AG, 2023 -# -# Authors: -# Su Bao Cheng -# -# SPDX-License-Identifier: MIT -# - -set -e - -PREREQ="" -prereqs() -{ - echo "$PREREQ" -} -case $1 in -prereqs) - prereqs - exit 0 - ;; -esac - -. /usr/share/initramfs-tools/hook-functions - -hook_error() { - echo "(ERROR): $1" >&2 - exit 1 -} - -# For stock debian bookworm arm64 kernel, these two .ko exist, but not built-in. -manual_add_modules tee -manual_add_modules optee - -copy_exec /usr/sbin/tee-supplicant || hook_error "/usr/sbin/tee-supplicant not found" -copy_exec /usr/bin/pgrep || hook_error "/usr/bin/pgrep not found" diff --git a/meta/recipes-initramfs/initramfs-tee-supplicant-hook/initramfs-tee-supplicant-hook_0.1.bb b/meta/recipes-initramfs/initramfs-tee-supplicant-hook/initramfs-tee-supplicant-hook_0.1.bb deleted file mode 100644 index a7a19bee..00000000 --- a/meta/recipes-initramfs/initramfs-tee-supplicant-hook/initramfs-tee-supplicant-hook_0.1.bb +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) Siemens AG, 2023 -# -# Authors: -# Su Bao Cheng -# -# SPDX-License-Identifier: MIT -# - -inherit dpkg-raw - -SRC_URI += " \ - file://tee-supplicant.hook \ - file://tee-supplicant.script \ - " - -DEBIAN_DEPENDS = "initramfs-tools, tee-supplicant, procps" - -do_install[cleandirs] += " \ - ${D}/usr/share/initramfs-tools/hooks \ - ${D}/usr/share/initramfs-tools/scripts/local-top" - -do_install() { - install -m 0755 "${WORKDIR}/tee-supplicant.hook" \ - "${D}/usr/share/initramfs-tools/hooks/tee-supplicant" - install -m 0755 "${WORKDIR}/tee-supplicant.script" \ - "${D}/usr/share/initramfs-tools/scripts/local-top/tee-supplicant" -} diff --git a/meta/recipes-initramfs/initramfs-tee-supplicant-hook/initramfs-tee-supplicant-hook_0.2.bb b/meta/recipes-initramfs/initramfs-tee-supplicant-hook/initramfs-tee-supplicant-hook_0.2.bb new file mode 100644 index 00000000..b9dedfd3 --- /dev/null +++ b/meta/recipes-initramfs/initramfs-tee-supplicant-hook/initramfs-tee-supplicant-hook_0.2.bb @@ -0,0 +1,16 @@ +# Copyright (c) Siemens AG, 2023-2024 +# +# Authors: +# Su Bao Cheng +# +# SPDX-License-Identifier: MIT +# + +require recipes-initramfs/initramfs-hook/hook.inc + +SRC_URI += "file://local-top" + +HOOK_ADD_MODULES = "tee optee" +HOOK_COPY_EXECS = "tee-supplicant pgrep" + +DEBIAN_DEPENDS .= ", tee-supplicant, procps"