Hi,
I’m currently snapping snpguest. That code needs to access /dev/cpu/0/msr
.
I tried to use the custom-device
interface and my snapcraft.yaml
looks like this:
name: snpguest
version: 0.5.1
grade: stable
confinement: strict
base: core22
slots:
slot-cpu:
interface: custom-device
custom-device: dev-cpu
devices:
- /dev/cpu/0/msr
plugs:
plug-cpu:
interface: custom-device
custom-device: dev-cpu
apps:
snpguest:
command: bin/snpguest
plugs:
- plug-cpu
parts:
snpguest:
plugin: rust
source-depth: 1
source-tag: 'v0.5.1'
source-type: git
source: https://github.com/virtee/snpguest
I’ll setup the connections via:
$ sudo snap connect snpguest:plug-cpu snpguest:slot-cpu
$ snap connections snpguest
Interface Plug Slot Notes
custom-device snpguest:plug-cpu snpguest:slot-cpu manual
But when I try to run the snpguest
executable, it can not access the device node:
$ sudo snpguest ok
[ FAIL ] - Error reading MSR: Failed to get bit values, Error Reading MSR
ERROR: One or more tests in snpguest-ok reported a failure
Error: One or more tests in snpguest-ok reported a failure
$ sudo snap run --shell snpguest
# cat /dev/cpu/0/msr
cat: /dev/cpu/0/msr: Operation not permitted
Any hints how to resolve this? Or is classic
the only way moving forward here?