On RHEL 8, there's no /usr/lib/os-release, and /etc/os-release is a regular file instead of a symbolic link. This is different from Fedora, where /etc/os-release is a symbolic link to /usr/lib/os-release. This set-up helps have stateless OSes, makes it easier to implement factory reset, etc. [1] and is quite helpful for variants like CoreOS and Silverblue. [1] http://0pointer.net/blog/projects/stateless.html
This make sense to me. I'd like to hear from Ian if it would indeed help RHCOS.
For what it's worth, I had briefly discussed this with sgallagh on IRC before filing this bug.
One of my motivations for filing this was from the perspective of the Toolbox [1] project. Toolbox looks at /usr/lib/os-release for various reasons, and it was pointed out that both RHEL and CentOS 8 are different from Fedora in that regard. Having this minor delta ironed out would be nice. [1] https://github.com/containers/toolbox
I just stumbled across this issue for osbuild as well. It uses systemd-nspawn with an (almost) empty `/etc` to create images that are independent from host configuration. nspawn creates the symlink `/etc/os-release`, but on RHEL it ends up dangling. This is also contrary to the man page `os-release(5)`.
I've also just encountered this problem myself when trying to build images and containers using RHEL 8 and CentOS 8. I've made a proposed fix for centos-release, which should be a good reference for how to fix it in RHEL: https://git.centos.org/rpms/centos-release/pull-request/9
RTT has prodvided qe_ack+. We will also extend existing redhat-release content verification tests to cover this as well.
Code committed. Thank you to Neal for the implementation reference.
I tried to verify this on RHEL-8.2.0-Snapshot-3.0 -> RHEL-8.2.0-20200310.0: # ls -l /usr/lib/os-release /etc/os-release lrwxrwxrwx. 1 root root 22 Mar 9 15:03 /etc/os-release -> ..//usr/lib/os-release -rw-r--r--. 1 root root 513 Mar 9 15:03 /usr/lib/os-release Is it deliberate that there are // at the beginning of the referenced path in the symlink?
I didn't actually implement this, it was tacked on as part of rebuild for another bug so i will need to ping others to get that information for you
(In reply to Peter Kotvan from comment #14) > I tried to verify this on RHEL-8.2.0-Snapshot-3.0 -> RHEL-8.2.0-20200310.0: > > # ls -l /usr/lib/os-release /etc/os-release > lrwxrwxrwx. 1 root root 22 Mar 9 15:03 /etc/os-release -> > ..//usr/lib/os-release > -rw-r--r--. 1 root root 513 Mar 9 15:03 /usr/lib/os-release > > Is it deliberate that there are // at the beginning of the referenced path > in the symlink? No. At the same time, it doesn't functionally change anything. We can fix it in 8.3.0.
Josh Boyer has provided the requested information