Skip to contentSkip to conversation

package/refpolicy: make sure xmllint is used

PATCH Applied Antoine Tenart 3 participants 3 messages Sep 23, 2021 – Oct 6, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/refpolicy: make sure xmllint is used

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/[email protected]/

---
 package/refpolicy/refpolicy.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
package/refpolicy/refpolicy.mk +3 -1
index eb345d0f98c9..975c3b584c42 100644
@@ -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)
Signature · 6 lines
2.31.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Antoine, All,

On 2021-09-23 11:21 +0200, Antoine Tenart spake thusly:

Quoted 6 lines

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

Quoted 7 lines

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

[1] https://lore.kernel.org/buildroot/[email protected]/

Applied to master, thanks.

Regards,
Yann E. MORIN.

Quoted 33 lines
---
 package/refpolicy/refpolicy.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
package/refpolicy/refpolicy.mk +3 -1
index eb345d0f98c9..975c3b584c42 100644
@@ -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)
Signature · 6 lines
2.31.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
In reply to Antoine Tenart
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Antoine" == Antoine Tenart <[email protected]> writes:

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

Quoted 7 lines

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

[1] https://lore.kernel.org/buildroot/[email protected]/

Committed to 2021.02.x, 2021.05.x and 2021.08.x, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot