From c74b1a000c2e6088a6abd9970b7f0f79af959639618a17db23709df0de30123a Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Fri, 28 Aug 2020 10:41:59 +0000 Subject: [PATCH] - Adjust %pre and %post for the restoration of upstream tmp.mount (boo#1175779) - Adjust %pre and %post for the restoration of upstream tmp.mount (boo#1175779) Now with more whitespace and readlink -f. OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1110 --- systemd-mini.changes | 5 +++++ systemd-mini.spec | 13 +++++++------ systemd.changes | 5 +++++ systemd.spec | 13 +++++++------ 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/systemd-mini.changes b/systemd-mini.changes index a218a91..5ac5e11 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Aug 27 12:51:15 UTC 2020 - Fabian Vogt + +- Adjust %pre and %post for the restoration of upstream tmp.mount (boo#1175779) + ------------------------------------------------------------------- Wed Aug 26 09:46:46 UTC 2020 - Franck Bui diff --git a/systemd-mini.spec b/systemd-mini.spec index a13df83..1b8c166 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -786,12 +786,6 @@ cat %{S:14} >>%{buildroot}%{_datarootdir}/systemd/kbd-model-map # a %pre that needs to be run during the build. systemd is one of them # so keep the section even if it's empty. %pre -if [ $1 -gt 1 ] ; then - case "$(systemctl show -pFragmentPath tmp.mount)" in - FragmentPath=/usr/lib/systemd/system/tmp.mount) - ln -sf %{_datadir}/systemd/tmp.mount /etc/systemd/system/ || : - esac -fi %post # Make /etc/machine-id an empty file during package installation. On @@ -869,6 +863,13 @@ fi # It's run only once. %{_prefix}/lib/systemd/scripts/migrate-sysconfig-i18n.sh || : +# Previous versions had tmp.mount moved to /usr/share/systemd/tmp.mount. +# It could be symlinked into /etc to make /tmp a tmpfs. The file does not exist anymore, +# so migrate the link to the new location. +if [ "$(readlink -f %{_sysconfdir}/systemd/system/tmp.mount)" = "%{_datadir}/systemd/tmp.mount" ] ; then + ln -sf %{_unitdir}/tmp.mount %{_sysconfdir}/systemd/system/tmp.mount +fi + %postun %systemd_postun # Avoid restarting logind until fixed upstream (issue #1163) diff --git a/systemd.changes b/systemd.changes index a218a91..5ac5e11 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Aug 27 12:51:15 UTC 2020 - Fabian Vogt + +- Adjust %pre and %post for the restoration of upstream tmp.mount (boo#1175779) + ------------------------------------------------------------------- Wed Aug 26 09:46:46 UTC 2020 - Franck Bui diff --git a/systemd.spec b/systemd.spec index b2ff8ec..a45247b 100644 --- a/systemd.spec +++ b/systemd.spec @@ -784,12 +784,6 @@ cat %{S:14} >>%{buildroot}%{_datarootdir}/systemd/kbd-model-map # a %pre that needs to be run during the build. systemd is one of them # so keep the section even if it's empty. %pre -if [ $1 -gt 1 ] ; then - case "$(systemctl show -pFragmentPath tmp.mount)" in - FragmentPath=/usr/lib/systemd/system/tmp.mount) - ln -sf %{_datadir}/systemd/tmp.mount /etc/systemd/system/ || : - esac -fi %post # Make /etc/machine-id an empty file during package installation. On @@ -867,6 +861,13 @@ fi # It's run only once. %{_prefix}/lib/systemd/scripts/migrate-sysconfig-i18n.sh || : +# Previous versions had tmp.mount moved to /usr/share/systemd/tmp.mount. +# It could be symlinked into /etc to make /tmp a tmpfs. The file does not exist anymore, +# so migrate the link to the new location. +if [ "$(readlink -f %{_sysconfdir}/systemd/system/tmp.mount)" = "%{_datadir}/systemd/tmp.mount" ] ; then + ln -sf %{_unitdir}/tmp.mount %{_sysconfdir}/systemd/system/tmp.mount +fi + %postun %systemd_postun # Avoid restarting logind until fixed upstream (issue #1163)