Simplify creation of /etc/mtab symlink

It was created unconditionally in %post, so the original contents (if
any) were overwritten. Listing is as %config was just misleading.
Let's simply list the symlink as normal contents in the rpm, so that
rpm can install the symlink for us.

(The scriplet was missing a dependency on coreutils for ln, but let's
not add that if we can drop the whole thing.)
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2022-02-17 13:58:21 +01:00
parent a5fc44bca9
commit f5a343f8a6
1 changed files with 1 additions and 6 deletions

View File

@ -433,11 +433,6 @@ find $RPM_BUILD_ROOT%{_mandir}/man8 -regextype posix-egrep \
-printf "%{_mandir}/man8/%f*\n" >> %{name}.files
%post -n util-linux-core
if [ ! -L /etc/mtab ]; then
ln -sf ../proc/self/mounts /etc/mtab || :
fi
%pre -n uuidd
getent group uuidd >/dev/null || groupadd -r uuidd
getent passwd uuidd >/dev/null || \
@ -740,7 +735,6 @@ fi
%files -n util-linux-core
%ghost %verify(not md5 size mtime) %config(noreplace,missingok) /etc/mtab
%attr(4755,root,root) %{_bindir}/mount
%attr(4755,root,root) %{_bindir}/umount
%{_bindir}/chrt
@ -826,6 +820,7 @@ fi
%{_sbindir}/swapoff
%{_sbindir}/swapon
%{_sbindir}/switch_root
/etc/mtab
%files -n util-linux-user