Message ID | 20200731101040.1723047-15-antoine.tenart@bootlin.com |
---|---|
State | Accepted |
Headers | show |
Series | Improve SELinux support | expand |
On Fri, 31 Jul 2020 12:10:39 +0200 Antoine Tenart <antoine.tenart@bootlin.com> wrote: > -define REFPOLICY_CONFIGURE_CMDS > +define REFPOLICY_CONFIGURE_BUILD I found it a bit silly to have REFPOLICY_CONFIGURE_CMDS calling REFPOLICY_CONFIGURE_BUILD, so I've just inlined in REFPOLICY_CONFIGURE_CMDS what REFPOLICY_CONFIGURE_BUILD is doing. See the final commit at: https://git.buildroot.org/buildroot/commit/?id=fb2968707bc66afb2c246d92e15f295475f23868 Also, note that with your change, the policy is indeed being built during the "build" step, but it is also built again during the target installation step. However, due to how the refpolicy build system works, this seems unavoidable, and this patch is anyway already an improvement. Thanks! Thomas
diff --git a/package/refpolicy/refpolicy.mk b/package/refpolicy/refpolicy.mk index 51ac71075fb8..5c100168401c 100644 --- a/package/refpolicy/refpolicy.mk +++ b/package/refpolicy/refpolicy.mk @@ -95,7 +95,7 @@ define REFPOLICY_CONFIGURE_SYSTEMD endef endif -define REFPOLICY_CONFIGURE_CMDS +define REFPOLICY_CONFIGURE_BUILD $(SED) "/OUTPUT_POLICY/c\OUTPUT_POLICY = $(REFPOLICY_POLICY_VERSION)" \ $(@D)/build.conf $(SED) "/MONOLITHIC/c\MONOLITHIC = y" $(@D)/build.conf @@ -103,13 +103,18 @@ define REFPOLICY_CONFIGURE_CMDS $(REFPOLICY_CONFIGURE_SYSTEMD) endef -define REFPOLICY_BUILD_CMDS +define REFPOLICY_CONFIGURE_CMDS + $(REFPOLICY_CONFIGURE_BUILD) $(if $(call qstrip,$(REFPOLICY_EXTRA_MODULES)),\ $(REFPOLICY_COPY_MODULES)) - $(REFPOLICY_MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) bare conf + $(REFPOLICY_MAKE) -C $(@D) bare conf $(REFPOLICY_CONFIGURE_MODULES) endef +define REFPOLICY_BUILD_CMDS + $(REFPOLICY_MAKE) -C $(@D) policy +endef + define REFPOLICY_INSTALL_STAGING_CMDS $(REFPOLICY_MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) \ install-src install-headers
The refpolicy configure and build step were not correctly defined. The configuration was split between the configure and build step, while both the compilation and the installation were done in the install step. Fix this by moving all the configuration within the configuration step and by adding a call to make in the build step to compile the policy. Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com> --- package/refpolicy/refpolicy.mk | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)