From 7168f25ef303bdbc78a3dcd3ad943f4a36d628ea07ee21275b518b560a23abf9 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Tue, 12 Sep 2023 18:29:08 +0000 Subject: [PATCH 1/4] - fixlet-systemd-post.sh: fix invalid use of rpm macro %{_localstatedir} OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1435 --- fixlet-systemd-post.sh | 6 +++--- systemd.changes | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/fixlet-systemd-post.sh b/fixlet-systemd-post.sh index bfccf634..7a111937 100644 --- a/fixlet-systemd-post.sh +++ b/fixlet-systemd-post.sh @@ -252,9 +252,9 @@ fix_bsc_1020601() { # Note: run at each package update. # fix_issue_11329() { - if [ -L %{_localstatedir}/lib/systemd/timesync ]; then - rm %{_localstatedir}/lib/systemd/timesync - mv %{_localstatedir}/lib/private/systemd/timesync %{_localstatedir}/lib/systemd/timesync + if [ -L /var/lib/systemd/timesync ]; then + rm /var/lib/systemd/timesync + mv /var/lib/private/systemd/timesync /var/lib/systemd/timesync fi } diff --git a/systemd.changes b/systemd.changes index 10da63ff..752e342a 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Sep 12 18:28:07 UTC 2023 - Franck Bui + +- fixlet-systemd-post.sh: fix invalid use of rpm macro %{_localstatedir} + ------------------------------------------------------------------- Mon Sep 11 07:54:35 UTC 2023 - Franck Bui From aa65ba49c24ae523bf3a3dcf4a7e9dabc45f3b6a45ab8f32dfac94fe57c75760 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Tue, 12 Sep 2023 18:35:09 +0000 Subject: [PATCH 2/4] only set build option rc-local= when necessary (ie 'sysvcompt' is enabled) OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1436 --- systemd.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/systemd.spec b/systemd.spec index 3c53266b..da681338 100644 --- a/systemd.spec +++ b/systemd.spec @@ -727,8 +727,9 @@ export CFLAGS="%{optflags} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2" %if %{without sysvcompat} -Dsysvinit-path= \ -Dsysvrcnd-path= \ -%endif +%else -Drc-local=/etc/init.d/boot.local \ +%endif -Dcreate-log-dirs=false \ -Ddebug-shell=/bin/bash \ \ From e54cd54d7384ba26b127aaab3ba9b29af5a11eefe8a0f926791093c52ebc65ed Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Tue, 12 Sep 2023 19:31:58 +0000 Subject: [PATCH 3/4] - Don't ship after-local.service anymore. This was mostly a hack for people wanting to execute any random things once the boot was finished. We shouldn't encourage such practice and it actually conflicts with the sysv-generator which believes that /etc/init.d/after.local is SysV init script that needs to be converted into a native unit file. We still install a copy of this service in /etc if the user is relying on it, for backward compatibility. OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1437 --- after-local.service | 17 ----------------- files.systemd | 2 -- fixlet-systemd-post.sh | 21 ++++++++++++++++++++- systemd.changes | 12 ++++++++++++ systemd.spec | 7 +------ 5 files changed, 33 insertions(+), 26 deletions(-) delete mode 100644 after-local.service diff --git a/after-local.service b/after-local.service deleted file mode 100644 index 500c2370..00000000 --- a/after-local.service +++ /dev/null @@ -1,17 +0,0 @@ -# This file is part of systemd. -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. - -[Unit] -Description=/etc/init.d/after.local Compatibility -ConditionFileIsExecutable=/etc/init.d/after.local -After=getty.target - -[Service] -Type=idle -ExecStart=/etc/init.d/after.local -TimeoutSec=0 -RemainAfterExit=yes diff --git a/files.systemd b/files.systemd index 56241dc4..537a3980 100644 --- a/files.systemd +++ b/files.systemd @@ -472,7 +472,6 @@ %{_udevrulesdir}/71-seat.rules %{_udevrulesdir}/73-seat-late.rules %{_udevrulesdir}/99-systemd.rules -%{_unitdir}/after-local.service %{_unitdir}/autovt@.service %{_unitdir}/basic.target %{_unitdir}/blockdev@.target @@ -515,7 +514,6 @@ %{_unitdir}/local-fs.target.wants/tmp.mount %{_unitdir}/modprobe@.service %{_unitdir}/multi-user.target -%{_unitdir}/multi-user.target.wants/after-local.service %{_unitdir}/multi-user.target.wants/getty.target %{_unitdir}/multi-user.target.wants/systemd-logind.service %{_unitdir}/multi-user.target.wants/systemd-user-sessions.service diff --git a/fixlet-systemd-post.sh b/fixlet-systemd-post.sh index 7a111937..1ddb654d 100644 --- a/fixlet-systemd-post.sh +++ b/fixlet-systemd-post.sh @@ -131,6 +131,7 @@ migrate_language () { fi } +# # Migrate old i18n settings previously configured in /etc/sysconfig to the new # locations used by systemd (/etc/locale.conf, /etc/vconsole.conf, ...). Recent # versions of systemd parse the new locations only. @@ -139,7 +140,8 @@ migrate_language () { # might be upgrading from a system which was running SysV init (systemd package # is being installed). # -# It's run only once. +# Note: run only once. +# migrate_sysconfig_i18n() { local tagfile=/var/lib/systemd/rpm/systemd-i18n_migrated local -i rv=0 @@ -258,11 +260,28 @@ fix_issue_11329() { fi } +# +# We don't ship after-local.service anymore however as a courtesy we install a +# copy in /etc for users who are relying on it. +# +# Note: should run only once since it is conditionalized on the presence of +# %{_unitdir}/after-local.service +# +drop_after_local_support() { + if [ -x /etc/init.d/after.local ] && + [ -f /usr/lib/systemd/system/after-local.service ]; then + echo "after-local.service is no more provided by systemd but a copy has been installed in /etc" + cp /usr/lib/systemd/system/after-local.service /etc/systemd/system/ + ln -s ../after-local.service /etc/systemd/system/multi-user.target.wants/after-local.service + fi +} + r=0 fix_machine_id_perms || r=1 fix_pre_210 || r=1 migrate_sysconfig_i18n || r=1 fix_bsc_1020601 || r=1 fix_issue_11329 || r=1 +drop_after_local_support || r=1 exit $r diff --git a/systemd.changes b/systemd.changes index 752e342a..d156a94e 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Tue Sep 12 19:24:02 UTC 2023 - Franck Bui + +- Don't ship after-local.service anymore. This was mostly a hack for people + wanting to execute any random things once the boot was finished. We shouldn't + encourage such practice and it actually conflicts with the sysv-generator + which believes that /etc/init.d/after.local is SysV init script that needs to + be converted into a native unit file. + + We still install a copy of this service in /etc if the user is relying on + it, for backward compatibility. + ------------------------------------------------------------------- Tue Sep 12 18:28:07 UTC 2023 - Franck Bui diff --git a/systemd.spec b/systemd.spec index da681338..78677eb4 100644 --- a/systemd.spec +++ b/systemd.spec @@ -171,7 +171,6 @@ Source4: systemd-sysv-install Source5: tmpfiles-suse.conf Source6: baselibs.conf Source7: triggers.systemd -Source11: after-local.service Source14: kbd-model-map.legacy Source100: fixlet-container-post.sh @@ -922,10 +921,6 @@ mkdir -p %{buildroot}%{_userpresetdir} mkdir -p %{buildroot}%{_systemd_system_env_generator_dir} mkdir -p %{buildroot}%{_systemd_user_env_generator_dir} -# Ensure after.local wrapper is called. -install -m 644 %{SOURCE11} %{buildroot}%{_unitdir}/ -ln -s ../after-local.service %{buildroot}%{_unitdir}/multi-user.target.wants/ - # ghost directories with default permissions. mkdir -p %{buildroot}%{_localstatedir}/lib/systemd/backlight @@ -1069,7 +1064,7 @@ if [ $1 -gt 1 ]; then %systemd_post systemd-userdbd.socket fi -# Run the hacks/fixups to clean up old garbages left by (very) old versions of +# Run the hacks/fixups to clean up the old stuff left by (very) old versions of # systemd. %{_systemd_util_dir}/rpm/fixlet-systemd-post.sh $1 || : From d9c717c4a9de7e76cc35d7e856d4520ecd2bb0f94748f8f1a7b24b9c68ee7cd1 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Thu, 14 Sep 2023 06:36:30 +0000 Subject: [PATCH 4/4] - systemd.spec: %regenerate_initrd_post is only used by udev sub-package hence move the build requirement pulling this macro in in the list of udev BRs. OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1438 --- systemd.changes | 6 ++++++ systemd.spec | 5 ++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/systemd.changes b/systemd.changes index d156a94e..1375f760 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Sep 14 06:33:05 UTC 2023 - Franck Bui + +- systemd.spec: %regenerate_initrd_post is only used by udev sub-package hence + move the build requirement pulling this macro in in the list of udev BRs. + ------------------------------------------------------------------- Tue Sep 12 19:24:02 UTC 2023 - Franck Bui diff --git a/systemd.spec b/systemd.spec index 78677eb4..31a46215 100644 --- a/systemd.spec +++ b/systemd.spec @@ -108,9 +108,6 @@ BuildRequires: libmount-devel >= 2.27.1 BuildRequires: meson >= 0.53.2 BuildRequires: pam-devel BuildRequires: python3-Jinja2 -# regenerate_initrd_post macro is expanded during build, hence this BR. Also -# this macro was introduced since version 12.4. -BuildRequires: suse-module-tools >= 12.4 BuildRequires: systemd-rpm-macros BuildRequires: pkgconfig(blkid) >= 2.26 @@ -307,6 +304,8 @@ Requires(pre): group(kvm) Requires(post): sed Requires(post): coreutils Requires(postun):coreutils +# 'regenerate_initrd_post' macro is expanded during build, hence this BR. +BuildRequires: suse-module-tools %if %{without bootstrap} BuildRequires: pkgconfig(libcryptsetup) >= 1.6.0 BuildRequires: pkgconfig(libkmod) >= 15