Currently we hardcode the contents of /etc/os-release based on build-related variables.
That locks downstream builds into specific outputs that they may not want; for example, PRETTY_NAME will always be something like "Bottlerocket x.y.z" even if the version isn't meaningful.
What I'd suggest instead is that:
if no /etc/os-release exists in the sys-root, we write the existing os-release as a file with unexpanded variables
then we apply envsubst to /etc/os-release in a second pass to fill in variables we want to replace
The URL fields should also be parameterized so that variable substitution works there too.
Currently we hardcode the contents of /etc/os-release based on build-related variables.
That locks downstream builds into specific outputs that they may not want; for example,
PRETTY_NAME
will always be something like "Bottlerocket x.y.z" even if the version isn't meaningful.What I'd suggest instead is that:
/etc/os-release
exists in the sys-root, we write the existingos-release
as a file with unexpanded variablesenvsubst
to/etc/os-release
in a second pass to fill in variables we want to replaceThe URL fields should also be parameterized so that variable substitution works there too.