#9 Install os-release(5) content to /usr/lib and have /etc/os-release be a symlink
Closed 4 years ago by bstinson. Opened 4 years ago by ngompa.
rpms/ ngompa/centos-release c8-fix-os-release-installation  into  c8

file modified
+8 -3
@@ -115,8 +115,9 @@ 

  %install

  rm -rf %{buildroot}

  

- # create /etc

+ # create skeleton

  mkdir -p %{buildroot}/etc

+ mkdir -p %{buildroot}%{_prefix}/lib

  

  # create /etc/system-release and /etc/redhat-release

  echo "%{product_family} release %{full_release_version}.%{centos_rel} (%{release_name}) " > %{buildroot}/etc/centos-release
@@ -124,8 +125,8 @@ 

  ln -s centos-release %{buildroot}/etc/system-release

  ln -s centos-release %{buildroot}/etc/redhat-release

  

- # create /etc/os-release

- cat << EOF >>%{buildroot}/etc/os-release

+ # Create the os-release file

+ cat << EOF >>%{buildroot}%{_prefix}/lib/os-release

  NAME="%{product_family}"

  VERSION="%{full_release_version} (%{release_name})"

  ID="centos"
@@ -144,6 +145,9 @@ 

  REDHAT_SUPPORT_PRODUCT_VERSION="%{base_release_version}"

  

  EOF

+ # Create the symlink for /etc/os-release

+ ln -s ../usr/lib/os-release %{buildroot}%{_sysconfdir}/os-release

+ 

  # write cpe to /etc/system/release-cpe

  echo "cpe:/o:centos:centos:%{base_release_version}" > %{buildroot}/etc/system-release-cpe

  
@@ -235,6 +239,7 @@ 

  %{_docdir}/centos-release/*

  %{_datadir}/redhat-release

  %{_datadir}/centos-release/*

+ %{_prefix}/lib/os-release

  %{_prefix}/lib/systemd/system-preset/*

  %ifarch %{arm}

  %attr(0755,root,root) %{_bindir}/update-boot

When trying to use CentOS to build "stateless" systems or building nspawn
containers, the presence of os-release(5) data in /usr/lib/os-release is
expected. Not having this file causes problems for tools that expect
the data to be in /usr/lib/os-release and would regenerate the symlink
in /etc/os-release.

Reference: https://bugzilla.redhat.com/1766754

Signed-off-by: Neal Gompa ngompa@centosproject.org

+1 from me, will merge this in with a batch of changes shortly

@bstinson any timeline on merging this?

We're working on the rest of the batch this week. Shouldn't be too much longer yet.

We'll take care of bumping the release, could you please leave this out?

%(buildroot}%(_prefix}/lib/ does not exist as a directory at this point in the spec. Can we create it before this please?

We'll give you credit in the changelog entry, but we use the changelog headers to define who actually performed the build, could you take this part out as well?

rebased onto b9613e0

4 years ago

Pull-Request has been closed by bstinson

4 years ago
Metadata