[systemd-devel] /etc/os-release but for images

Lennart Poettering lennart at poettering.net
Thu Mar 24 14:23:54 UTC 2022


On Mi, 23.03.22 17:14, Davide Bettio (davide.bettio at secomind.com) wrote:

> I opened this PR: https://github.com/systemd/systemd/pull/22841
>
> This doesn't enable full semver support since that would require allowing
> A-Z range, but I'm not sure if it is something we really want to enable
> (uppercase in semver looks quite uncommon by the way).

how does semver suggest uppercase chars are handled? is "0.1.1a" newer
than "0.1.1A"?

> I would use the UUID as a further metadata in addition to IMAGE_VERSION,
> also for the reasons I describe later here in this mail.

Sounds like something you could just add as suffix to IMAGE_VERSION, no?

> > > Compared to other options an UUID here would be both reliable and easy to
> > > handle and generate.
> >
> > UUID is are effectively randomly generated. That sucks for build
> > processes I am sure, simply because they hence aren't reproducible.
> >
>
> Using a reliable digest, such as the one that can be generated with `casync
> digest`, was my first option, however if you think about an update system
> such such as RAUC and its bundles, you might still have the same exact
> filesystem digest mapping to a number of different bundles, since they can
> bring different hook scripts and whatever.
> I'm also aware of scenarios where the same filesystem tree has been used to
> generate different flash images in order to satisfy different flash sizes /
> NAND technologies.
> So from a practical point of view having an UUID, and forcing a different
> one in /etc/os-release every time a filesystem image / RAUC bundle is
> created allows us to have a reasonable 1:1 mapping between the update
> artifact and the system image that is on the device.
> Last but not least having it in /etc/os-release makes it pretty convenient
> to read it (and for sure using an UUID is easier than trying to embed the
> digest of the filesystem where  /etc/os-release is kept ;) )
> Also there is an interesting bonus: UUID is globally unique also in
> scenarios where users try to delete and recreate version tags without
> incrementing the version number (or other messy scenarios).

Shouldn't you use the fs header uuid? or the GPT partition or overall
uuids?

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list