[yocto] [meta-selinux][PATCH] iproute2: make packageconfig selinux work

kai.kang at windriver.com kai.kang at windriver.com
Thu Sep 22 19:36:11 PDT 2016


From: Kai Kang <kai.kang at windriver.com>

iproute2 calls command pkg-config to check whether libselinux exists
then enable or disable selinux support. That makes packageconfig doesn't
work.

The packageconfig selinux is set by checking whether distro feature
selinux exists in with-selinux.bbclass. Modify the configure result file
with same criteria.

Signed-off-by: Kai Kang <kai.kang at windriver.com>
---
 recipes-connectivity/iproute2/iproute2_%.bbappend | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/recipes-connectivity/iproute2/iproute2_%.bbappend b/recipes-connectivity/iproute2/iproute2_%.bbappend
index c1e8ed6..c866b54 100644
--- a/recipes-connectivity/iproute2/iproute2_%.bbappend
+++ b/recipes-connectivity/iproute2/iproute2_%.bbappend
@@ -1 +1,9 @@
 inherit with-selinux
+
+do_configure_append() {
+	if ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'true', 'false', d)}; then
+		sed -i 's/\(HAVE_SELINUX:=\).*/\1y/' ${B}/Config
+	else
+		sed -i 's/\(HAVE_SELINUX:=\).*/\1n/' ${B}/Config
+	fi
+}
-- 
2.9.3




More information about the yocto mailing list