From b05208c8920c7c68c9506caa6e30fbf50884b963 Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Fri, 19 Aug 2022 22:39:43 +0100 Subject: [PATCH] Catch reconfigured USB devices for pass-through. Close #433 --- quickemu | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/quickemu b/quickemu index e096602..35e98d8 100755 --- a/quickemu +++ b/quickemu @@ -162,7 +162,10 @@ function enable_usb_passthrough() { USB_BUS=$(lsusb -d "${VENDOR_ID}:${PRODUCT_ID}" | cut -d' ' -f2) USB_DEV=$(lsusb -d "${VENDOR_ID}:${PRODUCT_ID}" | cut -d' ' -f4 | cut -d':' -f1) USB_NAME=$(lsusb -d "${VENDOR_ID}:${PRODUCT_ID}" | cut -d' ' -f7-) - if [ -w "/dev/bus/usb/${USB_BUS}/${USB_DEV}" ]; then + if [ -z "${USB_NAME}" ]; then + echo " ! USB device ${VENDOR_ID}:${PRODUCT_ID} not found. Check your configuration" + continue + elif [ -w "/dev/bus/usb/${USB_BUS}/${USB_DEV}" ]; then echo " o ${USB_NAME} on bus ${USB_BUS} device ${USB_DEV} is accessible." else echo " x ${USB_NAME} on bus ${USB_BUS} device ${USB_DEV} needs permission changes:"