diff mbox series

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

Message ID 20260306163735.1316257-4-s-tripathi1@ti.com
State New
Headers show
Series Add LUKS encryption with fTPM support | expand

Commit Message

Shiva Tripathi March 6, 2026, 4:37 p.m. UTC
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 <s-tripathi1@ti.com>
---
 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 mbox series

Patch

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)} \
 "