Skip to contentSkip to conversation

package/libldns: allow to build drill

PATCH Superseded Alexis Lothoré via buildroot 1 participant 4 messages Oct 17, 2025

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover package/libldns: allow to build drill

Hello,
this is the v2 of a small series aiming to allow building the drill commandline tool, supported by libldns package. This is a small CLI tool allowing to perform and debug DNS requests. While at it, the series brings in a small runtime test validating that the binary (and so, the library it depends on) is correctly built, installed, and that it is able to run on the target architecture.

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

---
Changes in v2:
- Added missing SoB in first patch
- remove unecessary "default n" in Config.in
- fixed comment about toolchain features requirement
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Alexis Lothoré (2):
package/libldns: add an option to build and install drill support/testing: add basic runtime test for libldns/drill

 package/libldns/Config.in                     | 13 +++++++++++++
 package/libldns/libldns.mk                    |  7 +++++++
 support/testing/tests/package/test_libldns.py | 21 +++++++++++++++++++++
 3 files changed, 41 insertions(+)

---
base-commit: 0c2a0a44f00e2ab9b41a2bc3bf019e17ef37c471
change-id: 20250806-libldns_drill-081f15f46e5b

Best regards,

Signature · 8 lines
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

PATCH v2 1/2 package/libldns: add an option to build and install drill

The libldns library also comes with a CLI tool named drill, allowing to perform DNS requests. Drill build is currently disabled by default.

Add a KConfig option to allow building and installing drill tool. Set the default value to n to preserve the current behavior. Similarly to linktest (see the comment in the .mk), drill fails to build correctly as a static binary, so make the new option depend on non-static build.

---
Changes in v2:
- add mising SoB
- remove unecessary "default n"
- fix comment about needed toolchain features

---
 package/libldns/Config.in  | 13 +++++++++++++
 package/libldns/libldns.mk |  7 +++++++
 2 files changed, 20 insertions(+)
package/libldns/Config.in +13 -0
index 696fec97b59857fbd99bdcaababa09d49774f3ae..60b149e2019623b8b527f71f9415b159d6e62751 100644
@@ -8,3 +8,16 @@ config BR2_PACKAGE_LIBLDNS
 	  experimental software for current Internet Drafts.
 
 	  http://www.nlnetlabs.nl/projects/ldns
+
+if BR2_PACKAGE_LIBLDNS
+
+config BR2_PACKAGE_LIBLDNS_DRILL
+	bool "drill binary"
+	depends on !BR2_STATIC_LIBS
+	help
+	  Install the drill binary
+
+comment "drill needs a toolchain w/ dynamic library"
+	depends on BR2_STATIC_LIBS
+
+endif # BR2_PACKAGE_LIBLDNS
package/libldns/libldns.mk +7 -0
index 0740d09fab2fd15592c3d55cd2c1932664ca3344..6ced75a44fcf5bf9c95e443181362f99c9375eeb 100644
@@ -45,4 +45,11 @@ endif
 # interested in the lib target anyway
 LIBLDNS_MAKE_OPTS = lib
 
+ifeq ($(BR2_PACKAGE_LIBLDNS_DRILL),y)
+LIBLDNS_CONF_OPTS += --with-drill
+LIBLDNS_MAKE_OPTS += drill
+else
+LIBLDNS_CONF_OPTS += --without-drill
+endif
+
 $(eval $(autotools-package))
Signature · 6 lines
2.51.0

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

PATCH v2 2/2 support/testing: add basic runtime test for libldns/drill

In reply to Alexis Lothoré via buildroot

Add a simple test ensuring that
- libldns is correctly built and installed
- drill is correctly built and installed
- drill is able to execute on the target

---
 support/testing/tests/package/test_libldns.py | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
support/testing/tests/package/test_libldns.py new file +21 -0
new file mode 100644
index 0000000000000000000000000000000000000000..6c1a4da3f249e3ead2110760f8e59398fec1af0f
@@ -0,0 +1,21 @@
+import infra.basetest
+import os
+
+
+class TestLibLdns(infra.basetest.BRTest):
+    config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
+        """
+        BR2_PACKAGE_LIBLDNS=y
+        BR2_PACKAGE_LIBLDNS_DRILL=y
+        BR2_TARGET_ROOTFS_CPIO=y
+        # BR2_TARGET_ROOTFS_TAR is not set
+        """
+
+    def test_run(self):
+        cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
+        self.emulator.boot(arch="armv5",
+                           kernel="builtin",
+                           options=["-initrd", cpio_file])
+        self.emulator.login()
+
+        self.assertRunOk("drill -v")
Signature · 6 lines
2.51.0

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

Re: [Buildroot] [PATCH v2 2/2] support/testing: add basic runtime test for libldns/drill

Quoted 6 lines · Alexis Lothoré

Add a simple test ensuring that
- libldns is correctly built and installed
- drill is correctly built and installed
- drill is able to execute on the target

I unfortunately forgot to collect Thomas's RB on this patch before sending the v2. I'll remember to add it if the series needs a v3.

Alexis

Signature · 8 lines
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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