diff mbox series

[v2,2/4] refpolicy_common: ensure we start from a clean state in do_compile

Message ID 20261122061122.2042600-3-chenqi_hycx@cetc.com.cn
State New
Headers show
Series meta-selinux: fix systemd 262 denials and run the SELinux tests on every variant | expand

Commit Message

Chen Qi Nov. 22, 2026, 6:11 a.m. UTC
From: Chen Qi <chenqi_hycx@cetc.com.cn>

The `bare` make target is to "delete all remaining generated files,
including modules.conf, and booleans.conf."[1]

If we don't do 'make bare' at the start of do_compile, legacy build
artifacts such as booleans.conf, generated_definitions.conf, etc.
will remain there, making the building results unexpected.

For example, if we enable ssh_sysadm_login in legacy build directory,
things just don't take effect because even if do_compile is re-run
due to signature change, the generated_definitions.conf will not be
updated.

[1] https://github.com/SELinuxProject/refpolicy/blob/main/doc/BUILD_INSTALL.md#general-make-targets

Signed-off-by: Chen Qi <chenqi_hycx@cetc.com.cn>
---
 recipes-security/refpolicy/refpolicy_common.inc | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/recipes-security/refpolicy/refpolicy_common.inc b/recipes-security/refpolicy/refpolicy_common.inc
index 4b5108a..3f629bc 100644
--- a/recipes-security/refpolicy/refpolicy_common.inc
+++ b/recipes-security/refpolicy/refpolicy_common.inc
@@ -193,6 +193,7 @@  set_policy_booleans() {
 }
 
 do_compile() {
+    oe_runmake bare
     if [ -f "${WORKDIR}/modules.conf" ] ; then
         cp -f ${WORKDIR}/modules.conf ${S}/policy/modules.conf
     fi