bottlerocket-os / twoliter

A build tool for customizing Bottlerocket
Other
24 stars 25 forks source link

custom /etc/os-release #409

Open bcressey opened 1 week ago

bcressey commented 1 week ago

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:

  1. if no /etc/os-release exists in the sys-root, we write the existing os-release as a file with unexpanded variables
  2. 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.