snapcore / pi-gadget

Universal pi (pi2,pi3,pi4,cm3,cm4 and future) gadget snap for Ubuntu Core and classic systems.
30 stars 60 forks source link

Enabling camera in custom image #51

Open jtc42 opened 3 years ago

jtc42 commented 3 years ago

Hi,

I'm trying to get to grips with Ubuntu Core a bit, and one thing I'm looking to do is create a custom image with a couple of application snaps, but importantly the camera interface needs to be enabled without any user intervention. A lot of online tutorials talk about just editing the boot config.txt, but obviously this doesn't really work for what we want.

Am I right in thinking that the workflow should be:

I've read a bunch of the documentation but I'm either missing something about how to actually use custom gadgets in custom images, or it's really not obvious.

Any pointers would be great,

Thanks!

alfonsosanchezbeato commented 2 years ago

There are some changes in config.txt that are allowed by snapd options (see https://forum.snapcraft.io/t/system-options/87), however it does not look that controlling camera settings is among them yet.

So, while this does not get supported, you are correct in that you will need to fork the gadget and create your own image. You can get some ideas from: https://ubuntu.com/core/docs/image-building https://ubuntu.com/core/docs/gadget-building Also the forum is a great source of information: https://forum.snapcraft.io/

anonymouse64 commented 2 years ago

@alfonsosanchezbeato @jtc42 we do sometimes just add new options to configure this sort of thing through snapd since it's an already established precedence (even if it's a bit awkward on our side), so I think we would accept a PR to snapd adding this new option/setting for system.pi-config.camera=foo or whatever the option is named