I’m customizing our gadget snap here, what I want to do is to change a files content, in /etc/iotedge when switching the track of the gadget (by the pre-refresh hook). This folder was created from Azures IoT Edge installer.
Therefore we added a hook into our snapcraft yaml which contains the code, and added the interface / plug for system-files to be able to write there.
Then we builded the snap successfully and uploaded it to our own store (we have a custom / private store), without creating a new version because the revision is anyway counting up automatically.
Now when we try to make a snap refresh like this:
sudo snap refresh ourgadgetsnap --channel=customtrack/beta
sudo snap refresh ourgadgetsnap --channel=customtrack/beta --devmode
We get the errormessage:
“Mount snap “ourgadgetsnap” (7) (installation not allowed by “config-refresh” plug rule of interface “system-files”)”
We also tried to do a snap switch first and then make a refresh. I did this because of poppys answer here: Refreshing snaps in --devmode
There he says one should have a new revision:
" You have to remove the snap (losing data) or upload a new revision and switch to that."
I cant remove a gadget snap from installation so my thought was to go for the refresh with
The version of the gadget snap without the hook resp. plug-connection was at risk level edge, the new one were we added the hook resp. plug has risklevel beta.
Any idea how I can switch the gadgetsnap on my test environment with this hook / plug connected so we can test our code?
Thanks for your help!