Hi,
We’re running a service which would need to access some data from the update, such as the future version.
Is there a way to access this in a state script before rebooting? Environment variables during state scripts or reading a file (json or so) would be great as it’s easily readble.
In the worst case, I could get the version by opening /etc/mender/artifact_info of the other partition
Not directly. However, if you’re using Yocto you can autogenerate a state script which contains the value of MENDER_ARTIFACT_NAME and store it somewhere for the bigger script to read. Something aka:
Btw, the /etc/mender/artifact_info is not guaranteed to work in 2.0.0 and beyond, because it stores this info in the database instead. If you use rootfs updates only, it will usually coincide, but not when using update modules.
I’m not using the 2.0 yet but that’s good to know. Is this example available in the documentation? I think it would be great to access some metadata during the update