Alter files in the new filesystem before reboot

I want to symlink certain files from the new artifact to a /data partition before rebooting. Is this possible to do in the ArtifactInstall_Leave? I believe ArtifactInstall_Leave occurs in the old file system. Is there a way to refer to files in the new file system and symlink them, for example using an environment variable like MENDER_ARTIFACT_DIR/…/rootfs/. I am using an nvidia tx2 with A/B system updates.

Forwarding explanation by @tranchitella:

In the context of a rootfs update:

  • ArtifactInstall_Leave happens in the old file system once the data is fully written to the inactive partition; technically you can have access to the new file system but your state script will have to mount it somewhere.

  • ArtifactReboot_Enter happens in the new file system after the reboot, but before the commit. There is still the possibility that the deployment will fail and the device will roll back to the old file system. Again, you can have access to the old file system but you have to manually mount it.

Slight clarification: ArtifactReboot_Enter also runs using the old filesystem, it is ArtifactReboot_Leave which runs with the new filesystem.

1 Like