mirror of
https://github.com/AlbrechtL/openwrt-docker.git
synced 2026-10-14 08:01:25 +00:00
Add possibility to add second USB device. Changed syntax how to add USB devices.
This commit is contained in:
+3
-3
@@ -24,9 +24,9 @@ services:
|
||||
|
||||
# USB passthrough
|
||||
# Format <vendorID>:<productID> like 'lsusb' is given
|
||||
# Currently only one USB device is supported
|
||||
#USB_VID_1: "0e8d" # vendor ID
|
||||
#USB_PID_1: "7961" # product ID
|
||||
# Currently only two USB devices are supported
|
||||
#USB_1: "0bda:8153"
|
||||
#USB_2: "0e8d:7961"
|
||||
|
||||
ports:
|
||||
# Port 8006 is console tty web VNC
|
||||
|
||||
+16
-3
@@ -169,12 +169,25 @@ fi
|
||||
|
||||
# Attach USB interface
|
||||
USB_ARGS=""
|
||||
if [[ -z "${USB_VID_1}" || -z "${USB_PID_1}" ]]; then
|
||||
USB_ARGS=""
|
||||
USB_1_ARGS=""
|
||||
USB_2_ARGS=""
|
||||
if [[ -z "${USB_1}" ]]; then
|
||||
USB_1_ARGS=""
|
||||
else
|
||||
USB_ARGS="-device usb-host,vendorid=0x$USB_VID_1,productid=0x$USB_PID_1"
|
||||
USB_VID_1=$(echo $USB_1 | cut -d':' -f1)
|
||||
USB_PID_1=$(echo $USB_1 | cut -d':' -f2)
|
||||
USB_1_ARGS="-device usb-host,vendorid=0x$USB_VID_1,productid=0x$USB_PID_1"
|
||||
fi
|
||||
|
||||
if [[ -z "${USB_2}" ]]; then
|
||||
USB_2_ARGS=""
|
||||
else
|
||||
USB_VID_2=$(echo $USB_2 | cut -d':' -f1)
|
||||
USB_PID_2=$(echo $USB_2 | cut -d':' -f2)
|
||||
USB_2_ARGS="-device usb-host,vendorid=0x$USB_VID_2,productid=0x$USB_PID_2"
|
||||
fi
|
||||
|
||||
USB_ARGS="${USB_1_ARGS} ${USB_2_ARGS}"
|
||||
|
||||
info "Booting image using $VERS..."
|
||||
|
||||
|
||||
Reference in New Issue
Block a user