request for snap interface that expose userspace device APIs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
Fix Released
|
Medium
|
Zygmunt Krynicki |
Bug Description
Embedded systems (which are likely called IoT devices these days :) sometime need access to peripherals via user-space device APIs, namely i2cdev[1], spidev[2] and uio[3]. Snaps of type core and gadget should be able to expose these interfaces to other privileged snaps.
Accesses to these character special devices should be granted through this interface:
- /dev/spidevB.C rw,ioctl
- /dev/i2c-%d rw,ioctl
- /dev/uio%d rw,mmap,poll,select
Optionally read-only accesses to sysfs entries can be granted to get device information:
- /sys/class/
- /sys/class/uio/** r
Tests can be done with tools in [4] [5] [6] accordingly.
This interface is IMHO similar to bool_file, gpio and serial-port in regards to security concerns.
[1] https:/
[2] https:/
[3] https:/
[4] https:/
[5] https:/
[6] http://
There is already an i2c interface, /github. com/snapcore/ snapd/pull/ 2113
https:/
an iio interface in the works based on the i2c interface.
spidev and uio could also be written based on what i2c is, with obvious changes.