diff mbox series

[3/6] refpolicy_common: ensure we start from a clean state in do_compile

Message ID 20261116025620.2558594-4-chenqi_hycx@cetc.com.cn
State New
Headers show
Series meta-selinux: fix systemd 262 denials and ensure SELinux tests work on every variant | expand

Commit Message

Chen Qi Nov. 16, 2026, 2:56 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(+)

Comments

Clayton Casciato Nov. 16, 2026, 3:11 p.m. UTC | #1
Hi, Qi

>@
> 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.

This may be the correct thing to do but would likely break my current
workflow.

In a private layer, I keep a "booleans.conf" that I apply via 
do_configure:prepend.

Thanks!

Clayton Casciato
diff mbox series

Patch

diff --git a/recipes-security/refpolicy/refpolicy_common.inc b/recipes-security/refpolicy/refpolicy_common.inc
index 4fa2ae5..e6dac8e 100644
--- a/recipes-security/refpolicy/refpolicy_common.inc
+++ b/recipes-security/refpolicy/refpolicy_common.inc
@@ -194,6 +194,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