The client initially attempts to get the value for rootfs-image.version from the database (/data/mender/mender-store). If it isn't present there it will use whichever version it finds in /etc/mender/artifact_info.
If the first update is not a system update it will still perform the fallback resulting in a misleading "System software version".
There is an issue for this describing a full fix: https://tracker.mender.io/browse/MEN-2582
However it's expensive and covers a larger scope.
There is a cheaper workaround possible for the "System software version" confusion.
Kristian's suggested solution:
- When committing artifact: Check if artifact_name is already present in database.
- If it is not, this is because it is the first artifact being committed.
- If /etc/mender/artifact_info exists, contains an artifact_name, and the artifact doesn't come with its own rootfs-image.version provide, then store the name from artifact_info in the rootfs-image.version provide in the database.
This will happen at most once in the client's lifetime, since artifact_name will always exist thereafter.