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"