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 v5 6/7] initramfs-tee-ftpm-hook: Convert to hook.inc
Date: Wed, 20 Nov 2024 18:03:00 +0100 [thread overview]
Message-ID: <9c99494b0bbaf84f50cd70388372d5309224afc2.1732122181.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1732122181.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>
---
.../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 <baocheng.su@siemens.com>
-#
-# 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 <baocheng.su@siemens.com>
-#
-# 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 <baocheng.su@siemens.com>
+#
+# 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"
--
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/9c99494b0bbaf84f50cd70388372d5309224afc2.1732122181.git.jan.kiszka%40siemens.com.
next prev parent reply other threads:[~2024-11-20 17:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-20 17:02 [PATCH v5 0/7] Simplify writing initramfs hooks 'Jan Kiszka' via isar-users
2024-11-20 17:02 ` [PATCH v5 1/7] initramfs-hook: Add infrastructure to ease writing hooks 'Jan Kiszka' via isar-users
2024-11-20 17:02 ` [PATCH v5 2/7] doc: Describe initramfs customizations 'Jan Kiszka' via isar-users
2024-11-20 17:02 ` [PATCH v5 3/7] isar-initramfs: Add initramfs-fsck-hook-ext4 'Jan Kiszka' via isar-users
2024-11-20 17:02 ` [PATCH v5 4/7] initramfs-isar-example-hook: Convert recipe over to new hook.inc 'Jan Kiszka' via isar-users
2024-11-20 17:02 ` [PATCH v5 5/7] initramfs-fsck-ext4-hook: Convert to hook.inc and improve 'Jan Kiszka' via isar-users
2024-11-20 17:03 ` 'Jan Kiszka' via isar-users [this message]
2024-11-20 17:03 ` [PATCH v5 7/7] initramfs-tee-supplicant-hook: Convert to hook.inc 'Jan Kiszka' via isar-users
2024-11-20 18:02 ` [PATCH v5 0/7] Simplify writing initramfs hooks 'Jan Kiszka' via isar-users
2024-12-02 5:59 ` 'Jan Kiszka' via isar-users
2024-12-02 8:04 ` Uladzimir Bely
2024-12-02 9:19 ` Uladzimir Bely
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=9c99494b0bbaf84f50cd70388372d5309224afc2.1732122181.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