Skip to contentSkip to conversation

package/libldns: allow to build drill

PATCH In review Alexis Lothoré via buildroot 1 participant 4 messages Dec 9, 2025 – Dec 13, 2025

lore
Share & tools
lore
#0 lore raw

v3 cover package/libldns: allow to build drill

Hello,
this is the v3 of a small series aiming to allow building the drill commandline tool, supported by libldns package. I realize that I have messed-up the versioning on the previous revision, which _should_ have been v3, so here is the actual v3. It does not bring any change, aside from properly collecting some RB from Thomas.

drill 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 v3:
- collect Thomas' RB
- Link to v2: https://lore.kernel.org/r/[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: 3f3d6e43de9b4aac7df8545fd811171256f878d3
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 v3 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 696fec97b598..60b149e20196 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 0740d09fab2f..6ced75a44fcf 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.2

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

Re: [Buildroot] [PATCH v3 1/2] package/libldns: add an option to build and install drill

Quoted 9 lines · Alexis Lothoré via buildroot

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.

Series applied to master, thanks.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw

PATCH v3 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 000000000000..6c1a4da3f249
@@ -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.2

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