[meta-selinux][PATCH] refpolicy_common: strip POLICY_CUSTOM_BUILDOPT before passing to make

Chiluka Rohith <[email protected]>
Newsgroups org.yoctoproject.lists.yocto-patches
Message-ID <[email protected]>
POLICY_CUSTOM_BUILDOPT is passed directly to the refpolicy make command
as CUSTOM_BUILDOPT. When layers use ':append' to extend this variable
(e.g. POLICY_CUSTOM_BUILDOPT:append:distro = " option"), BitBake
introduces a leading space. Passing that raw value to make causes:

  make: *** No rule to make target 'option'.  Stop.

Signed-off-by: Chiluka Rohith <[email protected]>
---
 recipes-security/refpolicy/refpolicy_common.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/recipes-security/refpolicy/refpolicy_common.inc b/recipes-security/refpolicy/refpolicy_common.inc
index 014714c..1566591 100644
--- a/recipes-security/refpolicy/refpolicy_common.inc
+++ b/recipes-security/refpolicy/refpolicy_common.inc
@@ -126,7 +126,7 @@ EXTRA_OEMAKE = "NAME=${POLICY_NAME} \
     DIRECT_INITRC=${POLICY_DIRECT_INITRC} \
     SYSTEMD=${POLICY_SYSTEMD} \
     MONOLITHIC=${POLICY_MONOLITHIC} \
-    CUSTOM_BUILDOPT=${POLICY_CUSTOM_BUILDOPT} \
+    CUSTOM_BUILDOPT=${@d.getVar('POLICY_CUSTOM_BUILDOPT').strip()} \
     QUIET=${POLICY_QUIET} \
     MLS_SENS=${POLICY_MLS_SENS} \
     MLS_CATS=${POLICY_MLS_CATS} \
-- 
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.