I have created an artifact and can deploy it on a rw file system.
Now I would like to deploy it on an read-only file system, The idea is to use state scripts to temporarily remount the rootfs in read-write mode.
I use the Download_Enter_00 script to mount in rw. This works.
Going back to read-only mode could be done by the ArtifactCommit_Leave_xx and ArtifactFailure_Leave_xx scripts. But these are part of the artifact. It doesn’t feel right to move the responsibility of going back to read-only to the update artifact.
I have also tried the Idle_Enter_xx script, but this script is also called when for example no action was performed. So every few seconds the file system is put back into read only mode.
- Is there a way to have ‘global’ ArtifactXY_Enter/Leave scripts which are not part of the artifact? But which can be installed directly in /etc/mender/scripts?
- Is there a way to retrieve the previous state in a state script? In that way I could check in the Idle_Enter script if we’re transitioning from ArtifactXY_Leave.