Request for a `18-pi` track for the `pi` gadget snap


For the upcoming 18.04.4 point-release, we will be creating a generic pi ubuntu-core model assertion - and for this we’d like to also have a generic pi track for the gadget. Currently we have a track per every supported pi model assertion, so 18-pi3, 18-pi2 etc. A 18-pi one would be very useful in this case.

This way the track name would also match what is already done for pi-kernel.

Thank you!

Done, +1 from me as reviewer and this is consistent with other tracks for the pi snap.

  • Daniel

Given that pi-gadget is now unified, what do these tracks do, how do they work?


Presumably you select the appropriate one by choosing the track instead of a specific snap:

snap install pi --channel=18-pi3

Something similar applies to the pi-kernel snap.

well, you normally dont install gadgets using snap install :slight_smile:

you’d use the channel/track in your model assertion instead … there are examples at:

Sorry, I didn’t phrase my question well. I know that we reference the tracks in gadget.yaml, but what does “gadget”: “pi=18-pi3” do differently than “gadget”: “pi=18-cm3”, if the pi gadget is unified? Isn’t the code all the same?


The bootloader code ( firmware as well as u-boot) are indeed identical… but the peripheral interfaces can differ (especially on the cm3 where the actual peripherals depend on the mainboard you stuck the module in to)…

I thought “gadget”: “pi=18-cm3” would expose one or both of the CM3’s serial ports, but it doesn’t. Should it? Or do I need to make a custom gadget?


well, it is definitely the fast workaround, after all @sil2100 is responsible for the gadgets nowadays and it is on him to decide if it should be added … generally the reference images are designed in a way that you can access them via serial console since the vast majority of them is used rather in headless environments … as you can see in the other thread we talked if console= points to a device, having an interface wont gain you much given the device is already taken by the kernel.

In my case, I have an RFID reader connection to the serial port, and I need to connect my app snap to use that serial port. I’ve removed console=… from /boot/uboot/cmdline.txt, so the kernel isn’t using the serial port anymore. I can get the CM3 serial port exposed using a custom gadget, but then I can’t get the serial port auto-connected because (I think) the gadget needs to be in the snap store, which requires manual approval.

If there’s a way to do this with the stock pi-gadget, I’d be very happy.