iDevice DFU and usbmuxd Support

Hey there,

I’m working on a pair of new builtin interfaces for snapd:

  • the ability for an official usbmuxd snap to consume USB iDevices exposed as usbmuxd that would expose a unix socket for usbmuxd connections (other snaps would consume this right)
  • the ability for a snap to consume USB iDevices in DFU or recovery modes.

I’m guessing the best way to do this is by creating two new “device class” builtin interfaces shamelessly copying from ADB.

Is this sounding correct?

Sorry to top post - but this is the proposed patch:

Hi, are these devices serial over USB ports essentially? If so would the serial-port interface work for these devices?

Yeah, as @ijohnson pointed out, the accesses seem to be a mixture of serial-port and raw-usb and there is nothing “idevice” specific to warrant a new interface. I’m curious for the answer to @ijohnson’s question (note, you might want to look at Hotplug support)

No this is a very apple specific protocol. USBMUXD is a TCP like protocol, more similar to ADB

DFU/restore is a secondary mode for devices who need firmware (the glorious connect to iTunes screen).

I want to constrain for instance a usbmuxd snap to just the udev labeled devices like “adb-support” does. usbmuxd would have a new permission to access /var/run/usbmuxd that other snaps would have to declare they use

DFU recovery is again a set of labeled udev rules.

SORRY - yeah no “serial” here mean “read the USB serial number of the device”

This patch uses udev hotplug

Sorry, I didn’t read the udev portions closely enough. Since you are specifying very specific idProduct and idVendor, that is sufficient for this to be in separate interfaces. Please proceed with submitting a PR for this-- I’m not sure about the names of the interfaces or how we want to group the /dev/bus accesses and there will need to be more supporting comments, but this can be discussed in the PR. When you submit your PR, can you be sure to include in the PR description the output of udevadm info /dev/bus/<path>/<to>/<an>/<usbmuxd-matching-device> and udevadm info /dev/bus/<path>/<to>/<an>/<idevice-restore-matching-device>?

Thanks!