From patchwork Sat Nov 16 11:12: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: 3938 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:11 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-qk1-f191.google.com (mail-qk1-f191.google.com [209.85.222.191]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AGBDAr0014072 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 16 Nov 2024 12:13:11 +0100 Received: by mail-qk1-f191.google.com with SMTP id af79cd13be357-7b16223e610sf99488485a.2 for ; Sat, 16 Nov 2024 03:13:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1731755585; cv=pass; d=google.com; s=arc-20240605; b=GcBMl01W+esr3dl3YEHeph2hSsYG+0vCsdc0k/5e/vc4EvS3tDbXIQCDfC/n7U9wIR gWD5PKhEeaFoTYJh8Uz0d4p7+IfAvz9k34S4xvIu2Yv33bRq3ocojxGb9yPn3rd+C48b HC9jrCrtCwq0QbKZ8vYxUemeo2+phuoLSrO4KodLpfkwka92CIW7j5Xq1Wvr18plqidr tXrly0rjsiZiYLVs5JEZWjM8rhjsHboST1C+09R7X8RmmiAUeXkLCHgjz1ziXhuH8lR0 PvsW93uY+C2RGbXf/6z6K2dA/GShTftURmMCzmM/mresQfrhv0YkJ7el3ReucthDX1zz FOiQ== 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=y0U9hCQCNFVGYGhcIq1mm9pEGYDV7udk/QLN/OGafW0=; fh=+o/HK8ibpGfMQTnKRgBnne1LsktmI0pWCxCFASSpnx8=; b=N3x3W52Dnn+iLhsFfrGlXG9Uwk7nRLRkzEn36rhR+s/Y1+7+bFzwObeFCJLxWarpPu L5drdZbIuIN1NdrJJs0boi10sEuAwYrYvtfnjaXCaahgI6atEc2Amm7Z0yWLwOoivqvO VgZyJlVTOQoES0qHgr+cX/8r3kx3Kud5KSPx1311u+cSrgJ79PcOc6ZPsPh8QWhNCSnw 7V/z6wuPQEw6LRV3WANJFTcfDGba3sg9T96kDGbYIMhhjz12Kqy1LGy1Zuc/es1uiV2s 1P6ZtPIcjYQdOlqg75zkACUAKg4UEcgmtl+3IIV8fUGzrbBOEP7Qf3ecpnQEPnHexUC1 a8TQ==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=Z1n01Myu; spf=pass (google.com: domain of fm-294854-202411161113021a6363467dd204d7fc-8i2jis@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) smtp.mailfrom=fm-294854-202411161113021a6363467dd204d7fc-8I2jIS@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=1731755585; x=1732360385; 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=y0U9hCQCNFVGYGhcIq1mm9pEGYDV7udk/QLN/OGafW0=; b=esFdrK7loQQOMNDmTExsjGZLQW9EWEWapr91OMxTJwS79ZQYUxzIBUpqwvilao3FRt 8iPewXcymORCShnE7lYO90mD6hRPnf4jI1Vh1Cbnpn9a6+X8/8dAh56huG1dxYeHA5Cf 3a5rLPJOX3KOoi6CfMX9J7OPe3Cay419zGSOCECLzfprUvqAcTCI+JRg1Fub++s5wUsq hz6iSYwBhp5g5LFBg1vNeueAZ8nXNsPGHMBLHdtl4kCzEgtNSGCA8/cZb/1p3CoZe4w7 7zeou7ZakXEl6eEy8iStzcprL3Nuwb0Q0CvcaYewVqRm5SZpQsnW3856QuPtA4BAMxDp g7Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731755585; x=1732360385; 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=y0U9hCQCNFVGYGhcIq1mm9pEGYDV7udk/QLN/OGafW0=; b=uS8MEvwdbeOdXlbQM6yj9x2SQ98J4ewk7P+IjKkCQnPKbESzjYVj62dryz59NM+iis 7wd12J/o2qYBEt295CWITARmWVZJZrRloFfUWQnMvTc6uj+4ZvaDof9NuINnLnAejvGm OB6n5Q+ESpzMEGiw/njRx6fzYZyLG6C4j3m7FbsRYmqKMT73x3DZDlQjI67ML1cXBtWh RqKFymPVXV6uLz746Kd0BA2TT0674EZhieF2b4EFJXWJy7gu6ROg1J1PZnkOrmmkzTmQ o8j6GkTVC9qcGGtxaaIGOg55AR5NFCreAu/JJdi0YIDENsyCqCdilJlT1uQolmyr6Y0i cRTg== X-Forwarded-Encrypted: i=2; AJvYcCVf/Pjf+2nL4RLNzOzpq0q7k38+W0Fjp4GeoRqvqgjr63dO1YFiCAq4Gvd/gJNFtilNzJ40OtM=@isar-build.org X-Gm-Message-State: AOJu0YxAzT9b9lR1GWUkaHsDFKQWy20dHw8skM/5Lw8KCA4d36WeX0v3 PzXoTNs40ONj8A6WQjmbLfOJbFN1ru3CDUjav/YimRUcImPXgaq6 X-Google-Smtp-Source: AGHT+IGdd9N76Mh2reXp2oIY8NtJEO+Q3Ppn1UbllPsVmKVArE0zF6zSw/a7SaaK/Kjl+Egph0wKRQ== X-Received: by 2002:a05:620a:170b:b0:7b1:11f4:d0af with SMTP id af79cd13be357-7b3622e3aeemr707795085a.29.1731755584718; Sat, 16 Nov 2024 03:13:04 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:ac8:5fc5:0:b0:463:17df:8a80 with SMTP id d75a77b69052e-46370578e98ls7050671cf.1.-pod-prod-04-us; Sat, 16 Nov 2024 03:13:04 -0800 (PST) X-Received: by 2002:a05:622a:4d4b:b0:460:9d81:4bc8 with SMTP id d75a77b69052e-46363e941c6mr80307971cf.42.1731755583969; Sat, 16 Nov 2024 03:13:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731755583; cv=none; d=google.com; s=arc-20240605; b=UkFDBGptqZZKQ66t2WnNQwo3LvcBGyxgRHmgIE7qsulr3RzbqJTrjTi3nNOiuJfqhP VqYybGMY63iFjASP7yoZMGkYuBFhyqo2yB1DxFuhzPDcUT9BA9xRSZc140M42hkFAJrN nmnzW9L5vdLizoa9OSgM7xIhlMDK87Qv0clVAeWFbeLI3i5nlzMLuB7mGBCwkyZ8WD/e AEVXQFzc1pjkaaFdb3ZDHqfSRzCZf13nHu0vRmaRolNO8cs9kNxEnzea8llctH9gIE3A sH7jk1Rj0AraNWUiHAQaj6AF56WwuNww5SAItEaeOzRhY7RchYvBZGrxkAX+hlloe1/c Qlxg== 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=7dZBuOrqumNDmXfNrDIicYZmwXKWUxS8UsY+0CFsDiw=; fh=TWGwN84gUgHIe5O4CbyH9KISyeWwGbvUX7cnJPxVD70=; b=Wu/NFGJQ5OEo9TJ6P9Vh9JgpJwwzxIebbcA2mjgXbjxMU4xUYo6Q7yhxHVjJHkhueL H4qvnYyRXv5TEFR1Hnd7RTeJb+9j0OMYWcB9CCww+oxNsNE8mU+tE5N2CAtpY2iImlPf BAnOg3OapOE5uICpH7VRzG76pEj+v+vjsD60N19A2l9PO6UXYXQwUpc3jqD03RcAoRg7 GtwVZJvls/5r54Nhg+cnWMeV++IjvMFXOouERP5Nbt8t0+MLIbqxvMlp3pp2ny5xFvoE xXwIsPWZVzad5VEphP6hMuSlNCpdEY0R9aIl89ZpTg/naAIh5ZAquVZIDL6OIJ8fhC6N QY6w==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=Z1n01Myu; spf=pass (google.com: domain of fm-294854-202411161113021a6363467dd204d7fc-8i2jis@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) smtp.mailfrom=fm-294854-202411161113021a6363467dd204d7fc-8I2jIS@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-64-227.siemens.flowmailer.net (mta-64-227.siemens.flowmailer.net. [185.136.64.227]) by gmr-mx.google.com with ESMTPS id d75a77b69052e-4635a9c1a0fsi2608411cf.1.2024.11.16.03.13.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Nov 2024 03:13:03 -0800 (PST) Received-SPF: pass (google.com: domain of fm-294854-202411161113021a6363467dd204d7fc-8i2jis@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) client-ip=185.136.64.227; Received: by mta-64-227.siemens.flowmailer.net with ESMTPSA id 202411161113021a6363467dd204d7fc for ; Sat, 16 Nov 2024 12:13:02 +0100 X-Patchwork-Original-From: "'Jan Kiszka' via isar-users" From: Jan Kiszka To: isar-users Cc: Quirin Gylstorff Subject: [PATCH v4 1/7] initramfs-hook: Add infrastructure to ease writing hooks Date: Sat, 16 Nov 2024 12:12:55 +0100 Message-ID: <1d32929bfb26982f9950737f689ea20f2056a45c.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=Z1n01Myu; spf=pass (google.com: domain of fm-294854-202411161113021a6363467dd204d7fc-8i2jis@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) smtp.mailfrom=fm-294854-202411161113021a6363467dd204d7fc-8I2jIS@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. 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 | 76 +++++++++++++++++++ 3 files changed, 141 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..b0e7c66c --- /dev/null +++ b/meta/recipes-initramfs/initramfs-hook/hook.inc @@ -0,0 +1,76 @@ +# +# 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" ]; then + continue + fi + + rm -rf "${D}/usr/share/initramfs-tools/scripts/$script" + install -d -m 0755 "${D}/usr/share/initramfs-tools/scripts/$script" + 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}" + done +} From patchwork Sat Nov 16 11:12: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: 3940 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:13 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-il1-f183.google.com (mail-il1-f183.google.com [209.85.166.183]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AGBDB9H014081 (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-f183.google.com with SMTP id e9e14a558f8ab-3a3da2d46b9sf32876855ab.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=RznDoX1rv5T7grDzXM9B8Yw+PUL2PalVOmuDLk7mEmPirm/D7goYqsgMqOrs5IVFRy gU5XH9lLrg7JODdMbJx5Rm1PIN9qPezCTQiMtrDtTLZxReVDJQnvflf1WaXIGR9/SwjR 9sfnVYU8Y9zP2gCXZW9Rh8HiNEqiMgmvGxtk0T12dZljFsWUm75PPGfp1M9Y7jlAC2T9 ebbs+nTbjV/JbLtBirgYBaJBroO2KM93YAbo35HIEczlQFFQaaX67fKH+DpVuMhbDFue /zsr2ZE3ko7QeX6EfdDEARQ+97rD8caRIjN+o09Ch8kINQ/Up9B1jLG0ju0OiEBv4qDs aM5g== 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=x6Nv7a90SOq+MolrJNLCrOvHe3eZ+yzlwFNxTKORlVI=; b=kE3ZxUbH3BBGMReuhnGxvbzDCNSx812/df6vNiHyC4hJPeqP2GTZeZXy7kbvyn4Jzk g76VSUm48kejDqkL9XtmzGWLWsdmeNeUELwHmIKLPDghkm2FWOQVznUKrxg/bGRDQBrX VTL9YwTfrJWoImEVbIGg3XO8nEm0YNdyRDHIh2nHXr6TZh09XgblqSBBTWkh0yqD9Ib7 +/kSLgQjFPqKjQ+ep8zbaOooDXkK3eMWihVnBgKAXDHbQI2DysPTkMBficeJpPq3CLA2 eX2plk31eoHHsNtZ6uaUjWgWMb9IKfHz4tTGsFHlEtUoqyDZrDhDJm0BBud+VEy99FNj LAfA==; darn=isar-build.org 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=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=AyVUEsozNYUj6EHBx6BQpzJLJ54qXAhCFDmGDmDybqU=; b=a7mkpusbC1tt35YkDMQDY7rJsAgkERTKhvhLgFQ7dGCI+R0eEiZaAK5higyMVjHU9s xIt1PiFH1Qbf9gFuaGXRo7T6J0c2Uq+Bf5gdfdSL4ylAxpw5G/+kYze3ucFQqgPodXPS a/mRGm0yd/5WSJmCc/3OR0YaLFHq3JgkKeqxFj5ATWMhovMgU4UQp0p/d3ngwbvZE37J QFKmCTwqVZRYo9xgCaDnm2sVFEx4rbiW/oPXlbcBINy54iRe11HgAhvhNH5m7/NJCYFM GDOZvY+RbsrmlIrNsHAPtkEjap1EDNKzbdDl+TAt8j56A5/9pw5FB2CyEkvNwdTQVPd6 62sQ== 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=rCBPnBp5ToobwnMF7qpx0hwqrRUdRgc+ZgvLlsExl/uAMlSP06OJgYTOs8tLQ5jVoZ arkUQgO+YdtVRfeXLHkEUtk7vy1bTWz5U3c8oXf5WzCWkxAHLz2089mSj3y3luFQXrFz btf53MxmWgAUon0zL5IrAydTDcgQzyBDKrgPXjk2vpGCGeVxWMlm4PCX8J9QjrY0C32U BynoOdHO6OPOJ7ZazX3+9K4ldWPasW2Iqdr8piVqwIULqu8JCPToiPcw55Sh0JYVIUgZ Kow6pTf9uBPEXuKBQe0rjifsnFL9K6ESoGIMpnEntiEZWWLDlG0qrOg68dSZx/OsGnmP cJJw== X-Forwarded-Encrypted: i=2; AJvYcCX1INK7q9vHO9IvRfRQK+N3XvWB9zgb31tYhPYycC2QHc+tmq1GyC40Wv56w6hqtil3CpqyITc=@isar-build.org X-Gm-Message-State: AOJu0YzRuW8FAtXZmq/rKSi4zlkbPIqATGwvmILZ5bTHiFsap/X8JFYN HYzBappBqX3F2EXdnt8LPDQYKhkJyLEGWP3OfSXbWJYMqkv3TIMF 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 X-Patchwork-Original-From: "'Jan Kiszka' via isar-users" From: Jan Kiszka 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 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 | 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. From patchwork Sat Nov 16 11:12: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: 3942 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:14 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-pl1-f187.google.com (mail-pl1-f187.google.com [209.85.214.187]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AGBDCc6014108 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 16 Nov 2024 12:13:13 +0100 Received: by mail-pl1-f187.google.com with SMTP id d9443c01a7336-20c7ba2722fsf25708215ad.1 for ; Sat, 16 Nov 2024 03:13:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1731755587; cv=pass; d=google.com; s=arc-20240605; b=kfLepMqoaRzMIGZN7FqVmKuSb820G+80S90eJBHQUCSqZU5Y0Dam/6s/CVw5G3pIWf TKj/WEvjBs8C+anw3XqSAqWQBJZdIEZWU0Ap/0w59jZMujuL0EyPsctmPFdBwI2iS4zG cXm34cZ4PmLyniav6PwG7bsPMqPpsJNWBc2Neu03K6+fPUlfsNwSrdB9oYXT1E+AMZuR invnu0/SkrR4wgyYw5PajAO6HvJkaABG6W/Rrb+2zc2DbamvPSmk9qqFMaluGizyCYB0 R3BEmWArAYwCYCXwiDI1JW4cZrG3fMGkUiN9+btDIK2BlG9vqqqHhvO9MnCH1gtMA5Ky wtKQ== 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=ZQuc1iVPc02ueqRsXy3dcfdBwbrL4UFeDLBK76pKe/I=; fh=O1Qs4jFmv89miYMBxjgcKW7/6e9v8WRZBIlMMJdhQYo=; b=F8JDF1QIIlm62CUVj3cpRq59R4MmwUxoeuVhynczC1sCTqJgiygCEGwb7S1Amivm9q fG3IryvhNzMa61AJSLJ5XtnBVc3xmBeUIOz+Uw4C8fvnnaPtdtWFwVZgVqpbTrqPNtvl F6L4qRC5j2VcB3hWu86MXcNQRiAhaxips2nUgeYSiL2b8EJYW0mm0TGunbnjDFg2JOVo GNJWciYbZmnLnPNBKk6aDNgyP5JIaMhYkj9Y9v9Ahe5YaKUJ1XJWl3pRhQNrR5Y+P3XV vmRuY9qIZAQe8Lr8YG9dRe/N7PGzv2ZBX2SeJ5rhdnET/mCnHwUw/LYkOKtXGsV8+WzL yCyQ==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=U9rSnxA9; spf=pass (google.com: domain of fm-294854-202411161113039de28eb26a3fb1f52a-u3al2b@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) smtp.mailfrom=fm-294854-202411161113039de28eb26a3fb1f52a-U3aL2b@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=1731755587; x=1732360387; 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=ZQuc1iVPc02ueqRsXy3dcfdBwbrL4UFeDLBK76pKe/I=; b=RJ4qP/0t3C4g7+nUJ9vf6K5eHa3za+dSPZ9K5jAx4K9PcOvwkJZ9lbs84VRaptCgPU m4oOwbT4SCTih/K5sgzvGPUXhnvSmVzrRbzV0CUvDVn8fpRtQLm3Lw5BX335X+xqCqDZ ZVbnui7BphgpdIzI0c6nv5upg1od049+tUx6uAPSw5LvvVT+8t75hjC/c2yZ5GwDWds7 JtcZdHKpg6hlhU4HtyxduhJreHU+pK+4XOjBO8i4Zm0P12iRaMR0VTug/bmm4FwnD3eU g1DgEzcvIMMXNF03+8m80I/Y2dqOKnrTP6hlG4MSuZ7g6k79axqa0Q+F9SpizBYnSxxz DtwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731755587; x=1732360387; 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=ZQuc1iVPc02ueqRsXy3dcfdBwbrL4UFeDLBK76pKe/I=; b=AfYk73mihkOc2kqwLWHnaaknAvYc1Cc//xdy5rkXvOXL4ko06bJL0V6U7pu1Fz3GwM pZ5BxhfoDO4erHZY2/5LmAezpZSq2SMsce4r9HYqC4VRcefiARSY5rqzvgJdROsz6X4b bcIvCde+nlQdLuGZXhYFMqbesu0ntJpOZoSNAx79Tvrw7his5woAVB7QLd5MKlhE4+oj FUdD03VgyAs0P7vkXtAJCM4PwZioBpxF57hrVwCLfzwZeQ2urnPo7jOS3VwWycEHMAiQ GPIa/ejU5Uh+FheTikcDKUB4PVNhtFUQXtphKT4NsPMdcZLoEa8z2JzW6pjhJrz1cA1O y5MQ== X-Forwarded-Encrypted: i=2; AJvYcCXtcmsdFpaWJ9BVs6ZOmT0fmMiCqA1P8XNmUyaQLbiVEcq3g4Wl7vTRYov9OTLcLhQsO5s35do=@isar-build.org X-Gm-Message-State: AOJu0Ywxgj5KA3uhSD7bw45auhxI4tzOPl9oHIYAWbgBOba3+Og0tFEC DMeu9PCMrJJN7FfBCDs+nU+TF7poDBnCLTh4FDwUcg2K/S9KKv5w X-Google-Smtp-Source: AGHT+IEOEr5Daq/4KS5Udu3tfLQb+lXr+NgU4ZYa6FITohq0MUaQn6WWEyraO9B/pAHo6oOddvLv/Q== X-Received: by 2002:a17:903:8ce:b0:211:f674:9d60 with SMTP id d9443c01a7336-211f674a0a8mr16866675ad.50.1731755587037; Sat, 16 Nov 2024 03:13:07 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6a00:c1:b0:724:69a1:a12 with SMTP id d2e1a72fcca58-72469a10aa5ls1924965b3a.2.-pod-prod-01-us; Sat, 16 Nov 2024 03:13:05 -0800 (PST) X-Received: by 2002:a05:6a00:99d:b0:71e:4c2f:5bed with SMTP id d2e1a72fcca58-72476cfc8b7mr8241095b3a.20.1731755585489; Sat, 16 Nov 2024 03:13:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731755585; cv=none; d=google.com; s=arc-20240605; b=fRLUxgosS2q6/9lTlSfduRE/rztfFilCrqRV8OPPSlvTgybjdLxCi966DQSzau3W3K BmqblolsjSKsiiJNNcSecdLCteSj9B7toXiSMZb7lTnnuBbdAYQsm2YD7dJ8Qvk0gD+c OxqUOvFtF35J+9dTH2V4DkefKRw0d5pIFDKJENw7nohUXK1bw1WhEcv0lpEb30Y0Exmh staV1rHQLrLGf7X3v88baXARtbvW7m93SrGL7TDijw+o1UTV4em2UUYMHpRSKzVf1DuT jx+a6G27lX06gW5sw9qrJwzcinXOb8p6kEyuFrq4QinsOHItECjv7rr5lPyg4cAh0CmD t/Yg== 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=fQHvASWLJyRJcqfT+za1He+euScmT5ksubrtewsJ/kH8BsaMAEo+MPn3LxjZekAOnH xwf3T5MDXxX4lVIelHA3tALTt5/6dHxrAuFksj462uMLbCzXAFUT5NqsfvlaQEuTdtBS HaAAdspOuYn03eAJoe/Zd+9IM2LofByJlkXULG9eM0rAYqTqx+MfA9+GFbP+vmclpkR2 WI7ThvrcR29NJOB15R8WLAfEb/Jv+QTU8kefcQvswmlXe56m9iDfMlXRnEUSgWoOIrsz 4y4J3hivjINf3xOpE2rx88SPGada/TJJ7avSUWya/kT+n/nne4FeQzHFoH4JywMUhQ6j 6dMg==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=U9rSnxA9; spf=pass (google.com: domain of fm-294854-202411161113039de28eb26a3fb1f52a-u3al2b@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) smtp.mailfrom=fm-294854-202411161113039de28eb26a3fb1f52a-U3aL2b@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-64-227.siemens.flowmailer.net (mta-64-227.siemens.flowmailer.net. [185.136.64.227]) by gmr-mx.google.com with ESMTPS id 41be03b00d2f7-7f8c1c2c4fasi182237a12.2.2024.11.16.03.13.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Nov 2024 03:13:05 -0800 (PST) Received-SPF: pass (google.com: domain of fm-294854-202411161113039de28eb26a3fb1f52a-u3al2b@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) client-ip=185.136.64.227; Received: by mta-64-227.siemens.flowmailer.net with ESMTPSA id 202411161113039de28eb26a3fb1f52a for ; Sat, 16 Nov 2024 12:13:03 +0100 X-Patchwork-Original-From: "'Jan Kiszka' via isar-users" From: Jan Kiszka To: isar-users Cc: Quirin Gylstorff Subject: [PATCH v4 3/7] isar-initramfs: Add initramfs-fsck-hook-ext4 Date: Sat, 16 Nov 2024 12:12: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=fm1 header.b=U9rSnxA9; spf=pass (google.com: domain of fm-294854-202411161113039de28eb26a3fb1f52a-u3al2b@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) smtp.mailfrom=fm-294854-202411161113039de28eb26a3fb1f52a-U3aL2b@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 Sat Nov 16 11:12: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: 3939 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-qv1-f64.google.com (mail-qv1-f64.google.com [209.85.219.64]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AGBDB4g014091 (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-qv1-f64.google.com with SMTP id 6a1803df08f44-6d3736a62b0sf37269576d6.1 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=QVgfz2k5dql5F6Qzr5vcu55bxTqDligdWCfWFVAvPS7uS7ZPxRub1aVJzP16iEr/od qVuBg12VuJ6RNZVa0TJAnSn7qXUZSseijUQW0VIiHM50P21lxB5hwEXso3uB4e2ZT4XH PTrJQvQa1+j84POtM9oAtGKnnfuIpQ8D2GlsfDqkbnPy5/03dPEqj0qy0KQczdMQQxx1 w4oOtPVmbaDxcvjwcyLaJ0C2d1kVKybJ+sP8dyxv9eimm39gSCEh3itwe5KNz993mYF4 gLqfvmKlYJvDxpSi4AeEUdDvIHu0oG1zgv1zqUz51dLpw2Lq1nIwfp4Gf02gfutjiWlu PITg== 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=saMfx7Gj6I9N0xfzMk1TbP/mL8Jh5T2Gi1zgPMDhNjE=; fh=QtyOmAfXVI8aREb+9B5EC6rIhtTdx8+ifyDeuXA0rDo=; b=iDMD3zdYy2VEwcr90GWshf1MNbJyYiYiQYG3HJfzTVnUlj2Rpo1XW3oVg+mIXN3YK8 Dz1IAYAMMjfuRKn2cfDNiVzyMGvHwGtS7J0nQOR5uuCkg1uGh4ibTe6mAc7YEu4Dgsyx MAjgjtOU/FsGqOUGRXVqPyVtdavdrnul4K310J4qMGTAfXbzNqAqEsCg99MkXqKoUAq6 FXSPXH3MSztYJYl7kteTe/lIWkUedTC3fX9Hd858sFjSesHONWP2CDvmrt85TIq4HXC8 u9XDDlAxB1pKOSLwr9/X07Cyyp36dn2U+fXMGaISF+nZnwuDP5C38pIpccqBED6BBoto t2CA==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=EFhiF4nK; spf=pass (google.com: domain of fm-294854-2024111611130332c36974c3773a3780-enuoa_@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-294854-2024111611130332c36974c3773a3780-eNUoa_@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=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=saMfx7Gj6I9N0xfzMk1TbP/mL8Jh5T2Gi1zgPMDhNjE=; b=LxQvbQ0/yg5gmA6XMigCOI9bCl5SO67wwzVIOrGsQPFoBV3attheeVBNSHUxONgV/o yScTYd8A3T80inzztVzhUAdZQSOkXqnZZP9tGFKW2N3+4/ZwlA93WaRfw66jZd/fLwJc +Q9gtd8Xt+gDs3n+kPcqZLm4m1Ar8VCK3rndJR//fiPE5YrNH6MJW4uFgspKpbTcJgu0 0mIMOx0Pvusz3ZDQ9EBheoS247PIQzV4W3YIcUvAz0sir2oh1T6UuYYfm9497fTccO+U wb6V2UWwoYs0hL+jQ0iXNOr8zQZmVdDR0Qjl7S6VP29aIo+D8KekVjZ+GjZ0Ow2ZFNqu baYw== 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=saMfx7Gj6I9N0xfzMk1TbP/mL8Jh5T2Gi1zgPMDhNjE=; b=gTRXWTKzs9jr7WZAtMrNhl25qcfL64LTJB0AVwq4lEcsedrKriHzjJeKTApfUXlZIG ulCLjoNqtEiS1vUSjZEgcqr5bzJn+/MN/QAfh9S04fwf5DzkLsxd7lrkQpGdsKdIMDZ3 eHw8nDC6w8fdHPRIdKfVhopnK9vTS3IgEFLQSRH3qebjALmiIu4Epiq5ZiEhd3zMb6jx RwGNQkNYE8eJGVuz098GdXWZzpNW5GIwyGsYwGvgNE41Qbc+P8E934ws/MutLHrVkZCg gpErxbDx859Uq3mMWYz9UC+3agXiaeNwYS3iuZ9OjVU9qiEw8hjgrqCXq4Yd/LJSxP7e enSQ== X-Forwarded-Encrypted: i=2; AJvYcCXkmBpa4vRNS494ST24EXKcIELs/Ajr11l0RuHGQLUgksp+Zzg2f3nbbyJS88kMCJbUxQuP48M=@isar-build.org X-Gm-Message-State: AOJu0YxvipdckquInzTmBiQ85gTFw7712Zvczm8kXym3ePihNIw94g6N 9OkEcZYPJ96+sxRRhGVPaFOvGeiqui7f64IwKqi2hpMRK05nOxPn X-Google-Smtp-Source: AGHT+IEqtb2CRYtHnmk/bBbKs6u6eA8DCkpTcKo2bbYmAxmmfXkYnsZ3kvN/TXoLVvW2lYcCQj/AEA== X-Received: by 2002:a05:6214:1244:b0:6d4:12c:c6c6 with SMTP id 6a1803df08f44-6d4012ccd63mr61574646d6.27.1731755585677; Sat, 16 Nov 2024 03:13:05 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:ad4:5aab:0:b0:6cb:d4f7:64e0 with SMTP id 6a1803df08f44-6d3e99ff026ls17502606d6.2.-pod-prod-09-us; Sat, 16 Nov 2024 03:13:04 -0800 (PST) X-Received: by 2002:a05:6214:5bc2:b0:6cb:ee08:c1e8 with SMTP id 6a1803df08f44-6d3fb7c5ca4mr99718626d6.23.1731755584616; 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=CGd2vMGiogzbpU72o0A7V1lMf9c0K9l/tyD6LDlbJEOz6stzz3XfH9NLt+uK/SF/wu pWOiq0Aot22euxPkuzkdJ2/VwT/vhVyBlWvi0QlV/r7npR9piRKzgvMLcEvc5YDBn/jP hK3ya23RrcmwDalWV1hbrK8rck8WuPEvzV820JvviqC/UKNlbvJ1Rp58+0izP2WtnuRt CUnUKzTEjaM8cWMt0ZHcRqFbmJoU/yEoLIbIafGcfaLd0UMkzcXoUMkJTRIPEG7cqzHi 7xHMHuA4lHX7tlJOz0hCVN7WawhCHFXBtdWh2vYM/0Pqw9Vycg12X3yujl221W2ZoZuL idaQ== 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=CNLl2MgZXQ97Nay1PCH9noRb0whYJXgj0R4PO9gfsmUzzWgGwuayURbZ0EsJ5nTXp0 xjwdUxqK+64lNaJg1KvNt/Jt47/RpNnxO/xchzrrNQNQYBUQbgEK9rSYr7LupDaBOhAX sEy10xlsM3UYJ2PFhxv3Riijw9lMb8vwI6nxs3wfPCJzj+jO5prYxtFMx3hzYsA/o0h6 7TLQQN+wcX5G7coGGJXh8JmtwO3A60eC5V5lLRwwtKUpp/Ehc3yf8bUxBX4tASUSk2yD CJeBnS3fLDjBO7kuEVI/iUMqXYvJbw+QPDLwSOmkdeACmZWGMkwnD79Z1LjNlT/ANRKj xPZA==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=EFhiF4nK; spf=pass (google.com: domain of fm-294854-2024111611130332c36974c3773a3780-enuoa_@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-294854-2024111611130332c36974c3773a3780-eNUoa_@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 6a1803df08f44-6d40dd32785si987546d6.8.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-2024111611130332c36974c3773a3780-enuoa_@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 2024111611130332c36974c3773a3780 for ; Sat, 16 Nov 2024 12:13:03 +0100 X-Patchwork-Original-From: "'Jan Kiszka' via isar-users" From: Jan Kiszka To: isar-users Cc: Quirin Gylstorff Subject: [PATCH v4 4/7] initramfs-isar-example-hook: Convert recipe over to new hook.inc Date: Sat, 16 Nov 2024 12:12:58 +0100 Message-ID: <2fa74c75e2558f0621766ad90a0e0b512a53deb3.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=EFhiF4nK; spf=pass (google.com: domain of fm-294854-2024111611130332c36974c3773a3780-enuoa_@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-294854-2024111611130332c36974c3773a3780-eNUoa_@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 Sat Nov 16 11:12: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: 3941 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:14 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-il1-f192.google.com (mail-il1-f192.google.com [209.85.166.192]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AGBDCrf014106 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 16 Nov 2024 12:13:13 +0100 Received: by mail-il1-f192.google.com with SMTP id e9e14a558f8ab-3a7162d1485sf29641065ab.0 for ; Sat, 16 Nov 2024 03:13:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1731755586; cv=pass; d=google.com; s=arc-20240605; b=PnnPCwMzjazY6xgxjFS6GDFsKXbHd48UeL3fIiU5pkthRnuVfzclIwTp7bxcWUm8uR LXhKnGLOb60zpZ33BIgVfU84E5Wovib6Q6f/xO3qSSTDmmHYkzvhkVxYy9UDr71vGX5u AmJ5gFs/2EyNHObQO5W6TlTQ5rhxkOW+v1uhm6O9HBdTnHcLgosOPxGWT/0S0hEPQfvD PEtPOrkhIHnhzE9wpWKqagZy4wqDRZf8euEPABXcYomQZqhYCpWntsAlGqGQMOk5vdZW 4mobJT3NZ9vVLiorZkGkWamWAmGTSj0rxZDPSzOXDpVWETtv8o/2u0briXspentfOdOC x+dQ== 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=gVrV8OUyzPmvCMrdtITmIIy9KKQ34Vtd4WmhqpTM9Xk=; fh=qQV4tWhDw9ZPvQXj9119xZ5vbpk9YxIfAO+QJJ/ih8w=; b=Jseyj2fcr5ig9+lkG81L0PQwiCftB/8eH8wd/FXI9qo3ZoMNmZtwuQcRGDGzZl/Tb8 JzdWEI9KsonuzaO0oWoLXveUqVmxPRINnFygDPpff0Cs0WzHP6XFCoeJ6OvHttOzPozy Nl1atzADvffQ7HkGU0gcZ93QVLIPGVajAfN0VgsSukwFmjA0HAwVpOCXhE9IzUXUYxCW X1I+tX5XoZNqI42XNSEdbxzcxxbuhTVhds/t4OA2HSr8NH/LwVWiyfGIifbftlCCRoPI ctJqqhw7RJ+l/YwmroCSHS8F856KtyDlhMw9716U3Uz92U/bFERnSfMlEznf7t2UvH4m N+Gw==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=ELggI2kF; spf=pass (google.com: domain of fm-294854-20241116111303ba56ff9b606745f27e-tawfy5@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-294854-20241116111303ba56ff9b606745f27e-taWfy5@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=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=gVrV8OUyzPmvCMrdtITmIIy9KKQ34Vtd4WmhqpTM9Xk=; b=XSK16X7SzTjmnqFj4MWtrX9HGviqjmRUYQ4p08l7VDuGgniEhF7uZJEgCVIV5WAe/M ERXgTG/ZU8Ho1nyn4F63Ui0v3OIORztzplFH3+tD7k3atMpwSBJrh2i+9gBYxg+DSD2c PAhm9rQCsWGuY7tCnz1BK6ex+H+tsybH1rV0LUORy/Km/eREYS8UJUQ5RNme9PGEHsEE 25SHLKYIwozJuqN4CPLR4YuCoIs+bV6d7qzsS1DT8P5IV50Tb18n4ulkihI7EwqrXaCp Uoe7k5PKesSd87tbs4jru0bIhUYZGJjMhpmLE7LwiLF8rxQ73I4i5jmbx3U0arsQI81e yK+A== 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=gVrV8OUyzPmvCMrdtITmIIy9KKQ34Vtd4WmhqpTM9Xk=; b=nwlAC/C/uENrDegW1VH1mRG2OF0GZzPczLTDPyqsAsI/X9rCRDpAQvmR4pMIcvtpaF PZ2C6mkOxYSqvLatBUzP07t29bkhqU4y+nEHXZ4dhpbNE28TsNZ7XKGEWy2GNOriWNfE WoxTO9GfyG7vzdcUXzSyOjSQ/7Nf9ADof4XSYZQr7Ng7KZ3JSevnDft/7HJrUY0zxvCu KujRUDcT97VFHUyUAZBEim/JKRsXjsY79L+oLpxOWy9Ydqun7Dyh9ACR0H5cQb/C5NH7 DkShYsd8UCeTaXR/ICALP/tXLRB824AXOopopogcBVo5+0OotBU/DnkqFGD44ZxjCDTI MdBg== X-Forwarded-Encrypted: i=2; AJvYcCXLopMyPzM4U0XUBXaUijzrZdlCZ2Z2VEEtWUTMSe2RxwnEBhOs2NGXR3PSQ2zKzmNlx7hU4h4=@isar-build.org X-Gm-Message-State: AOJu0YwNaAqe9n0OuZG9aHOiW3COxPhSaZ/OmfyvsvjySNfh3h+5W+/H AS6o5DPVU/KydplVPOyPVlV3pKKpR87z8ov6xozAslo48dYLXHKp X-Google-Smtp-Source: AGHT+IHroBM6hFF1wkncCK+FipYwOA5I5J/jfuNajmZpVs9f3XrQxXulsAQE17egRCfIvFFUOLSYvQ== X-Received: by 2002:a05:6e02:a:b0:3a6:c27a:6383 with SMTP id e9e14a558f8ab-3a74808784emr59892155ab.19.1731755586047; Sat, 16 Nov 2024 03:13:06 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a92:d30d:0:b0:3a7:450c:7e38 with SMTP id e9e14a558f8ab-3a7450c83c6ls12259855ab.1.-pod-prod-09-us; Sat, 16 Nov 2024 03:13:05 -0800 (PST) X-Received: by 2002:a05:6e02:13ab:b0:3a7:1e78:330b with SMTP id e9e14a558f8ab-3a748087658mr57247935ab.17.1731755585119; Sat, 16 Nov 2024 03:13:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731755585; cv=none; d=google.com; s=arc-20240605; b=gijNF4bnj+UXo0lDCd3W9u6YKVjpcymt3LQUxOzjXThJl+d799WsmhwdfHZ3Yx6Kcy g7bbVjBC6Ut+fsWBYpXpxtWZWJU94HJS/MCuIj2918msYv2CVt7iIk2Ppx0qIc8gbdc2 0k9IuT59qM76FbNmEiwbF6cv2Vs6DGYuzxqM4VDSZ37vrfFQasZ93DVz/H3mm2XczMZS tMVLcuWu8Rvgwy5cKeaNneVK1NN96jIT2ntqjKrLKmRF//hpAwxEDRl6HIQz0ypQ8ljT pU2BnDU1zZK7ZLoly2T6J9vvY960oFSC6lkYsgI8b2ot6aDJ8k5kFDsYZdSjwqtNrfCy FwrA== 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=ij2NVlY7ydw9uVPk0nL6wyhJIbNyLsD2ls2m2yPcaTx8zfFsiy6hM59zp2X67gLcEv tSl83YztT3mH4JvPgx9qMFii4J0tITofsg8KNbJZtwedT3685svBfCwedMya5H12oy4A hvltiLsg1e4M6piYRO3z6UD4BmRMXg7pqPyCTXNLpgEhS0g7sfrGBO+0QjiD5X/fyU8i WYNo2Ve0jNpYqN3+5XQxx5qVVuEyTxnCnB1vvnCfcwP+8NvzZZS4QBIQ737Sjv6ReSB/ 06emWkCVPo4dk/QrVJL5ToR44Rl3Z2d6kFPE10/BesAadrqFNLnp7m8CD203PoZUQMwh AiRw==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=ELggI2kF; spf=pass (google.com: domain of fm-294854-20241116111303ba56ff9b606745f27e-tawfy5@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-294854-20241116111303ba56ff9b606745f27e-taWfy5@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 8926c6da1cb9f-4e070b228acsi169917173.3.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:05 -0800 (PST) Received-SPF: pass (google.com: domain of fm-294854-20241116111303ba56ff9b606745f27e-tawfy5@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 20241116111303ba56ff9b606745f27e for ; Sat, 16 Nov 2024 12:13:03 +0100 X-Patchwork-Original-From: "'Jan Kiszka' via isar-users" From: Jan Kiszka To: isar-users Cc: Quirin Gylstorff Subject: [PATCH v4 5/7] initramfs-fsck-ext4-hook: Convert to hook.inc and improve Date: Sat, 16 Nov 2024 12:12:59 +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=fm1 header.b=ELggI2kF; spf=pass (google.com: domain of fm-294854-20241116111303ba56ff9b606745f27e-tawfy5@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-294854-20241116111303ba56ff9b606745f27e-taWfy5@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 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 Sat Nov 16 11:13: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: 3944 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:23:34 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-oo1-f63.google.com (mail-oo1-f63.google.com [209.85.161.63]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AGBNXCk014610 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 16 Nov 2024 12:23:33 +0100 Received: by mail-oo1-f63.google.com with SMTP id 006d021491bc7-5eb7a63c9f3sf250896eaf.0 for ; Sat, 16 Nov 2024 03:23:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1731756207; cv=pass; d=google.com; s=arc-20240605; b=LFvD3FDhiHaO3syIR7GVwErFGBivOUpqxhh/UEyLOCqGHtX44c/ptPyCrMlYRlJBVu 6ZF/2wY+My11AR8g3lPb1In5PGSKe60MyIrbI/Zu2rCL4Apu4GyNMjIWAUYLVBmDmrTT OSDzkdjdbSgjv5LD7yvMctLvBm9XBDO78klU2mvOsfHOCSOuB7dJJAEE+PmeDadYmF45 hKEZ4MOx2SJspE3L0PYEDuQeA4YhamDR8yMWwGrf9/d7/jnXAh+XYh7PIOAewoT9EZhK GSs1QRH1cL8OT0SYQU6FdUcFO8CnpU4/tf0cyyhmcZvM013CXfcggTh+RA6QeDaL3QnJ iO8Q== 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=LZk5t2yTXNwzMADi1HM5joFQbdJHitEGmdPrbXz0ETw=; fh=+ROseK/pHntZ7M2rQx5Zt9HY7Xdpa5mRNz19JRWeeys=; b=i+05aZIG2xys4TcZHCYwxg5HgnSAyylelMZB69D1akydkKp2RBiIEuox5dcSznUEX9 0uvpY7vIZ2lu5MjEVxDVh3n8Q+7VUo4xeKyz7wyYnBiuVMRiDlVLDnXjRnlUnAWoVcNi rM3pmTffvT6laGR8gYHEJROszmtKeZSqIcSO8VcIq0Xiege0pMpmOktjkpJlxj6xm4Z9 c3+AeEt17f56LMfeUDYsB3IkKd/VrI4H6ze/UZaBHAZwioSmdBKK6UA35rVv8S+e3g1i EwC18EY5WK+415O3DZZKWBlychMZiwlr5kE++uK0DX7nBtfTH4mGwBDXnhVi5qLXMDOR tMfQ==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=fXGlw93G; spf=pass (google.com: domain of fm-294854-2024111611130309ddf97faf0e50f43e-qlcyo_@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-294854-2024111611130309ddf97faf0e50f43e-QlCyO_@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=1731756207; x=1732361007; 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=LZk5t2yTXNwzMADi1HM5joFQbdJHitEGmdPrbXz0ETw=; b=qYt8ragUGEgu/1z9czrvEk6mprVgxkmLMDbJNgTjhhSMY2ErpsV3zCuu0iEve2b4dz J5IwNSGNQ6dDgRZl+S6liZZwdxNXk0RorA7TqOb2RKiLec7I++4NqJWF2CU90N8TsP4S KW+F2LskEmIPVKmY9kn78nlZe8f1ogPA3nPtH+ToFWfraC6U0rqpSF+Je9j0qlneHCfN 3symGdsa7U44kSAGjCztAseg9TGYiBSDsWuchWn0T5zMDRCY63bKA20+06W9RgJh0DHI aeVpJYiVWZCzuCmMGt76tonRagury9VgVj7vnUY7QVwtCT+OALlQFcphlfJ6bdl6VyDp dmGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731756207; x=1732361007; 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=LZk5t2yTXNwzMADi1HM5joFQbdJHitEGmdPrbXz0ETw=; b=UFLL8QRZEt7x0+aoQzpOCWgmwMIbq8LuDA69wOEzm0fdmEZQQNDfLeRtwyKdFaUS1z miPOrbN9PVcgu+qjdz0TFSknvCgtcZOXGEhCDZ48AgBCOY30QppSiNTYEt5n4S1pMS3i Sbbggd7b3OMaLxEXtqXJldRWm9dQIqgvM4vlt7VWYN0x7y573F0SaqH0D4ghXNLAX+jO rgx60+NnL+t/OkH06MqKA4cqpUqpZcEKgTLR+fGsqpltpA/Aaofcdc9q9DVQ6dwFpeBv CK/GkbMgAgENMfWDoB1Dq+5KWDgWO/FnrZZYnpuoSzyc3f0BEPdgKt4e/F3JiRz6OzMs LTfw== X-Forwarded-Encrypted: i=2; AJvYcCWYqhXVDgdDixW1r90p9z/5WynvJWXQ2GemUg8FA124Mzqnb8S0nKhcM/vmd8oHzvjzg1G72Mo=@isar-build.org X-Gm-Message-State: AOJu0YyU5GrAR+dF86VJdbPYq5VAcJKaiGvQ70eb2pdVJhuFw74JGKs9 b4Re02V39J8Eqb1D3SxCAim+GOVAfiUBES+9CPSh1L8eYbHMJj2U X-Google-Smtp-Source: AGHT+IGVwTc/9CXOl7JLGCrwfgM2EcXFrlFvoibu5ZmSvty/SEoKcnrt8cghs18zJ8x3yhOu88k1xw== X-Received: by 2002:a05:6a00:3d07:b0:71e:b1dc:f255 with SMTP id d2e1a72fcca58-72476b974a1mr8145890b3a.9.1731755587427; Sat, 16 Nov 2024 03:13:07 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a62:e119:0:b0:724:682e:c1d with SMTP id d2e1a72fcca58-724873ab743ls458240b3a.2.-pod-prod-05-us; Sat, 16 Nov 2024 03:13:06 -0800 (PST) X-Received: by 2002:a05:6a00:4b04:b0:71e:427a:68de with SMTP id d2e1a72fcca58-72476cefac1mr8479932b3a.24.1731755585885; Sat, 16 Nov 2024 03:13:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731755585; cv=none; d=google.com; s=arc-20240605; b=RMgnycx9YFEFXLTVbtZMmZPMutne2vF7t9icbSF2NVQbwvjCdXByHQ1/RDHlcl/OZG Xto3lYiElPNjvgqhXtdiDixL8Qz40Ec/UM56NutoPxQhnwZpyeRooKWbetXFBct+gKjT jwWLZ62rNw8QMkpYdmd2yERwhBLLAhmJMuaiTClqV/rkKMAG6oOxbTUo0FfoX/Uif+f2 sr+W3EYcmGrhWwG9ftQxssnSAv8+9t4TScIoLYwk6Nlz6pk0p3SXwKaH2BgIhrFyPrJh K+TUr5h0F00pvFthYZbLa2dU3F5D8f9gstMUuh9uOqkcwxxSmyTHQhSf2NF9c/lwb1M7 EkWg== 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=gsW0OQywImYegnlTm07QjtUITCsuqgLqevqQ5vhEt0ndhspbCsxWnEMDgs6TbTkTZC nU9tGHACTQZEjxFzcJUQxtC0GCjtqdab2B6315/MuLW02v0IpedQOA9Zf+79OtALa9S1 yNUA8Wfhu+ngwYcwASt5hVlwfhkca4yUazF2iF5r7Ksec9ecQaOFqGtyE1QEwbPilaP6 gjx3XMHJ2gOFPQXDJkgNjTEIz2fZ0jDDSYyXAkAhABAO/IbDEpXYz8Np6ryw5oKyZJpV 4Gh8F7oPsycPeetBOvECwvHJCJiJGrPrYGC5oBBelRYZfiCSH8IWCoyiP+wmwHBqY1Yr GzuA==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=fXGlw93G; spf=pass (google.com: domain of fm-294854-2024111611130309ddf97faf0e50f43e-qlcyo_@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-294854-2024111611130309ddf97faf0e50f43e-QlCyO_@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 41be03b00d2f7-7f8c1c2c4fasi182239a12.2.2024.11.16.03.13.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Nov 2024 03:13:05 -0800 (PST) Received-SPF: pass (google.com: domain of fm-294854-2024111611130309ddf97faf0e50f43e-qlcyo_@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 2024111611130309ddf97faf0e50f43e for ; Sat, 16 Nov 2024 12:13:03 +0100 X-Patchwork-Original-From: "'Jan Kiszka' via isar-users" From: Jan Kiszka To: isar-users Cc: Quirin Gylstorff Subject: [PATCH v4 6/7] initramfs-tee-ftpm-hook: Convert to hook.inc Date: Sat, 16 Nov 2024 12:13:00 +0100 Message-ID: <1f96d3e74a67372db3433e5cb1aa56d69f482bd8.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=fXGlw93G; spf=pass (google.com: domain of fm-294854-2024111611130309ddf97faf0e50f43e-qlcyo_@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-294854-2024111611130309ddf97faf0e50f43e-QlCyO_@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 Sat Nov 16 11:13: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: 3943 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:16 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-il1-f188.google.com (mail-il1-f188.google.com [209.85.166.188]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AGBDELw014127 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 16 Nov 2024 12:13:15 +0100 Received: by mail-il1-f188.google.com with SMTP id e9e14a558f8ab-3a3b9c5bcd8sf28648815ab.2 for ; Sat, 16 Nov 2024 03:13:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1731755587; cv=pass; d=google.com; s=arc-20240605; b=Pxr5M05hahcU/OX9K2nzJPDW61DL4kPmmB9Dq4AP3hEO06LE9FBmgnMckJJZzrEz0Y m9EHbHgLMtLL2fwQCaJ/9vWYpnpTAz26+REGsGO0EqqbSDd6+NT7mH9BCII0s5oP7/u+ 7Jj8tnMXfrnX7R6/QhlksPre7kXBeKCbtz7VDQ/GAoa0AgxNFs3FXkArnsH1cQhydGmU Ljd8H4QyibM0KLem8PUIzaueIbJbWZwKRtwfOBvvOihXflVwu9rnp3ZdKo2Yt/g9+1Bs BrHQI+L0VooOGL9AoHc0DT4tzuGEKTVZp5x9Uwy5KKPdFX7CX2c0sQamJDeT1oIQKwl6 zKaw== 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=ssCGL7Kt67gSQudihm+dmUvEGo4LP1NC8510eTEgtqo=; fh=GrQnMbFfXWgLPGfApD0h02jYyjFCGkkh8DkIAjXiDXw=; b=d4G69sVPdDBtr11giR3te4OW8Qk8BJDSRNYjQuvxrxrkDsiAIOBB4w3bIJNAX3+Xpn eke0HAH99SLxiWoo089zEYT8E7WuWpsqWmVpW5MyJQ71Wp2xqtPai95uJTPn4ylStTuF 2gWFJoahhlq7TxbawEU7q+t+s2n8JN5UCFWuVDFAtKEV3H0cBzzJfLUafC3xN+rc7n3H GiU3lU2qRknjDp0VTpFUOu9a/L7G4yuqp2SDaXXYtVoYN4d+LhSR2xjzQZQEZJ1d060p v2gC6rOrZ7POWXNEtDRLCXhcg85aaegAwnAvIV9pHHCwwu3ArNvL3Wjt00+J0t7nHhZy Sehw==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=SJajFvHB; spf=pass (google.com: domain of fm-294854-20241116111303e838f386c6cce3192c-40gamc@rts-flowmailer.siemens.com designates 185.136.65.228 as permitted sender) smtp.mailfrom=fm-294854-20241116111303e838f386c6cce3192c-40gamc@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=1731755587; x=1732360387; 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=ssCGL7Kt67gSQudihm+dmUvEGo4LP1NC8510eTEgtqo=; b=IpORMg4POmw2Oyx3n4oKCrV6418LUCaTwzGPBEdmOU0Gfdq0MH9BrPQvuviCZo16WS Zt1OkQYh0lsmNdOVlrLpm4ehySEGqKkoPjRINAI/1KY5DkKO5E35BWdY5j+voxGavetM r1HQVapESs0bfYlCwyEpnlW4sPixue8mM9PmSGmABKIld9VU2MaCflO3J39yP0tGeJ+q ibFS1kqVO25Q0MMrprhoZoONm2Oq61S/orSImYTvQYy6I3fHNud6yMwS2eFPoTgZXoc8 ZzlkIt7coh/TKknx0YCptEeXauLgN0vw8a93aj1QbsY8ypYqvEC2dx6VMDCqTwUVYK0a avMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731755587; x=1732360387; 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=ssCGL7Kt67gSQudihm+dmUvEGo4LP1NC8510eTEgtqo=; b=uPF5E7irt6dGYuoUn3o3YjSA/6d27gBMJprDmpoZqgMeSGzjcU+E30JnXPG8hrZNaq XdRluGuz8dBRqCHbXn4bwcIiuy0+JR1rVPsNMfAS7mmSgVXSUqDhR4FVL+cZYPutjv0g zDboSu+LeJeHUj054nBBa1nbVEHAMMiCCZmudPpIhIhwMJ18290tm9ZvfBTxCPYxXpWA B8Ku6/ccRP9eOxStJNies6Mgef9Fmyp4bo43QlnEVMvoyL6QKkJCmGlyyZqIsB5FD6Th YRWA6P0kFzFJVVaBsViCBYX9KcORmGEMDvPBH+7gboThisQUTgpr/sA/660JrlmCSDs/ MIXg== X-Forwarded-Encrypted: i=2; AJvYcCWrrhrUigla0VvHMhy76to86zFLEOfu9uGhjNnzYoXc4PBHfKbONjdn4O+vV3+tYPXJkUafBhY=@isar-build.org X-Gm-Message-State: AOJu0YyGCHuopei9cMdX+gjo8Wy12FgnfkJ05GGrqjxpiIjje9cTymJz o3nMl6H6eBhQOeqntqYZLG5M02yzDg+m6YF4n28KUJfAaleSbr3B X-Google-Smtp-Source: AGHT+IHJaHNpIt0ugjQyVwynqAezAzE1Ei4V0zzRODUmXiDdmXNr3oaG4z5nX5fdK3kAYcYPTQxDXA== X-Received: by 2002:a05:6e02:1a02:b0:3a5:e7e2:1f81 with SMTP id e9e14a558f8ab-3a74800e7c0mr70181345ab.6.1731755586741; Sat, 16 Nov 2024 03:13:06 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a92:dcc4:0:b0:3a7:28e3:26f4 with SMTP id e9e14a558f8ab-3a728e327c5ls13165675ab.2.-pod-prod-09-us; Sat, 16 Nov 2024 03:13:05 -0800 (PST) X-Received: by 2002:a05:6602:6403:b0:82d:129f:acb6 with SMTP id ca18e2360f4ac-83e6c2ea1a9mr579882839f.14.1731755585698; Sat, 16 Nov 2024 03:13:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731755585; cv=none; d=google.com; s=arc-20240605; b=dFMYLjGPKScX4qgOoGGOCtz5qOz8DwfSvQXzLjTeOOR03L5jF8FIiEf/9ifAgrIeUQ M6O8kUWsCLLcztVw0JWDf7yIE4kVDh9LfGDjPAO7SwvqrIkA0Gu216CE9Qcp7PcTINJy F9XOBg3k5T4ZOPQFBQxurHoPagMsNkHu1OVx4+rpKs9gJBuZud9MqVNzcwLGy8UEoBzq 5GDEcyW+7dXJbO0Koonu2Zi+JtiJY+/xGIUQTdIepH2htPrTaiLRf4CejD/jYUBl0X4s 08Jy0DQMCHFpYc0MIiQo1vYz5bCD+3AXsrSOzfcAiFqbdsXoOMXRUhfq6C4yHdzwIbqd EciQ== 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=GD8khWzQAPApjJCj5fea/RMDADjhonDeg66knqc8+AqeqoS4/VX1xiUSgNr7PB8iRJ 5BS4iwl0/D7MBN5EVnTQmED/4k9e4zo0zrqEXq4MrmKbB325Yk2zm/ldPM7+TqQLcrw3 qmIW61NcP5ZET5fxy3Q5Buhuhs5xSJ7S7eb0sCDax0jdbdalBFmoiPzhJi9XE6fgcSTC CSLzdyvcz8KBk3wEQyD0KG8s6QLvlH0YXaDECEkV0+TmeY2ilo249ITXtgFlF4avsZll Ri6AEIdjN9sZvMHULQt0m4aAZsfUkQkJOLlsCWTCzhHT5860w92HBTobgRYNToUYT70P 4YiQ==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=SJajFvHB; spf=pass (google.com: domain of fm-294854-20241116111303e838f386c6cce3192c-40gamc@rts-flowmailer.siemens.com designates 185.136.65.228 as permitted sender) smtp.mailfrom=fm-294854-20241116111303e838f386c6cce3192c-40gamc@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-65-228.siemens.flowmailer.net (mta-65-228.siemens.flowmailer.net. [185.136.65.228]) by gmr-mx.google.com with ESMTPS id ca18e2360f4ac-83e6e0e3636si14602139f.3.2024.11.16.03.13.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Nov 2024 03:13:05 -0800 (PST) Received-SPF: pass (google.com: domain of fm-294854-20241116111303e838f386c6cce3192c-40gamc@rts-flowmailer.siemens.com designates 185.136.65.228 as permitted sender) client-ip=185.136.65.228; Received: by mta-65-228.siemens.flowmailer.net with ESMTPSA id 20241116111303e838f386c6cce3192c for ; Sat, 16 Nov 2024 12:13:03 +0100 X-Patchwork-Original-From: "'Jan Kiszka' via isar-users" From: Jan Kiszka To: isar-users Cc: Quirin Gylstorff Subject: [PATCH v4 7/7] initramfs-tee-supplicant-hook: Convert to hook.inc Date: Sat, 16 Nov 2024 12:13:01 +0100 Message-ID: <58cdc85e0cbfd0a8a5f9ca752124d9ee56ca675c.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=SJajFvHB; spf=pass (google.com: domain of fm-294854-20241116111303e838f386c6cce3192c-40gamc@rts-flowmailer.siemens.com designates 185.136.65.228 as permitted sender) smtp.mailfrom=fm-294854-20241116111303e838f386c6cce3192c-40gamc@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 --- .../{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"