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
@@ -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
deleted file mode 100644
@@ -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"
deleted file mode 100644
@@ -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"
-}
new file mode 100644
@@ -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"