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.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
This commit is contained in:
Teresa Remmet 2024-09-05 08:37:48 +02:00
parent b1926fa67a
commit da155d965a

View File

@ -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