]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
recipes-bsp: usbutils: Fix usb-devices command using busybox
authorTeresa Remmet <t.remmet@phytec.de>
Fri, 6 Sep 2024 07:25:16 +0000 (09:25 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 7 Sep 2024 06:31:16 +0000 (07:31 +0100)
Unknown find parameter -printf makes usb-devices script unusable with
busybox. Replace the parameter to fix this issue.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-bsp/usbutils/usbutils/0001-usb-devices-Fix-usb-devices-with-busybox.patch [new file with mode: 0755]
meta/recipes-bsp/usbutils/usbutils_017.bb

diff --git a/meta/recipes-bsp/usbutils/usbutils/0001-usb-devices-Fix-usb-devices-with-busybox.patch b/meta/recipes-bsp/usbutils/usbutils/0001-usb-devices-Fix-usb-devices-with-busybox.patch
new file mode 100755 (executable)
index 0000000..dbe5d7c
--- /dev/null
@@ -0,0 +1,37 @@
+From da155d965a34b5c5770dc30fa52eb7ef405f3a30 Mon Sep 17 00:00:00 2001
+From: Teresa Remmet <t.remmet@phytec.de>
+Date: Thu, 5 Sep 2024 08:37:48 +0200
+Subject: [PATCH] usb-devices: Fix usb-devices with busybox
+
+The busybox find command is missing the -printf parameter leading to
+the error:
+
+find: unrecognized: -printf
+
+Replace the parameter with sed.
+
+This patch was originally created by Daniel Fancsali.
+
+Upstream-Status: Backport [https://github.com/gregkh/usbutils/commit/da155d965a34b5c5770dc30fa52eb7ef405f3a30]
+
+Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
+---
+ usb-devices | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/usb-devices b/usb-devices
+index 5f60ad5a1ed0..51f48b4ad628 100755
+--- a/usb-devices
++++ b/usb-devices
+@@ -192,7 +192,7 @@ if [ ! -d /sys/bus ]; then
+       exit 1
+ fi
+-for device in $(find /sys/bus/usb/devices -name 'usb*' -printf '%f\n' | sort -V)
++for device in $(find /sys/bus/usb/devices -name 'usb*' | sed -E 's#^.*/##g' | sort -V)
+ do
+       print_device "/sys/bus/usb/devices/$device" 0 0 0
+ done
+-- 
+2.34.1
+
index a2e340ea4f50f342fc403a1b63ff6f4171997ea7..83d5c7287d44f59d1de94cfadd687c4359e746fe 100644 (file)
@@ -13,6 +13,7 @@ DEPENDS = "libusb1 virtual/libiconv udev"
 
 SRC_URI = "${KERNELORG_MIRROR}/linux/utils/usb/usbutils/usbutils-${PV}.tar.gz \
            file://0001-usbutils.pc.in-Fix-Cflags-entry.patch \
+           file://0001-usb-devices-Fix-usb-devices-with-busybox.patch \
           "
 SRC_URI[sha256sum] = "f704c4cb78a060db88b43aac6ebfd3d93c2c5cf1d6dd0e42936faaf00814ab00"