Hello, I’m building a new image for our board. We have /proc/device-tree/serial-number a unique serial that we want to use in prepare-device hook of our gadget snap in this way
snapctl set registration.proposed-serial="'${product_serial}'"
In particular, we tried both
product_serial=$(grep -o "serial=[^ ]*" /proc/cmdline | cut -d= -f2 | xxd -r -p)
and
product_serial=$(xxd -r -p < /proc/device-tree/serial-number)
but we always get permission denied on such commands.
We put in our snapcraft.yaml the string
hooks:
prepare-device:
plugs:
- hardware-observe
and, in gadget.yaml
connections:
- plug: <gadget_snap_id>:hardware_observe
We have published a first version of the gadget snap in our private brand store, but we are currently building the image using a local built snap.
Do you have any idea how to let it work ? Thanks!