[PATCH] Generate os-release from component parts

Stephen Gallagher sgallagh at redhat.com
Tue Mar 10 20:22:43 UTC 2015


One of the pieces that we've been missing from the Fedora.next plan 
has been a proper way to programmatically identify which Edition a 
user has installed. One of the most common approaches has been to use 
the /etc/os-release file to handle this, by passing a VARIANT= 
variable in its syntax.

This patch attempts to accomplish that, while maintaining the spirit 
of the move of /etc/os-release into /usr/lib. This patch adds a 
systemd service unit and a helper script to generate /etc/os-release 
from a simple drop directory.

The traditional /etc/os-release is now located at 
/usr/lib/os.release.d/00-system.conf and Edition-specific additions to 
this are now added to edition-$EDITION.inc and symlinked to 01-
edition.conf.

Thus, on every boot, /etc/os-release will be generated from the 
contents of /usr/lib/os.release.d. Moreover, this provides us an API 
for allowing other packages to supplement /etc/os-release (where 
sensible).

Comments and criticism welcome; this is a first rough attempt. The 
patch attached only applies to Rawhide at this point, but if we decide 
it's a good approach prior to F22 Beta, I can write a backport as well.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Generate-os-release-from-component-parts.patch
Type: text/x-patch
Size: 9421 bytes
Desc: not available
URL: <http://lists.fedoraproject.org/pipermail/rel-eng/attachments/20150310/8dc65a37/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <http://lists.fedoraproject.org/pipermail/rel-eng/attachments/20150310/8dc65a37/attachment.sig>


More information about the rel-eng mailing list