mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-10-01 06:21:56 -09:00
package/refpolicy: test REFPOLICY_EXTRA_MODULES_DIR differently
REFPOLICY_EXTRA_MODULES_DIRS contains $(PACKAGES_SELINUX_EXTRA_MODULES_DIRS) which is filled in by package/pkg-generic.mk with the list of packages that have a selinux/ sub-directory. Due to how variable expansion works, if there is an ifeq/ifneq test of REFPOLICY_EXTRA_MODULES_DIRS, it will only see the value of REFPOLICY_EXTRA_MODULES_DIRS with the list of packages *before* refpolicy in alphabetic ordering. This means that packages after refpolicy in alphabetic ordering would not be taken into account. To fix this, we switch to an $(if ...) test, which allows the variable to really be evaluated during the refpolicy build. This makes sures the expansion is correct. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
@@ -71,7 +71,6 @@ REFPOLICY_MODULES = \
|
|||||||
$(foreach d,$(REFPOLICY_EXTRA_MODULES_DIRS),\
|
$(foreach d,$(REFPOLICY_EXTRA_MODULES_DIRS),\
|
||||||
$(basename $(notdir $(wildcard $(d)/*.te))))
|
$(basename $(notdir $(wildcard $(d)/*.te))))
|
||||||
|
|
||||||
ifneq ($(REFPOLICY_EXTRA_MODULES_DIRS),)
|
|
||||||
define REFPOLICY_COPY_EXTRA_MODULES
|
define REFPOLICY_COPY_EXTRA_MODULES
|
||||||
mkdir -p $(@D)/policy/modules/buildroot
|
mkdir -p $(@D)/policy/modules/buildroot
|
||||||
rsync -au $(addsuffix /*,$(REFPOLICY_EXTRA_MODULES_DIRS)) \
|
rsync -au $(addsuffix /*,$(REFPOLICY_EXTRA_MODULES_DIRS)) \
|
||||||
@@ -81,7 +80,6 @@ define REFPOLICY_COPY_EXTRA_MODULES
|
|||||||
$(@D)/policy/modules/buildroot/metadata.xml; \
|
$(@D)/policy/modules/buildroot/metadata.xml; \
|
||||||
fi
|
fi
|
||||||
endef
|
endef
|
||||||
endif
|
|
||||||
|
|
||||||
# In the context of a monolithic policy enabling a piece of the policy as
|
# 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'.
|
# 'base' or 'module' is equivalent, so we enable them as 'base'.
|
||||||
@@ -106,7 +104,9 @@ define REFPOLICY_CONFIGURE_CMDS
|
|||||||
$(SED) "/MONOLITHIC/c\MONOLITHIC = y" $(@D)/build.conf
|
$(SED) "/MONOLITHIC/c\MONOLITHIC = y" $(@D)/build.conf
|
||||||
$(SED) "/NAME/c\NAME = targeted" $(@D)/build.conf
|
$(SED) "/NAME/c\NAME = targeted" $(@D)/build.conf
|
||||||
$(REFPOLICY_CONFIGURE_SYSTEMD)
|
$(REFPOLICY_CONFIGURE_SYSTEMD)
|
||||||
$(REFPOLICY_COPY_EXTRA_MODULES)
|
$(if $(REFPOLICY_EXTRA_MODULES_DIRS), \
|
||||||
|
$(REFPOLICY_COPY_EXTRA_MODULES)
|
||||||
|
)
|
||||||
$(REFPOLICY_MAKE) -C $(@D) bare conf
|
$(REFPOLICY_MAKE) -C $(@D) bare conf
|
||||||
$(REFPOLICY_CONFIGURE_MODULES)
|
$(REFPOLICY_CONFIGURE_MODULES)
|
||||||
endef
|
endef
|
||||||
|
|||||||
Reference in New Issue
Block a user