I replied to Dean on this in an email thread, but thought I’d capture the information in the public forum.

I’ve got a device passthrough script that doesn’t require the docker container to be run in privileged mode: https://git.linaro.org/lava/lava-lab.git/tree/shared/lab-scripts/docker/passthrough

I can force a trigger event by setting up an appropriate udev rule, e.g. I have the following in my test rig /etc/udev/rules.d/100-lava-docker.rules:

ACTION=="add", ATTR{serial}=="21F6C6B800314249", RUN+="/root/docker/passthrough -d 21F6C6B800314249 -i lava-dispatcher-01-2018-11"
ACTION=="add", ATTR{serial}=="28B114C800334FA2", RUN+="/root/docker/passthrough -d 28B114C800334FA2 -i lava-dispatcher-02-2018-11"

Once set up, just do:

udevadm control --reload-rules

This will then allow hot plug for fastboot type devices.

My bash script for running up a docker dispatcher is as follows:

#!/bin/bash
set -e
set -x

docker run \
-v /dev/bus/usb:/dev/bus/usb \
-v /dev:/dev \
-v /dev/serial:/dev/serial \
-e "DISPATCHER_HOSTNAME=--hostname=lava-dispatcher-01-2018.11" \
-e "LOGGER_URL=tcp://172.16.1.1:5555" \
-e "MASTER_URL=tcp://172.16.1.1:5556" \
--net lavanet --ip 172.16.2.1 \
--name lava-dispatcher-01-2018-11 \
-it lavasoftware/amd64-lava-dispatcher:2018.11

With this, static serial type devices will just be available - i.e. Serial devices, Arm Energy Probes etc.

I am in the process of writing start scripts in Python that hides all the nasty work. I actually got this working using the Python docker library yesterday, now working on making it friendly.

(sorry if I’m preaching to the choir here, just trying to give as much info as possible!)

Hope this helps

Dave

----------------
Dave Pigott
LAVA Lab Lead
Linaro Ltd
t: (+44) (0) 1223 400063