Single-device controller for the pmos test setup
Also detect fastboot and adb devices per USB port
Initial commit


browse  log 



You can also use your local clone with git send-email.

#devctl - single-device controller for the test setup

This utility is for directly interfacing with a device hooked up to a testboard without having a web controller in between. This is for debugging the testfarm or for single-device developer setups.


Show the detected test hardware hooked up to the machine

$ devctl list
Test devices:
USB port    Serial       Control TTY    Device TTY
----------  -----------  -------------  ------------
1-3         E660D4A0A73  /dev/ttyACM2   /dev/ttyACM3

Disk devices:
USB port    Name             Disk
----------  ---------------  --------
1-8         PinePhone Pro    /dev/sdb

This shows one of the Raspberry Pi Pico boards connected to USB port 1-3 and providing ttyACM2 and ttyACM3 for controlling the device and getting the serial port. It also shows the PinePhone Pro booted into Tow-Boot mass storage mode on USB port 1-8. These two USB ports happen to be the tow ports on the left side of my laptop, these unique port identifiers can be used to specify which devices to use in a more permanent way than the random linux device assignments

To flash an image and boot into that:

$ devctl --picotest 1-3 --diskdevice 1-8 flash example.img

This will do the following:

  • Find the USB devices by the port numbers for this test run
  • Hard reset the phone to get into the bootloader
  • Launch Tow-Boot mass storage mode
  • Wait for a block device to show up from port 1-8 and write example.img to it
  • Reset the phone to do a normal boot
  • Output all the serial output of the device to stdout, categorized by boot stage.

There are multiple ways to specify the hardware to use. The options are:

$ devctl --picotest 1-3 --diskdevice 1-8
$ devctl --controldevice /dev/ttyACM0 --uartdevice /dev/ttyACM1 --diskdevice /dev/sdb
$ devctl --picotest 1-3 --uartdevice /dev/ttyUSB0 --diskdevice 1-8

The --picotest argument always is used as the base for the information if given. if --uartdevice or --controldevice is specified those values are preferred over the picotest argument. All arguments can take either a path to the device or the usb port identifier.