Reading inactive partition version

Hello,

I need to add some sanity checks during update so according mender documentation I plan to use state script. I’m in process of added ArtifactCommit_Enter_00_update-certificates script which basically need to check what was previous version (actual I can read from /etc …). Is there some simple way how to read it or so I need to do magic with reading u-boot env, mount inactive and read it?

Thanks.

You could use a combination of ArtifactInstall_Leave and ArtifactCommit_Enter, and save a copy of what you need in /data temporarily in ArtifactInstall_Leave.

I think it is kind of general pattern to have possibility to check from which version I’m updated to so was thinking that there is something already done in this regard :wink: . I’ll use your advice. Thanks.