From: "'Jan Kiszka' via isar-users" <isar-users@googlegroups.com>
To: isar-users <isar-users@googlegroups.com>
Cc: Quirin Gylstorff <quirin.gylstorff@siemens.com>
Subject: [PATCH v4 7/7] initramfs-tee-supplicant-hook: Convert to hook.inc
Date: Sat, 16 Nov 2024 12:13:01 +0100 [thread overview]
Message-ID: <58cdc85e0cbfd0a8a5f9ca752124d9ee56ca675c.1731755581.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1731755581.git.jan.kiszka@siemens.com>
From: Jan Kiszka <jan.kiszka@siemens.com>
Reduces the own bits significantly.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
.../{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 <baocheng.su@siemens.com>
-#
-# 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 <baocheng.su@siemens.com>
-#
-# 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 <baocheng.su@siemens.com>
+#
+# 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"
--
2.43.0
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/58cdc85e0cbfd0a8a5f9ca752124d9ee56ca675c.1731755581.git.jan.kiszka%40siemens.com.
prev parent reply other threads:[~2024-11-16 11:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-16 11:12 [PATCH v4 0/7] Simplify writing initramfs hooks 'Jan Kiszka' via isar-users
2024-11-16 11:12 ` [PATCH v4 1/7] initramfs-hook: Add infrastructure to ease writing hooks 'Jan Kiszka' via isar-users
2024-11-18 14:35 ` 'Jan Kiszka' via isar-users
2024-11-16 11:12 ` [PATCH v4 2/7] doc: Describe initramfs customizations 'Jan Kiszka' via isar-users
2024-11-16 11:12 ` [PATCH v4 3/7] isar-initramfs: Add initramfs-fsck-hook-ext4 'Jan Kiszka' via isar-users
2024-11-16 11:12 ` [PATCH v4 4/7] initramfs-isar-example-hook: Convert recipe over to new hook.inc 'Jan Kiszka' via isar-users
2024-11-16 11:12 ` [PATCH v4 5/7] initramfs-fsck-ext4-hook: Convert to hook.inc and improve 'Jan Kiszka' via isar-users
2024-11-16 11:13 ` [PATCH v4 6/7] initramfs-tee-ftpm-hook: Convert to hook.inc 'Jan Kiszka' via isar-users
2024-11-16 11:13 ` 'Jan Kiszka' via isar-users [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=58cdc85e0cbfd0a8a5f9ca752124d9ee56ca675c.1731755581.git.jan.kiszka@siemens.com \
--to=isar-users@googlegroups.com \
--cc=jan.kiszka@siemens.com \
--cc=quirin.gylstorff@siemens.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox