diff --git a/DEVELOPERS b/DEVELOPERS index b6d288c54f..67c6004ddf 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1874,6 +1874,7 @@ F: configs/zynqmp_zcu106_defconfig F: package/agentpp/ F: package/exim/ F: package/libpjsip/ +F: package/linux-tools/linux-tool-usbtools.mk.in F: package/qpid-proton/ F: package/rtl8188eu/ F: package/snmppp/ diff --git a/package/linux-tools/Config.in b/package/linux-tools/Config.in index 8a0b6d5802..451b0eeff5 100644 --- a/package/linux-tools/Config.in +++ b/package/linux-tools/Config.in @@ -135,6 +135,32 @@ comment "selftests needs BR2_PACKAGE_BUSYBOX_SHOW_OTHERS and a toolchain w/ dyna depends on !BR2_PACKAGE_BUSYBOX_SHOW_OTHERS || \ BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14 +config BR2_PACKAGE_LINUX_TOOLS_USBTOOLS + bool "USB test programs" + select BR2_PACKAGE_LINUX_TOOLS + help + Build and install the USB test tools. + + These tools exist since Linux 2.6.35, but Buildroot can build + them only with kernel versions 5.9 and later. + +if BR2_PACKAGE_LINUX_TOOLS_USBTOOLS + +config BR2_PACKAGE_LINUX_TOOLS_USBTOOLS_TESTUSB + bool "testusb" + help + testusb issues ioctls to perform the tests implemented by the + kernel driver. It can generate a variety of transfer + patterns. + + See http://www.linux-usb.org/usbtest/ + +config BR2_PACKAGE_LINUX_TOOLS_USBTOOLS_FFSTEST + bool "ffs-test" + help + User mode filesystem api for usb composite function +endif + config BR2_PACKAGE_LINUX_TOOLS_TMON bool "tmon" depends on BR2_TOOLCHAIN_HAS_THREADS diff --git a/package/linux-tools/linux-tool-usbtools.mk.in b/package/linux-tools/linux-tool-usbtools.mk.in new file mode 100644 index 0000000000..797758adce --- /dev/null +++ b/package/linux-tools/linux-tool-usbtools.mk.in @@ -0,0 +1,34 @@ +################################################################################ +# +# usbtools +# +################################################################################ + +LINUX_TOOLS += usbtools + +USBTOOLS_MAKE_OPTS = $(LINUX_MAKE_FLAGS) LDFLAGS="$(TARGET_LDFLAGS)" + +LINUX_TOOLS_USBTOOLS_LIST = \ + $(if $(BR2_PACKAGE_LINUX_TOOLS_USBTOOLS_TESTUSB),testusb) \ + $(if $(BR2_PACKAGE_LINUX_TOOLS_USBTOOLS_FFSTEST),ffs-test) + +define USBTOOLS_BUILD_CMDS + $(Q)if ! grep install $(LINUX_DIR)/tools/usb/Makefile >/dev/null 2>&1 ; then \ + echo "Your kernel version is too old to build the USB tools." ; \ + echo "At least kernel 5.9 must be used." ; \ + exit 1 ; \ + fi + + $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools/usb \ + ALL_TARGETS="$(LINUX_TOOLS_USBTOOLS_LIST)" \ + $(USBTOOLS_MAKE_OPTS) \ + all +endef + +define USBTOOLS_INSTALL_TARGET_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools/usb \ + ALL_TARGETS="$(LINUX_TOOLS_USBTOOLS_LIST)" \ + $(USBTOOLS_MAKE_OPTS) \ + DESTDIR=$(TARGET_DIR) \ + install +endef