| |
@@ -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
isexpected. Not having this file causes problems for tools that expect
the data to be in
/usr/lib/os-release
and would regenerate the symlinkin
/etc/os-release
.Reference: https://bugzilla.redhat.com/1766754
Signed-off-by: Neal Gompa ngompa@centosproject.org