Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 2068148

Summary: [4.11] /etc/redhat-release symlink is broken
Product: OpenShift Container Platform Reporter: Denis Ollier <dollierp>
Component: RHCOSAssignee: Timothée Ravier <travier>
Status: CLOSED ERRATA QA Contact: Michael Nguyen <mnguyen>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.11CC: apanatto, dornelas, hhei, jligon, miabbott, mrussell, nstielau, walters
Target Milestone: ---   
Target Release: 4.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-10 11:01:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2070888    

Description Denis Ollier 2022-03-24 14:37:08 UTC
Description of problem
----------------------

Some workflows / use cases don't work anymore because /etc/redhat-release seems to be a broken symlink.

Version of all relevant components
----------------------------------

OCP Version: 4.11.0-0.nightly-2022-03-20-160505
RHCOS Version: 411.85.202203181601-0

Steps to reproduce
------------------

1. Deploy an OpenShift 4.11 cluster
2. Log-in to one node and check /etc/redhat-release.

Actual results
--------------

1. /etc/redhat-release is a symlink pointing to a non-existent file (/usr/lib/system-release)
2. /etc/redhat-release is an absolute symlink

Expected results
----------------

1. /etc/redhat-release is a symlink pointing to a valid file (/usr/lib/redhat-release is used in RHCOS-4.10)
2. /etc/redhat-release is a relative symlink (../usr/lib/redhat-release is used in RHCOS-4.10)

Additional info
---------------

This breaks one script used for SR-IOV network operator configuration (https://github.com/openshift/sriov-network-operator/blob/master/bindata/scripts/enable-kargs.sh) which expects /etc/redhat-release to exist and to be a relative symlink because it is accessed through /host mountpoint.

Comment 1 Colin Walters 2022-03-24 14:45:12 UTC
This is from https://github.com/openshift/os/pull/713


> 1. Deploy an OpenShift 4.11 cluster

BTW, as of lately you can just do e.g.:

$ podman run --rm -ti registry.ci.openshift.org/rhcos-devel/rhel-coreos:4.11 

(This is part of https://github.com/openshift/enhancements/pull/1032 , we will be moving the image to a more official place)


> 1. /etc/redhat-release is a symlink pointing to a non-existent file (/usr/lib/system-release)

Yeah, definitely a bug.

(But that said, why are you parsing redhat-release?  The new cross-distribution standard is `/usr/lib/os-release` (or previously `/etc/os-release`))

Comment 2 Denis Ollier 2022-03-24 14:58:38 UTC
(In reply to Colin Walters from comment #1)
> (But that said, why are you parsing redhat-release?  The new
> cross-distribution standard is `/usr/lib/os-release` (or previously
> `/etc/os-release`))

I am innocent :). I'm just a user of the SR-IOV operator.

This script was written by the OpenShift Network SR-IOV team. I don't know if there is a real motivation behind it or they just used /etc/redhat-release out of habit.

Comment 3 Timothée Ravier 2022-03-24 16:33:36 UTC
We will fix that but the script should be looking for /run/ostree-booted instead of greping a release file. Will file an issue.

Comment 4 Timothée Ravier 2022-03-24 16:38:49 UTC
Filed: https://github.com/openshift/sriov-network-operator/issues/647

Comment 5 HuijingHei 2022-06-07 07:43:40 UTC
Verify passed with rhcos-411.86.202206062029-0-qemu.x86_64.qcow2

[core@cosa-devsh ~]$ ll /etc/redhat-release
lrwxrwxrwx. 1 root root 23 Jun  6 20:35 /etc/redhat-release -> /usr/lib/system-release

[core@cosa-devsh ~]$ ll /usr/lib/system-release
-rw-r--r--. 2 root root 45 Jan  1  1970 /usr/lib/system-release

Comment 7 HuijingHei 2022-06-09 06:42:22 UTC
Remove the bootimage tracker bug as it does not need

Comment 8 HuijingHei 2022-06-09 06:55:46 UTC
Verify passed with latest image rhcos-411.86.202206090101-0-qemu.x86_64.qcow2

[core@cosa-devsh ~]$ ll /etc/redhat-release
lrwxrwxrwx. 1 root root 23 Jun  9 01:07 /etc/redhat-release -> /usr/lib/system-release
[core@cosa-devsh ~]$ ll /usr/lib/system-release
-rw-r--r--. 2 root root 45 Jan  1  1970 /usr/lib/system-release

Comment 10 errata-xmlrpc 2022-08-10 11:01:08 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: OpenShift Container Platform 4.11.0 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:5069