On 11/13/2024 11:48 PM, Aashvij Shenai wrote:
Kernel configs that are important for SELinux to be included in the
Linux kernel are present in the meta-selinux layer.

Ideally, we wouldn't want to be calling a file from another
layer since it would become messy. However, bringing those configs
into meta-ti layer would hit maintainbility issues.

The root cause of this problem lies in the recipe name. While
meta-selinux names their bbapend as linux_yocto_%.bbappend, TI has their
recipe named as linux-ti-staging_%.bb

Signed-off-by: Aashvij Shenai <[email protected]>
---
  .../linux/linux-ti-staging_%.bbappend             | 15 +++++++++++++++
  1 file changed, 15 insertions(+)
  create mode 100644 
meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_%.bbappend

diff --git a/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_%.bbappend 
b/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_%.bbappend
new file mode 100644
index 00000000..460df5de
--- /dev/null
+++ b/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_%.bbappend
@@ -0,0 +1,15 @@
+# The meta-selinux layer includes an selinux.cfg file containing
+# configs necessary for the Linux kernel to enable SELinux
+
+# In order to reduce maintainability issues, the file will
+# be retained in meta-selinux layer
+
+FILESEXTRAPATHS:prepend := "${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 
'${TOPDIR}/../sources/meta-selinux/recipes-kernel/linux/files:', '', d)}"

NAK. We cannot hard code paths like this. This assumes several things about our layer-config and directory structure that is not present in all use cases of the meta-ti layer for all customers. We cannot accept this patch as is.

I just tested the following:

require ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'recipes-kernel/linux/linux-yocto_selinux.inc', '', d)}

And it works fine. It pulls in the file from meta-selinux without needing a bunch of other fluff.


+SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 
'file://selinux.cfg', '', d)}"
+
+do_configure:append() {
+    if echo "${DISTRO_FEATURES}" | grep -q "selinux"; then
+        cat ${WORKDIR}/selinux.cfg >> ${B}/.config
+    fi
+}
\ No newline at end of file

--
Ryan Eatmon                [email protected]
-----------------------------------------
Texas Instruments, Inc.  -  LCPD  -  MGTS
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#18068): 
https://lists.yoctoproject.org/g/meta-ti/message/18068
Mute This Topic: https://lists.yoctoproject.org/mt/109569106/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-ti/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to