[meta-ti][master][PATCH v5 3/3] ti-core-initramfs: Enable initramfs for LUKS encryption

Shiva Tripathi <[email protected]>
Newsgroups org.yoctoproject.lists.meta-ti
Message-ID <[email protected]>
Add DISTRO_FEATURES 'luks' check to automatically enable initramfs
generation when LUKS encryption is requested. This follows the
existing pattern for TI_CORE_INITRAMFS_KERNEL_MODULES.

Modify packagegroup-ti-core-initramfs to conditionally include the
LUKS encryption module using dual gating - the module is included
only when both 'luks' DISTRO_FEATURE and 'optee-ftpm' MACHINE_FEATURE
are enabled.

Signed-off-by: Shiva Tripathi <[email protected]>
---
 meta-ti-bsp/conf/machine/include/ti-core-initramfs.inc         | 2 +-
 .../recipes-ti/initramfs/packagegroup-ti-core-initramfs.bb     | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta-ti-bsp/conf/machine/include/ti-core-initramfs.inc b/meta-ti-bsp/conf/machine/include/ti-core-initramfs.inc
index 9d3cc612..15c05e04 100644
--- a/meta-ti-bsp/conf/machine/include/ti-core-initramfs.inc
+++ b/meta-ti-bsp/conf/machine/include/ti-core-initramfs.inc
@@ -5,7 +5,7 @@
 #   TI_CORE_INITRAMFS_ENABLED = "0"
 #
 #------------------------------------------------------------------------------
-TI_CORE_INITRAMFS_ENABLED ?= "${@ '1' if d.getVar('TI_CORE_INITRAMFS_KERNEL_MODULES') or d.getVar('TI_CORE_INITRAMFS_EXTRA_INSTALL') else '0'}"
+TI_CORE_INITRAMFS_ENABLED ?= "${@ '1' if d.getVar('TI_CORE_INITRAMFS_KERNEL_MODULES') or d.getVar('TI_CORE_INITRAMFS_EXTRA_INSTALL') or bb.utils.contains('DISTRO_FEATURES', 'luks', True, False, d) else '0'}"
 
 TI_CORE_INITRAMFS_KERNEL_MODULES ?= ""
 TI_CORE_INITRAMFS_EXTRA_INSTALL ?= ""
diff --git a/meta-ti-bsp/recipes-ti/initramfs/packagegroup-ti-core-initramfs.bb b/meta-ti-bsp/recipes-ti/initramfs/packagegroup-ti-core-initramfs.bb
index a9eff847..12713437 100644
--- a/meta-ti-bsp/recipes-ti/initramfs/packagegroup-ti-core-initramfs.bb
+++ b/meta-ti-bsp/recipes-ti/initramfs/packagegroup-ti-core-initramfs.bb
@@ -8,6 +8,8 @@ inherit packagegroup
 
 TI_CORE_INITRAMFS_KERNEL_MODULES ?= ""
 
+LUKS_ENCRYPTION ?= "${@bb.utils.contains('MACHINE_FEATURES', 'optee-ftpm', 'initramfs-module-luks-ftpm', '', d)}"
+
 RDEPENDS:${PN} += "\
     ${TI_CORE_INITRAMFS_KERNEL_MODULES} \
     ${VIRTUAL-RUNTIME_base-utils} \
@@ -22,4 +24,5 @@ RDEPENDS:${PN} += "\
     initramfs-module-udev \
     initramfs-module-nfsrootfs \
     nfs-utils-mount \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'luks', '${LUKS_ENCRYPTION}', '', d)} \
 "
-- 
2.34.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.