[Buildroot] [PATCH] package/refpolicy: Treat all modules as custom

José Pekkarinen jose.pekkarinen at unikie.com
Mon Aug 30 11:45:31 UTC 2021


The current processing of the modules doesn't work for
custom made policies appended through the extra dir mechanism,
since sed won't find a match for custom modules, it will
continue without triggering and error. This patch removes
all the modules from modules.conf and add them one by
one using REFPOLICY_MODULES values.

Signed-off-by: José Pekkarinen <jose.pekkarinen at unikie.com>
---
 package/refpolicy/refpolicy.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/refpolicy/refpolicy.mk b/package/refpolicy/refpolicy.mk
index 0194708b37..1c0a2c3385 100644
--- a/package/refpolicy/refpolicy.mk
+++ b/package/refpolicy/refpolicy.mk
@@ -85,9 +85,9 @@ endef
 # In the context of a monolithic policy enabling a piece of the policy as
 # 'base' or 'module' is equivalent, so we enable them as 'base'.
 define REFPOLICY_CONFIGURE_MODULES
-	$(SED) "s/ = module/ = no/g" $(@D)/policy/modules.conf
+	$(SED) "/ = module/d" $(@D)/policy/modules.conf
 	$(foreach m,$(sort $(REFPOLICY_MODULES)),
-		$(SED) "/^$(m) =/c\$(m) = base" $(@D)/policy/modules.conf
+		$(SED) "/^# Module: $(m)/a\$(m) = base" $(@D)/policy/modules.conf
 	)
 endef
 
-- 
2.25.1



More information about the buildroot mailing list