* [Buildroot] [PATCH v2] package/linux-tools: fix PCI endpoint tests build with recent kernels
@ 2026-10-22 18:18 Florian Fainelli via buildroot
2026-10-22 21:16 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 3+ messages in thread
From: Florian Fainelli via buildroot @ 2026-10-22 18:18 UTC (permalink / raw)
To: buildroot
Cc: bernd.kuhls, chrismcc, Florian Fainelli, yann.morin.1998,
thomas.petazzoni, fontaine.fabrice, markus.mayer
Since Linux 6.14, the PCI endpoint tests have moved from tools/pci to
tools/testing/selftests/pci_endpoint. The existing build commands still
use the old location, causing the build to fail with newer kernels.
Detect the selftests directory and fall back to tools/pci for older
kernels. Set OUTPUT and INSTALL_PATH to build and install the selftests
under /usr/lib/kselftests/pci_endpoint, and pass the required libraries
explicitly.
Update the help text to document the binary names and installation
paths. Check that the selected source directory contains a Makefile
and report the minimum supported kernel version if it is missing.
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
package/linux-tools/Config.in | 5 +++--
package/linux-tools/linux-tool-pci.mk.in | 16 ++++++++++++----
2 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/package/linux-tools/Config.in b/package/linux-tools/Config.in
index b9adc25ad51d..1e881c3ab4f0 100644
--- a/package/linux-tools/Config.in
+++ b/package/linux-tools/Config.in
@@ -61,8 +61,9 @@ config BR2_PACKAGE_LINUX_TOOLS_PCI
bool "pci"
select BR2_PACKAGE_LINUX_TOOLS
help
- pcitest is a tool for testing capabilities related to a
- PCI Endpoint (only works with specific Endpoints).
+ Build the PCI endpoint tests (only work with specific Endpoints).
+ Kernels before 6.14 provide pcitest in /usr/bin. Newer kernels
+ provide pci_endpoint_test in /usr/lib/kselftests/pci_endpoint.
These tools are available only from kernel version 4.20.
diff --git a/package/linux-tools/linux-tool-pci.mk.in b/package/linux-tools/linux-tool-pci.mk.in
index 17246f5d7ed2..52d7639bb102 100644
--- a/package/linux-tools/linux-tool-pci.mk.in
+++ b/package/linux-tools/linux-tool-pci.mk.in
@@ -6,22 +6,30 @@
LINUX_TOOLS += pci
-PCI_MAKE_OPTS = $(LINUX_MAKE_FLAGS) LDFLAGS="$(TARGET_LDFLAGS)"
+# Linux 6.14 moved the PCI endpoint tests into Kselftests.
+PCI_SRCDIR = $(strip $(if $(wildcard $(LINUX_DIR)/tools/testing/selftests/pci_endpoint/Makefile),\
+ $(LINUX_DIR)/tools/testing/selftests/pci_endpoint,$(LINUX_DIR)/tools/pci))
+
+PCI_MAKE_OPTS = $(LINUX_MAKE_FLAGS) \
+ OUTPUT=$(PCI_SRCDIR)/ \
+ LDFLAGS="$(TARGET_LDFLAGS)" \
+ LDLIBS="-lrt -lm"
define PCI_BUILD_CMDS
- $(Q)if ! grep install $(LINUX_DIR)/tools/pci/Makefile >/dev/null 2>&1 ; then \
+ $(Q)if test ! -f $(PCI_SRCDIR)/Makefile ; then \
echo "Your kernel version is too old and does not have install section in the pci tools." ; \
echo "At least kernel 4.20 must be used." ; \
exit 1 ; \
fi
- $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools/pci \
+ $(TARGET_MAKE_ENV) $(MAKE) -C $(PCI_SRCDIR) \
$(PCI_MAKE_OPTS)
endef
define PCI_INSTALL_TARGET_CMDS
- $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools/pci \
+ $(TARGET_MAKE_ENV) $(MAKE) -C $(PCI_SRCDIR) \
$(PCI_MAKE_OPTS) \
DESTDIR=$(TARGET_DIR) \
+ INSTALL_PATH=$(TARGET_DIR)/usr/lib/kselftests/pci_endpoint \
install
endef
--
2.53.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH v2] package/linux-tools: fix PCI endpoint tests build with recent kernels
2026-10-22 18:18 [Buildroot] [PATCH v2] package/linux-tools: fix PCI endpoint tests build with recent kernels Florian Fainelli via buildroot
@ 2026-10-22 21:16 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-10-22 21:16 UTC (permalink / raw)
To: Florian Fainelli
Cc: buildroot, bernd.kuhls, chrismcc, yann.morin.1998,
fontaine.fabrice, markus.mayer
On Thu, Oct 22, 2026 at 11:18:03AM -0700, Florian Fainelli via buildroot wrote:
> Since Linux 6.14, the PCI endpoint tests have moved from tools/pci to
> tools/testing/selftests/pci_endpoint. The existing build commands still
> use the old location, causing the build to fail with newer kernels.
>
> Detect the selftests directory and fall back to tools/pci for older
> kernels. Set OUTPUT and INSTALL_PATH to build and install the selftests
> under /usr/lib/kselftests/pci_endpoint, and pass the required libraries
> explicitly.
>
> Update the help text to document the binary names and installation
> paths. Check that the selected source directory contains a Makefile
> and report the minimum supported kernel version if it is missing.
>
> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Applied to master after adjusting two minor things:
- Wrapped the Config.in help, some lines were a bit too long and were
causing a "make check-package" warning.
- Adding a Fixes: tag, not pointing to the commit introducing the
issue because as discussed there isn't any, but instead pointing to
an autobuilder failure that your patch is fixing.
Thanks a lot!
Thomas Petazzoni
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <20261022181803.1291476-1-florian.fainelli__18987.6594625943$1792693116$gmane$org@broadcom.com>]
end of thread, other threads:[~2026-10-22 21:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-22 18:18 [Buildroot] [PATCH v2] package/linux-tools: fix PCI endpoint tests build with recent kernels Florian Fainelli via buildroot
2026-10-22 21:16 ` Thomas Petazzoni via buildroot
[not found] <20261022181803.1291476-1-florian.fainelli__18987.6594625943$1792693116$gmane$org@broadcom.com>
2026-10-22 18:24 ` Bernd Kuhls
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox