deleted file mode 100644
@@ -1,24 +0,0 @@
-#!/bin/sh
-# Copyright (C) Siemens AG, 2020-2022
-#
-# SPDX-License-Identifier: MIT
-
-PREREQ=""
-
-prereqs()
-{
- echo "$PREREQ"
-}
-
-case $1 in
-prereqs)
- prereqs
- exit 0
- ;;
-esac
-
-. /usr/share/initramfs-tools/scripts/functions
-. /usr/share/initramfs-tools/hook-functions
-
-copy_exec /usr/bin/lsblk
-copy_file library /usr/share/abrootfs/image-uuid.env /usr/share/abrootfs/image-uuid.env
new file mode 100644
@@ -0,0 +1,5 @@
+# Copyright (C) Siemens AG, 2020-2022
+#
+# SPDX-License-Identifier: MIT
+
+copy_file library /usr/share/abrootfs/image-uuid.env /usr/share/abrootfs/image-uuid.env
similarity index 100%
rename from recipes-initramfs/initramfs-abrootfs-hook/files/abrootfs.script
rename to recipes-initramfs/initramfs-abrootfs-hook/files/local-top-complete
similarity index 61%
rename from recipes-initramfs/initramfs-abrootfs-hook/initramfs-abrootfs-hook_0.1.bb
rename to recipes-initramfs/initramfs-abrootfs-hook/initramfs-abrootfs-hook_0.2.bb
@@ -1,7 +1,7 @@
#
# CIP Core, generic profile
#
-# Copyright (c) Siemens AG, 2020-2022
+# Copyright (c) Siemens AG, 2020-2024
#
# Authors:
# Quirin Gylstorff <quirin.gylstorff@siemens.com>
@@ -9,17 +9,19 @@
#
# SPDX-License-Identifier: MIT
+require recipes-initramfs/initramfs-hook/hook.inc
-inherit dpkg-raw
-
-DEBIAN_DEPENDS = "initramfs-tools"
+DEBIAN_DEPENDS .= ", util-linux"
DEBIAN_CONFLICTS = "initramfs-verity-hook"
-SRC_URI += "file://abrootfs.hook \
- file://abrootfs.script"
+SRC_URI += " \
+ file://hook \
+ file://local-top-complete"
ABROOTFS_IMAGE_RECIPE ?= "cip-core-image"
+HOOK_COPY_EXECS = "lsblk"
+
# This is defined in image.bbclass which cannot be used in a package recipe.
# However, we need to use IMAGE_FULLNAME to pick up any extensions of it.
IMAGE_FULLNAME ??= "${ABROOTFS_IMAGE_RECIPE}-${DISTRO}-${MACHINE}"
@@ -27,19 +29,12 @@ IMAGE_FULLNAME ??= "${ABROOTFS_IMAGE_RECIPE}-${DISTRO}-${MACHINE}"
IMAGE_UUID_ENV_FILE = "${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.uuid.env"
do_install[depends] += "${ABROOTFS_IMAGE_RECIPE}:do_generate_image_uuid"
-do_install[cleandirs] += " \
- ${D}/usr/share/initramfs-tools/hooks \
- ${D}/usr/share/abrootfs \
- ${D}/usr/share/initramfs-tools/scripts/local-top"
+do_install[cleandirs] += "${D}/usr/share/abrootfs"
-do_install() {
+do_install:append() {
if [ -f "${IMAGE_UUID_ENV_FILE}" ]; then
install -m 0600 "${IMAGE_UUID_ENV_FILE}" "${D}/usr/share/abrootfs/image-uuid.env"
else
bberror "Did not find ${IMAGE_UUID_ENV_FILE}. initramfs will not be build correctly!"
fi
- install -m 0755 "${WORKDIR}/abrootfs.script" \
- "${D}/usr/share/initramfs-tools/scripts/local-top/abrootfs"
- install -m 0755 "${WORKDIR}/abrootfs.hook" \
- "${D}/usr/share/initramfs-tools/hooks/abrootfs"
}