View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0017071||CentOS-8||centos-release||public||2020-02-20 10:57||2020-02-20 12:13|
|Summary||0017071: /etc/os-release does not contain minor in VERSION_ID (unlike RHEL)|
|Description||On RHEL the VERSION_ID is set properly including the dot release as in:|
VERSION_ID="8.0" (or 8.1 and so on)
whereas on CENTOS is always stays at the major release as in
VERSION_ID="8" (or 7)
I know there are several workarounds for this (centos-release package version, /etc/centos-release,...), but we need to special case CENTOS vs. RHEL. At least my hope with /etc/os-release was that we can get over all this special detection magic.
It really gets nasty if we want to detect the exact host version within a container. For all other distributions we support bind-mounting /etc/os-release is good enough. For CENTOS our uses would also need to bind-mount /etc/centos-release. Obviously "hacks" like querying centos-release version in the container would not help. One workaround I hoped would work is querying 'uname -r', but this does not work across versions.
on 8.1: 4.18.0-147.5.1.el8_1.x86_64 # wooho, let's grep the minor from "el8_1"
on 7.7: 3.10.0-1062.7.1.el7.x86_64 # no minor in the el part
So is there a reason CENTOS does not add the minor to /etc/os-release while RHEL does? To me it feels like it should contain it.
|Steps To Reproduce||cat /etc/os-release on CENTOS7/8 vs RHEL7/8|
|Tags||No tags attached.|
The 'uname -r' hack part can be ignored, that would not even work on CENTOS. there are kernels on 8.1 that only have an "el8".
While not optimal, having a "CENTOS_MINOR" or "CENTOS_FULL_VERSION_ID" would also help if changing (but IMO fixing) the semantics of VERSION_ID is not an option.