[CentOS-devel] enhancing /etc/*-release

Mon Apr 6 08:12:28 UTC 2015
Anders F Björklund <afb at users.sourceforge.net>

Bryan Seitz wrote:

>>>   I would love to see /etc/os-release added to CentOS5 and CentOS6 as well.  Keep up the good work!
>> But os-release is a systemd "feature"*. Seems unlikely to make it ?
>> Might as well use `/usr/bin/lsb_release` (and redhat-lsb-core) then.
>> * http://0pointer.de/blog/projects/os-release.html
>> Ironically it doesn't even contain the name of the Operating System...
>> We saw this when it was introduced in (and broke) PackageKit earlier.
>> I don't think it's possible to change all redhat-release usage anyway.
> Even redhat-lsb-core installs an insane amount of garbage just to get that one function we want.  Other distributions (At least Debian/Ubuntu) already use /etc/os-release and there is no reason it cannot be populated by the centos-release package on C5/C6 as well. It is a good idea, the file has useful and standard contents, and it just works.
> I am not advocating doing away with the legacy files, but this solution just makes sense and is the right thing to do moving forward.

I suppose there's nothing wrong with having *both* of them around.
As long as it doesn't replace/delete the original files, that is...

It does address my concerns (for redhat-release) in that article, too. :-)

Seems like the mandated /usr/lib/os-release is missing from centos-release ?
Supposedly /etc/os-release should be a relative symlink, for "compatibility".

Says http://www.freedesktop.org/software/systemd/man/os-release.html

But you would still need to parse "some other file" to get the minor version.

Since systemd only includes the "operating system version", i.e. 5 or 6 or 7

VERSION="6 (Final)"
ID_LIKE="rhel fedora"
PRETTY_NAME="CentOS 6 (Final)"

So that old redhat-release would still be "needed", for getting at the 6.6...