[PATCH] Generate os-release from component parts

Dennis Gilmore dennis at ausil.us
Wed Mar 11 02:14:02 UTC 2015


On Tuesday, March 10, 2015 04:22:43 PM Stephen Gallagher wrote:
> 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.

I am not opposed to doing something, but I am not sure this is right. there is 
some builds that need /etc/os-release to be present and setup to build. I 
think that systemd itself needs /usr/lib/os-release and/or /etc/os-release to 
be present to actually boot the system. 

perhaps we should take the approach that we put /usr/lib/os-release in place 
and make the /etc/os-release symlink, we have the service provided in fedora-
release but disabled. the preset files for the products enable the service and 
it replaces the symlink at /etc/os-release with a new file that includes the 
base os definition and the variant definition.

Dennis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.fedoraproject.org/pipermail/rel-eng/attachments/20150310/b1d944bc/attachment-0001.sig>


More information about the rel-eng mailing list