Hi,
Below are current observation -
Current custom-device plug adding below udev rule which is not working since snapd 2.55.4.
KERNEL==“test/test_driver0”, TAG+=“snap_ test-app.test-app”
Below udev rules allows dev node access from snap -
KERNEL=="test_driver0", TAG+="snap_ test-app.test-app"
KERNEL=="test_driver0", SUBSYSTEM="test" TAG+="snap_ test-app.test-app"
Option to achieve updated udev rule using custom-device plug with required apparmor permission.
Option 1: Works. But does not looks like perfect solution.
slots:
dev-node:
interface: custom-device
devices:
- /dev/test/test_driver[0-2]
- /dev/test_driver[0-2]
Option 2:
slots:
dev-node:
interface: custom-device
devices:
- /dev/test/test_driver[0-2]
udev-tagging:
- kernel: test_driver[0-2]
subsystem: test
Not working. Section of code in validateUDevTaggingRule function of custom_device.go (https://github.com/snapcore/snapd/blob/master/interfaces/builtin/custom_device.go#L160) throws below error.
if !strutil.ListContains(devices, "/dev/"+deviceName) {
err = fmt.Errorf(`%q does not match a specified device`, deviceName)
}
What is usage this check added in validate function?