[Buildroot] [git commit branch/2021.08.x] package/refpolicy: make sure xmllint is used

Peter Korsgaard peter at korsgaard.com
Wed Oct 6 14:31:41 UTC 2021


commit: https://git.buildroot.net/buildroot/commit/?id=081262c59f1a8a20077575eda43990fb649d1f54
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/2021.08.x

When parsing and adding modules the refpolicy build system checks their
validity using xmllint. By default the host system version is used and
if not found an error is displayed but the build is not stopped. This
leads to interesting issues where modules are not added correctly to
modules.conf[1] (other possible issues are likely).

Fix this by adding a dependency on host-libxml2 and explicitly use the
xmllint binary built by Buildroot.

[1] https://lore.kernel.org/buildroot/20210830114531.2285178-1-jose.pekkarinen@unikie.com/

Tested-by: José Pekkarinen <jose.pekkarinen at unikie.com>
Signed-off-by: Antoine Tenart <atenart at kernel.org>
Signed-off-by: Yann E. MORIN <yann.morin.1998 at free.fr>
(cherry picked from commit 5141cee10939c56da3741967c128c58eac190222)
Signed-off-by: Peter Korsgaard <peter at korsgaard.com>
---
 package/refpolicy/refpolicy.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/package/refpolicy/refpolicy.mk b/package/refpolicy/refpolicy.mk
index a42483dba2..7782a5be54 100644
--- a/package/refpolicy/refpolicy.mk
+++ b/package/refpolicy/refpolicy.mk
@@ -14,7 +14,8 @@ REFPOLICY_DEPENDENCIES = \
 	host-policycoreutils \
 	host-python3 \
 	host-setools \
-	host-gawk
+	host-gawk \
+	host-libxml2
 
 ifeq ($(BR2_PACKAGE_REFPOLICY_CUSTOM_GIT),y)
 REFPOLICY_VERSION = $(call qstrip,$(BR2_PACKAGE_REFPOLICY_CUSTOM_REPO_VERSION))
@@ -30,6 +31,7 @@ endif
 # Cannot use multiple threads to build the reference policy
 REFPOLICY_MAKE = \
 	PYTHON=$(HOST_DIR)/usr/bin/python3 \
+	XMLLINT=$(LIBXML2_HOST_BINARY) \
 	TEST_TOOLCHAIN=$(HOST_DIR) \
 	$(TARGET_MAKE_ENV) \
 	$(MAKE1)


More information about the buildroot mailing list