From 95a9adc4b86e2d63636ac9f8f736068daee348056298ee53316017db8f6cdcb4 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Mon, 14 Feb 2022 07:34:49 +0000 Subject: [PATCH 1/5] - systemd.spec: explicitely turn on/off build options OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1248 --- systemd.changes | 8 ++++ systemd.spec | 98 ++++++++++++++++++------------------------------- 2 files changed, 43 insertions(+), 63 deletions(-) diff --git a/systemd.changes b/systemd.changes index 0ab20e7..5f79326 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Feb 14 07:31:49 UTC 2022 - Franck Bui + +- systemd.spec: explicitely turn on/off build options + + Hence a feature can't be accidentally turned on/off because its dep is pulled + in or removed due to another feature being turned on/off. + ------------------------------------------------------------------- Fri Feb 4 15:22:43 UTC 2022 - Franck Bui diff --git a/systemd.spec b/systemd.spec index 4ef6b10..33e1c2b 100644 --- a/systemd.spec +++ b/systemd.spec @@ -17,7 +17,7 @@ # -# The git repository used to track all Suse specific changes can be +# The git repository used to track all SUSE specific changes can be # found at: https://github.com/openSUSE/systemd. # @@ -35,6 +35,9 @@ %define suse_version +suse.82.g117bd7f14a %define _testsuitedir /usr/lib/systemd/tests +# Similar to %with but returns true/false +%define when() %{expand:%%{?with_%{1}:true}%%{!?with_%{1}:false}} + %if 0%{?bootstrap} %bcond_with coredump %bcond_with importd @@ -134,6 +137,8 @@ BuildRequires: gnu-efi #!BuildIgnore: dbus-1 Requires: this-is-only-for-build-envs Provides: systemd = %{version}-%{release} +Conflicts: kiwi +Conflicts: systemd %else # the buildignore is important for bootstrapping #!BuildIgnore: udev @@ -157,11 +162,6 @@ Requires(post): findutils Requires(post): systemd-presets-branding Requires(post): pam-config >= 0.79-5 %endif - -%if 0%{?bootstrap} -Conflicts: kiwi -Conflicts: systemd -%endif Conflicts: filesystem < 11.5 Conflicts: mkinitrd < 2.7.0 Conflicts: sysvinit @@ -623,13 +623,21 @@ Have fun with these services at your own risk. -Dsplit-bin=true \ -Dsystem-uid-max=499 \ -Dsystem-gid-max=499 \ + -Dadm-group=false \ + -Dwheel-group=false \ + -Dgshadow=false \ + -Ddefault-hierarchy=unified \ + -Ddefault-kill-user-processes=false \ + -Dldconfig=false \ -Dpamconfdir=no \ -Dpamlibdir=%{_pam_moduledir} \ -Dxinitrcdir=%{_distconfdir}/X11/xinit/xinitrc.d \ -Drpmmacrosdir=no \ -Dcertificate-root=%{_sysconfdir}/pki/systemd \ - -Ddefault-hierarchy=unified \ - -Ddefault-kill-user-processes=false \ +%if %{without sysvcompat} + -Dsysvinit-path= \ + -Dsysvrcnd-path= \ +%endif -Drc-local=/etc/init.d/boot.local \ -Dcreate-log-dirs=false \ -Dbump-proc-sys-fs-nr-open=false \ @@ -641,17 +649,6 @@ Have fun with these services at your own risk. -Dima=false \ -Delfutils=auto \ -Doomd=false \ -%if %{with experimental} - -Dpstore=true \ - -Drepart=true \ - -Dhomed=true \ - -Duserdb=true \ -%else - -Dpstore=false \ - -Drepart=false \ - -Dhomed=false \ - -Duserdb=false \ -%endif %if 0%{?bootstrap} -Dbashcompletiondir=no \ -Dzshcompletiondir=no \ @@ -663,53 +660,28 @@ Have fun with these services at your own risk. -Dman=true \ -Dhtml=true \ %endif -%if %{without coredump} - -Dcoredump=false \ -%endif -%if %{without sd_boot} - -Defi=false \ - -Dgnu-efi=false \ -%else - -Defi=true \ - -Dgnu-efi=true \ -%endif -%if %{without importd} - -Dimportd=false \ -%endif -%if %{without journal_remote} - -Dremote=false \ -%endif -%if %{without portabled} - -Dportabled=false \ -%endif -%if %{without machined} - -Dmachined=false \ -%endif -%if %{without networkd} - -Dnetworkd=false \ -%endif -%if %{without resolved} - -Dresolve=false \ -%else + -Dcoredump=%{when coredump} \ + -Dimportd=%{when importd} \ + -Dmachined=%{when machined} \ + -Dnetworkd=%{when networkd} \ + -Dportabled=%{when portabled} \ + -Dremote=%{when journal_remote} \ + \ + -Defi=%{when sd_boot} \ + -Dgnu-efi=%{when sd_boot} \ + \ + -Dresolve=%{when resolved} \ -Ddns-servers='' \ -Ddefault-dnssec=no \ -Ddns-over-tls=openssl \ -%endif -%if %{without sysvcompat} - -Dsysvinit-path= \ - -Dsysvrcnd-path= \ -%endif -%if %{with testsuite} - -Dtests=unsafe \ - -Dinstall-tests=true \ -%else - -Dtests=false \ - -Dinstall-tests=false \ -%endif - -Dadm-group=false \ - -Dwheel-group=false \ - -Dgshadow=false \ - -Dldconfig=false + \ + -Dpstore=%{when experimental} \ + -Drepart=%{when experimental} \ + -Dhomed=%{when experimental} \ + -Duserdb=%{when experimental} \ + \ + -Dtests=%{?with_testsuite:unsafe}%{!?with_testsuite:false} \ + -Dinstall-tests=%{when testsuite} %meson_build From dad59c609295ee8be0477f0d5278e087abf99735cc3eba14a1c6d49c95d78054 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Mon, 14 Feb 2022 08:51:10 +0000 Subject: [PATCH 2/5] fix build of mini falvor by allowing a second parameter with %when OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1249 --- systemd.spec | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/systemd.spec b/systemd.spec index 33e1c2b..64466d9 100644 --- a/systemd.spec +++ b/systemd.spec @@ -35,8 +35,11 @@ %define suse_version +suse.82.g117bd7f14a %define _testsuitedir /usr/lib/systemd/tests -# Similar to %with but returns true/false -%define when() %{expand:%%{?with_%{1}:true}%%{!?with_%{1}:false}} +# Similar to %%with but returns true/false. The 'true' value can be redefined +# when a second parameter is passed. +%define __when_1() %{expand:%%{?with_%{1}:true}%%{!?with_%{1}:false}} +%define __when_2() %{expand:%%{?with_%{1}:%{2}}%%{!?with_%{1}:false}} +%define when() %{expand:%%__when_%# %{*}} %if 0%{?bootstrap} %bcond_with coredump @@ -673,14 +676,14 @@ Have fun with these services at your own risk. -Dresolve=%{when resolved} \ -Ddns-servers='' \ -Ddefault-dnssec=no \ - -Ddns-over-tls=openssl \ + -Ddns-over-tls=%{when resolved openssl} \ \ -Dpstore=%{when experimental} \ -Drepart=%{when experimental} \ -Dhomed=%{when experimental} \ -Duserdb=%{when experimental} \ \ - -Dtests=%{?with_testsuite:unsafe}%{!?with_testsuite:false} \ + -Dtests=%{when testsuite unsafe} \ -Dinstall-tests=%{when testsuite} %meson_build From c3de8124abd9a213a1ae4d12088224b184f24f8108895991dbe6c06763400c75 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Mon, 14 Feb 2022 09:09:21 +0000 Subject: [PATCH 3/5] - Rename systemd-sysvinit into systemd-sysvcompat systemd-sysvinit was probably provided to allow systems to switch from sysvinit to systemd by overwriting /sbin/init with a link to systemd. But this isn't very useful anymore due to the fact that sysvinit is not supported since several years. Therefore the subpackage contains now the files needed to keep backward compatibility with SysV init scripts (most notably sysv-generator) and has been renamed accordingly. The few files that are not specific to sysvinit (such as /bin/init) have been moved to the main package. Normally this new subpackage shouldn't be needed (since all packages use systemd unit files) unless a 3rd party application is installed and still relies on SysV init scripts. OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1250 --- files.systemd | 84 ++++++++---------------------------------- files.sysvcompat | 96 ++++++++++++++++++++++++++++++++++++++++++++++++ systemd.changes | 17 +++++++++ systemd.spec | 64 +++++++++++++------------------- 4 files changed, 154 insertions(+), 107 deletions(-) create mode 100644 files.sysvcompat diff --git a/files.systemd b/files.systemd index 1a2d79a..79a3cc4 100644 --- a/files.systemd +++ b/files.systemd @@ -30,10 +30,6 @@ %dir %{_journalcatalogdir} %dir %{_localstatedir}/lib/systemd %dir %{_localstatedir}/lib/systemd/catalog -%if %{with sysvcompat} -%dir %{_localstatedir}/lib/systemd/migrated -%dir %{_localstatedir}/lib/systemd/sysv-convert -%endif %dir %{_modprobedir} %dir %{_modulesloaddir} %dir %{_prefix}/lib/kernel @@ -82,13 +78,6 @@ %dir %{_unitdir}/reboot.target.wants %dir %{_unitdir}/remote-fs.target.wants %dir %{_unitdir}/rescue.target.wants -%if %{with sysvcompat} -%dir %{_unitdir}/runlevel1.target.wants -%dir %{_unitdir}/runlevel2.target.wants -%dir %{_unitdir}/runlevel3.target.wants -%dir %{_unitdir}/runlevel4.target.wants -%dir %{_unitdir}/runlevel5.target.wants -%endif %dir %{_unitdir}/shutdown.target.wants %dir %{_unitdir}/sockets.target.wants %dir %{_unitdir}/sysinit.target.wants @@ -236,6 +225,7 @@ %endif %{_mandir}/man1/busctl.1.gz %{_mandir}/man1/hostnamectl.1.gz +%{_mandir}/man1/init.1.gz %{_mandir}/man1/journalctl.1.gz %{_mandir}/man1/localectl.1.gz %{_mandir}/man1/loginctl.1.gz @@ -347,9 +337,13 @@ %{_mandir}/man7/systemd.syntax.7.gz %{_mandir}/man7/systemd.time.7.gz %{_mandir}/man8/30-systemd-environment-d-generator.8.gz +%{_mandir}/man8/halt.8.gz %{_mandir}/man8/kernel-install.8.gz %{_mandir}/man8/pam_systemd.8.gz +%{_mandir}/man8/poweroff.8.gz %{_mandir}/man8/rc-local.service.8.gz +%{_mandir}/man8/reboot.8.gz +%{_mandir}/man8/shutdown.8.gz %{_mandir}/man8/systemd-ask-password-console.path.8.gz %{_mandir}/man8/systemd-ask-password-console.service.8.gz %{_mandir}/man8/systemd-ask-password-wall.path.8.gz @@ -389,9 +383,6 @@ %{_mandir}/man8/systemd-hostnamed.8.gz %{_mandir}/man8/systemd-hostnamed.service.8.gz %{_mandir}/man8/systemd-hybrid-sleep.service.8.gz -%{_mandir}/man8/systemd-initctl.8.gz -%{_mandir}/man8/systemd-initctl.service.8.gz -%{_mandir}/man8/systemd-initctl.socket.8.gz %{_mandir}/man8/systemd-journald-audit.socket.8.gz %{_mandir}/man8/systemd-journald-dev-log.socket.8.gz %{_mandir}/man8/systemd-journald-varlink@.socket.8.gz @@ -416,7 +407,6 @@ %{_mandir}/man8/systemd-quotacheck.service.8.gz %{_mandir}/man8/systemd-random-seed.8.gz %{_mandir}/man8/systemd-random-seed.service.8.gz -%{_mandir}/man8/systemd-rc-local-generator.8.gz %{_mandir}/man8/systemd-reboot.service.8.gz %{_mandir}/man8/systemd-remount-fs.8.gz %{_mandir}/man8/systemd-remount-fs.service.8.gz @@ -436,7 +426,6 @@ %{_mandir}/man8/systemd-system-update-generator.8.gz %{_mandir}/man8/systemd-sysusers.8.gz %{_mandir}/man8/systemd-sysusers.service.8.gz -%{_mandir}/man8/systemd-sysv-generator.8.gz %{_mandir}/man8/systemd-time-wait-sync.8.gz %{_mandir}/man8/systemd-time-wait-sync.service.8.gz %{_mandir}/man8/systemd-timedated.8.gz @@ -450,7 +439,6 @@ %{_mandir}/man8/systemd-tmpfiles.8.gz %{_mandir}/man8/systemd-update-done.8.gz %{_mandir}/man8/systemd-update-done.service.8.gz -%{_mandir}/man8/systemd-update-utmp-runlevel.service.8.gz %{_mandir}/man8/systemd-update-utmp.8.gz %{_mandir}/man8/systemd-update-utmp.service.8.gz %{_mandir}/man8/systemd-user-sessions.8.gz @@ -470,6 +458,11 @@ %{_prefix}/lib/kernel/install.d/00-entry-directory.install %{_prefix}/lib/kernel/install.d/50-depmod.install %{_prefix}/lib/kernel/install.d/90-loaderentry.install +%{_sbindir}/halt +%{_sbindir}/init +%{_sbindir}/poweroff +%{_sbindir}/reboot +%{_sbindir}/shutdown %{_sysconfdir}/xdg/systemd/user %{_sysctldir}/99-sysctl.conf %{_systemd_user_env_generator_dir}/30-systemd-environment-d-generator @@ -500,9 +493,6 @@ %{_systemd_util_dir}/systemd-growfs %{_systemd_util_dir}/systemd-hibernate-resume %{_systemd_util_dir}/systemd-hostnamed -%if %{with sysvcompat} -%{_systemd_util_dir}/systemd-initctl -%endif %{_systemd_util_dir}/systemd-journald %{_systemd_util_dir}/systemd-localed %{_systemd_util_dir}/systemd-logind @@ -518,10 +508,6 @@ %{_systemd_util_dir}/systemd-socket-proxyd %{_systemd_util_dir}/systemd-sulogin-shell %{_systemd_util_dir}/systemd-sysctl -%if %{with sysvcompat} -%{_systemd_util_dir}/systemd-sysv-convert -%{_systemd_util_dir}/systemd-sysv-install -%endif %{_systemd_util_dir}/systemd-time-wait-sync %{_systemd_util_dir}/systemd-timedated %{_systemd_util_dir}/systemd-timesyncd @@ -570,14 +556,8 @@ %{_systemdgeneratordir}/systemd-getty-generator %{_systemdgeneratordir}/systemd-gpt-auto-generator %{_systemdgeneratordir}/systemd-hibernate-resume-generator -%if %{with sysvcompat} -%{_systemdgeneratordir}/systemd-rc-local-generator -%endif %{_systemdgeneratordir}/systemd-run-generator %{_systemdgeneratordir}/systemd-system-update-generator -%if %{with sysvcompat} -%{_systemdgeneratordir}/systemd-sysv-generator -%endif %if ! 0%{?bootstrap} %{_systemdgeneratordir}/systemd-veritysetup-generator %endif @@ -628,9 +608,6 @@ %{_unitdir}/getty.target %{_unitdir}/getty@.service %{_unitdir}/graphical.target -%if %{with sysvcompat} -%{_unitdir}/graphical.target.wants/systemd-update-utmp-runlevel.service -%endif %{_unitdir}/halt.target %{_unitdir}/hibernate.target %{_unitdir}/hybrid-sleep.target @@ -651,18 +628,11 @@ %{_unitdir}/local-fs-pre.target %{_unitdir}/local-fs.target %{_unitdir}/local-fs.target.wants/tmp.mount -%if %{with sysvcompat} -%{_unitdir}/local-fs.target.wants/var-lock.mount -%{_unitdir}/local-fs.target.wants/var-run.mount -%endif %{_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 -%if %{with sysvcompat} -%{_unitdir}/multi-user.target.wants/systemd-update-utmp-runlevel.service -%endif %{_unitdir}/multi-user.target.wants/systemd-user-sessions.service %{_unitdir}/network-online.target %{_unitdir}/network-pre.target @@ -675,9 +645,6 @@ %{_unitdir}/proc-sys-fs-binfmt_misc.automount %{_unitdir}/proc-sys-fs-binfmt_misc.mount %{_unitdir}/quotaon.service -%if %{with sysvcompat} -%{_unitdir}/rc-local.service -%endif %{_unitdir}/reboot.target %if ! 0%{?bootstrap} %{_unitdir}/remote-cryptsetup.target @@ -689,19 +656,7 @@ %endif %{_unitdir}/rescue.service %{_unitdir}/rescue.target -%if %{with sysvcompat} -%{_unitdir}/rescue.target.wants/systemd-update-utmp-runlevel.service -%endif %{_unitdir}/rpcbind.target -%if %{with sysvcompat} -%{_unitdir}/runlevel0.target -%{_unitdir}/runlevel1.target -%{_unitdir}/runlevel2.target -%{_unitdir}/runlevel3.target -%{_unitdir}/runlevel4.target -%{_unitdir}/runlevel5.target -%{_unitdir}/runlevel6.target -%endif %{_unitdir}/serial-getty@.service %{_unitdir}/shutdown.target %{_unitdir}/sigpwr.target @@ -709,9 +664,6 @@ %{_unitdir}/slices.target %{_unitdir}/smartcard.target %{_unitdir}/sockets.target -%if %{with sysvcompat} -%{_unitdir}/sockets.target.wants/systemd-initctl.socket -%endif %{_unitdir}/sockets.target.wants/systemd-journald-dev-log.socket %{_unitdir}/sockets.target.wants/systemd-journald.socket %{_unitdir}/sound.target @@ -783,10 +735,6 @@ %{_unitdir}/systemd-hibernate.service %{_unitdir}/systemd-hostnamed.service %{_unitdir}/systemd-hybrid-sleep.service -%if %{with sysvcompat} -%{_unitdir}/systemd-initctl.service -%{_unitdir}/systemd-initctl.socket -%endif %{_unitdir}/systemd-journal-catalog-update.service %{_unitdir}/systemd-journal-flush.service %{_unitdir}/systemd-journald-dev-log.socket @@ -820,9 +768,6 @@ %{_unitdir}/systemd-tmpfiles-setup-dev.service %{_unitdir}/systemd-tmpfiles-setup.service %{_unitdir}/systemd-update-done.service -%if %{with sysvcompat} -%{_unitdir}/systemd-update-utmp-runlevel.service -%endif %{_unitdir}/systemd-update-utmp.service %{_unitdir}/systemd-user-sessions.service %{_unitdir}/systemd-vconsole-setup.service @@ -839,14 +784,15 @@ %{_unitdir}/user-runtime-dir@.service %{_unitdir}/user.slice %{_unitdir}/user@.service -%if %{with sysvcompat} -%{_unitdir}/var-lock.mount -%{_unitdir}/var-run.mount -%endif %if ! 0%{?bootstrap} %{_unitdir}/veritysetup-pre.target %{_unitdir}/veritysetup.target %endif %if %{with split_usr} /bin/systemctl +/sbin/halt +/sbin/init +/sbin/poweroff +/sbin/reboot +/sbin/shutdown %endif diff --git a/files.sysvcompat b/files.sysvcompat new file mode 100644 index 0000000..3a62dc7 --- /dev/null +++ b/files.sysvcompat @@ -0,0 +1,96 @@ +# +# Please keep the list sorted (with `LC_ALL=C sort`). +# +%dir %{_localstatedir}/lib/systemd/migrated +%dir %{_localstatedir}/lib/systemd/sysv-convert +%dir %{_unitdir}/runlevel1.target.wants +%dir %{_unitdir}/runlevel2.target.wants +%dir %{_unitdir}/runlevel3.target.wants +%dir %{_unitdir}/runlevel4.target.wants +%dir %{_unitdir}/runlevel5.target.wants +%{_mandir}/man8/runlevel.8.gz +%{_mandir}/man8/systemd-initctl.8.gz +%{_mandir}/man8/systemd-initctl.service.8.gz +%{_mandir}/man8/systemd-initctl.socket.8.gz +%{_mandir}/man8/systemd-rc-local-generator.8.gz +%{_mandir}/man8/systemd-sysv-generator.8.gz +%{_mandir}/man8/systemd-update-utmp-runlevel.service.8.gz +%{_mandir}/man8/telinit.8.gz +%{_sbindir}/runlevel +%{_sbindir}/telinit +%{_systemd_util_dir}/systemd-initctl +%{_systemd_util_dir}/systemd-sysv-convert +%{_systemd_util_dir}/systemd-sysv-install +%{_systemdgeneratordir}/systemd-rc-local-generator +%{_systemdgeneratordir}/systemd-sysv-generator +%{_unitdir}/graphical.target.wants/systemd-update-utmp-runlevel.service +%{_unitdir}/local-fs.target.wants/var-lock.mount +%{_unitdir}/local-fs.target.wants/var-run.mount +%{_unitdir}/multi-user.target.wants/systemd-update-utmp-runlevel.service +%{_unitdir}/rc-local.service +%{_unitdir}/rescue.target.wants/systemd-update-utmp-runlevel.service +%{_unitdir}/runlevel0.target +%{_unitdir}/runlevel1.target +%{_unitdir}/runlevel2.target +%{_unitdir}/runlevel3.target +%{_unitdir}/runlevel4.target +%{_unitdir}/runlevel5.target +%{_unitdir}/runlevel6.target +%{_unitdir}/sockets.target.wants/systemd-initctl.socket +%{_unitdir}/systemd-initctl.service +%{_unitdir}/systemd-initctl.socket +%{_unitdir}/systemd-update-utmp-runlevel.service +%{_unitdir}/var-lock.mount +%{_unitdir}/var-run.mount +%if %{with split_usr} +/sbin/runlevel +/sbin/telinit +%endif +# +# Please keep the list sorted (with `LC_ALL=C sort`). +# +%dir %{_localstatedir}/lib/systemd/migrated +%dir %{_localstatedir}/lib/systemd/sysv-convert +%dir %{_unitdir}/runlevel1.target.wants +%dir %{_unitdir}/runlevel2.target.wants +%dir %{_unitdir}/runlevel3.target.wants +%dir %{_unitdir}/runlevel4.target.wants +%dir %{_unitdir}/runlevel5.target.wants +%{_mandir}/man8/runlevel.8.gz +%{_mandir}/man8/systemd-initctl.8.gz +%{_mandir}/man8/systemd-initctl.service.8.gz +%{_mandir}/man8/systemd-initctl.socket.8.gz +%{_mandir}/man8/systemd-rc-local-generator.8.gz +%{_mandir}/man8/systemd-sysv-generator.8.gz +%{_mandir}/man8/systemd-update-utmp-runlevel.service.8.gz +%{_mandir}/man8/telinit.8.gz +%{_sbindir}/runlevel +%{_sbindir}/telinit +%{_systemd_util_dir}/systemd-initctl +%{_systemd_util_dir}/systemd-sysv-convert +%{_systemd_util_dir}/systemd-sysv-install +%{_systemdgeneratordir}/systemd-rc-local-generator +%{_systemdgeneratordir}/systemd-sysv-generator +%{_unitdir}/graphical.target.wants/systemd-update-utmp-runlevel.service +%{_unitdir}/local-fs.target.wants/var-lock.mount +%{_unitdir}/local-fs.target.wants/var-run.mount +%{_unitdir}/multi-user.target.wants/systemd-update-utmp-runlevel.service +%{_unitdir}/rc-local.service +%{_unitdir}/rescue.target.wants/systemd-update-utmp-runlevel.service +%{_unitdir}/runlevel0.target +%{_unitdir}/runlevel1.target +%{_unitdir}/runlevel2.target +%{_unitdir}/runlevel3.target +%{_unitdir}/runlevel4.target +%{_unitdir}/runlevel5.target +%{_unitdir}/runlevel6.target +%{_unitdir}/sockets.target.wants/systemd-initctl.socket +%{_unitdir}/systemd-initctl.service +%{_unitdir}/systemd-initctl.socket +%{_unitdir}/systemd-update-utmp-runlevel.service +%{_unitdir}/var-lock.mount +%{_unitdir}/var-run.mount +%if %{with split_usr} +/sbin/runlevel +/sbin/telinit +%endif diff --git a/systemd.changes b/systemd.changes index 5f79326..de632c3 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,20 @@ +------------------------------------------------------------------- +Mon Feb 14 07:39:12 UTC 2022 - Franck Bui + +- Rename systemd-sysvinit into systemd-sysvcompat + + systemd-sysvinit was probably provided to allow systems to switch from + sysvinit to systemd by overwriting /sbin/init with a link to systemd. But this + isn't very useful anymore due to the fact that sysvinit is not supported since + several years. Therefore the subpackage contains now the files needed to keep + backward compatibility with SysV init scripts (most notably sysv-generator) + and has been renamed accordingly. The few files that are not specific to + sysvinit (such as /bin/init) have been moved to the main package. + + Normally this new subpackage shouldn't be needed (since all packages use + systemd unit files) unless a 3rd party application is installed and still + relies on SysV init scripts. + ------------------------------------------------------------------- Mon Feb 14 07:31:49 UTC 2022 - Franck Bui diff --git a/systemd.spec b/systemd.spec index 64466d9..5fe9b17 100644 --- a/systemd.spec +++ b/systemd.spec @@ -167,9 +167,14 @@ Requires(post): pam-config >= 0.79-5 %endif Conflicts: filesystem < 11.5 Conflicts: mkinitrd < 2.7.0 +Provides: sbin_init +Provides: sysvinit:/sbin/init +Conflicts: sbin_init Conflicts: sysvinit Provides: systemd-logger = %{version}-%{release} Obsoletes: systemd-logger < %{version}-%{release} +Provides: systemd-sysvinit = %{version}-%{release} +Obsoletes: systemd-sysvinit < %{version}-%{release} Provides: systemd-analyze = %{version}-%{release} Obsoletes: pm-utils <= 1.4.1 Obsoletes: suspend <= 1.0 @@ -195,6 +200,7 @@ Source201: files.udev Source202: files.container Source203: files.network Source204: files.devel +Source205: files.sysvcompat # Patches listed below are openSUSE specific and should be kept at its # minimum. We try hard to push our changes to upstream but sometimes they are @@ -258,17 +264,24 @@ Conflicts: libudev-devel Development headers and files for libsystemd and libudev libraries for developing and building applications linking to these libraries. -%package sysvinit -Summary: System V init tools +%if %{with sysvcompat} +%package sysvcompat +Summary: SySV and LSB init script support for systemd (deprecated) License: LGPL-2.1-or-later Requires: %{name} = %{version}-%{release} -Provides: sbin_init -Conflicts: sbin_init -Provides: systemd-sysvinit = %{version}-%{release} -Provides: sysvinit:/sbin/init +Provides: systemd-sysvinit:%{_sbindir}/runlevel +Provides: systemd-sysvinit:%{_sbindir}/telinit -%description sysvinit -Drop-in replacement of System V init tools. +%description sysvcompat +This package ships the necessary files that enable minimal SysV and LSB init +scripts support in systemd. It also contains the obsolete SysV init tools +telinit(8) and runlevel(8). You should consider using systemctl(1) instead. + +Unless you have a 3rd party application installed on your system that still +relies on such scripts, this package should not be needed at all. + +Please note that the content of this package is considered as deprecated. +%endif %package -n libsystemd0%{?mini} Summary: Component library for systemd @@ -724,12 +737,13 @@ mkdir -p %{buildroot}/{bin,sbin} # Legacy paths ln -s ../usr/bin/udevadm %{buildroot}/sbin/ ln -s ../usr/bin/systemctl %{buildroot}/bin/ -# Legacy sysvinit tools + ln -s ../usr/lib/systemd/systemd %{buildroot}/sbin/init ln -s ../usr/bin/systemctl %{buildroot}/sbin/reboot ln -s ../usr/bin/systemctl %{buildroot}/sbin/halt ln -s ../usr/bin/systemctl %{buildroot}/sbin/shutdown ln -s ../usr/bin/systemctl %{buildroot}/sbin/poweroff +# Legacy sysvinit tools %if %{with sysvcompat} ln -s ../usr/bin/systemctl %{buildroot}/sbin/telinit ln -s ../usr/bin/systemctl %{buildroot}/sbin/runlevel @@ -1242,36 +1256,10 @@ fi %license LICENSE.LGPL2.1 %include %{SOURCE204} -%files sysvinit +%if %{with sysvcompat} +%files sysvcompat %defattr(-,root,root,-) -%if %{with split_usr} -/sbin/halt -/sbin/init -/sbin/poweroff -/sbin/reboot -/sbin/shutdown -%if %{with sysvcompat} -/sbin/telinit -/sbin/runlevel -%endif -%endif -%{_sbindir}/halt -%{_sbindir}/init -%{_sbindir}/poweroff -%{_sbindir}/reboot -%{_sbindir}/shutdown -%if %{with sysvcompat} -%{_sbindir}/runlevel -%{_sbindir}/telinit -%endif -%if ! 0%{?bootstrap} -%{_mandir}/man1/init.1.gz -%{_mandir}/man8/halt.8.gz -%{_mandir}/man8/poweroff.8.gz -%{_mandir}/man8/reboot.8.gz -%{_mandir}/man8/runlevel.8.gz -%{_mandir}/man8/shutdown.8.gz -%{_mandir}/man8/telinit.8.gz +%include %{SOURCE205} %endif %files -n libsystemd0%{?mini} From 44a5722e349dab133937c8feff437eb1083066df7b6304d443ef1da10b149457 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Mon, 14 Feb 2022 15:52:52 +0000 Subject: [PATCH 4/5] - spec: fix dependencies for mini variants Make sure that all mini variants won't be installed in real systems and won't be involved when building medias with kiwi. Note that sub-packages that requires systemd (such as udev) don't need any special treatment since the specific deps are inherited from the main (mini) package. - spec: simplify systemd-mini-doc dependencies by assuming that the doc sub-package can't be a build requirement for other packages. - spec: libsystemd-mini and libudev-mini need to provide libsystemd and libudev respectively OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1251 --- systemd.changes | 16 ++++++++++++++++ systemd.spec | 35 +++++++++++++++++++++-------------- 2 files changed, 37 insertions(+), 14 deletions(-) diff --git a/systemd.changes b/systemd.changes index de632c3..5a4bf44 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +Mon Feb 14 15:11:04 UTC 2022 - Franck Bui + +- spec: fix dependencies for mini variants + + Make sure that all mini variants won't be installed in real systems and won't + be involved when building medias with kiwi. Note that sub-packages that + requires systemd (such as udev) don't need any special treatment since the + specific deps are inherited from the main (mini) package. + +- spec: simplify systemd-mini-doc dependencies by assuming that the doc + sub-package can't be a build requirement for other packages. + +- spec: libsystemd-mini and libudev-mini need to provide libsystemd and libudev + respectively + ------------------------------------------------------------------- Mon Feb 14 07:39:12 UTC 2022 - Franck Bui diff --git a/systemd.spec b/systemd.spec index 5fe9b17..af74fda 100644 --- a/systemd.spec +++ b/systemd.spec @@ -16,11 +16,6 @@ # -# -# The git repository used to track all SUSE specific changes can be -# found at: https://github.com/openSUSE/systemd. -# - %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "mini" @@ -138,10 +133,15 @@ BuildRequires: gnu-efi %if 0%{?bootstrap} #!BuildIgnore: dbus-1 -Requires: this-is-only-for-build-envs Provides: systemd = %{version}-%{release} -Conflicts: kiwi Conflicts: systemd +# Don't consider the mini flavors when building kiwi medias. This conflict is +# automatically inherited by sub-packages requiring systemd (such as udev). +Conflicts: kiwi +# This dependency is used to ensure that the mini flavors are selected only +# inside OBS builds (where this dependency is ignored) and don't get installed +# on real systems. +Requires: this-is-only-for-build-envs %else # the buildignore is important for bootstrapping #!BuildIgnore: udev @@ -202,10 +202,15 @@ Source203: files.network Source204: files.devel Source205: files.sysvcompat +# +# All changes backported from upstream are tracked by the git repository, which +# can be found at: https://github.com/openSUSE/systemd. +# # Patches listed below are openSUSE specific and should be kept at its # minimum. We try hard to push our changes to upstream but sometimes they are # only relevant for SUSE distros. Special rewards for those who will manage to # get rid of one of them ! +# Patch1: 0001-restore-var-run-and-var-lock-bind-mount-if-they-aren.patch Patch2: 0002-rc-local-fix-ordering-startup-for-etc-init.d-boot.lo.patch Patch3: 0003-strip-the-domain-part-from-etc-hostname-when-setting.patch @@ -236,10 +241,11 @@ drop-in replacement for sysvinit. %package doc Summary: HTML documentation for systemd License: LGPL-2.1-or-later -Supplements: (systemd and patterns-base-documentation) %if 0%{?bootstrap} -Provides: systemd-doc = %{version}-%{release} Conflicts: systemd-doc +Requires: this-is-only-for-build-envs +%else +Supplements: (systemd and patterns-base-documentation) %endif %description doc @@ -287,7 +293,9 @@ Please note that the content of this package is considered as deprecated. Summary: Component library for systemd License: LGPL-2.1-or-later %if 0%{?bootstrap} +Conflicts: kiwi Conflicts: libsystemd0 +Provides: libsystemd0 = %{version}-%{release} Requires: this-is-only-for-build-envs %endif @@ -325,17 +333,14 @@ Requires: group(kvm) Requires(post): sed Requires(post): coreutils Requires(postun):coreutils - Conflicts: ConsoleKit < 0.4.1 Conflicts: dracut < 044.1 Conflicts: filesystem < 11.5 Conflicts: mkinitrd < 2.7.0 Conflicts: util-linux < 2.16 %if 0%{?bootstrap} -Provides: udev = %{version}-%{release} Conflicts: udev -# avoid kiwi picking it for bootstrap -Requires: this-is-only-for-build-envs +Provides: udev = %{version}-%{release} %endif %description -n udev%{?mini} @@ -351,7 +356,7 @@ License: LGPL-2.1-or-later %if 0%{?bootstrap} Conflicts: kiwi Conflicts: libudev1 -# avoid kiwi picking it for bootstrap +Provides: libudev1 = %{version}-%{release} Requires: this-is-only-for-build-envs %endif @@ -383,8 +388,10 @@ Provides: nss-mymachines = %{version}-%{release} Provides: systemd-container = %{version}-%{release} Provides: systemd:%{_bindir}/systemd-nspawn %if 0%{?bootstrap} +Conflicts: kiwi Conflicts: systemd-container Provides: systemd-container = %{version}-%{release} +Requires: this-is-only-for-build-envs %endif %description container From 99ae0cf3ab3b9fdc08301ad514a8ed588ba50673e23d7ba0357133567c349297 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Fri, 18 Feb 2022 08:11:02 +0000 Subject: [PATCH 5/5] - Drop enablement symlink migration support of SysV init scripts And let's finish reducing the support of SysV init scripts to its minimum. OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1252 --- files.sysvcompat | 51 ------------------ systemd-sysv-convert | 120 ------------------------------------------- systemd.changes | 7 +++ systemd.spec | 5 -- 4 files changed, 7 insertions(+), 176 deletions(-) delete mode 100644 systemd-sysv-convert diff --git a/files.sysvcompat b/files.sysvcompat index 3a62dc7..49e50a8 100644 --- a/files.sysvcompat +++ b/files.sysvcompat @@ -1,8 +1,6 @@ # # Please keep the list sorted (with `LC_ALL=C sort`). # -%dir %{_localstatedir}/lib/systemd/migrated -%dir %{_localstatedir}/lib/systemd/sysv-convert %dir %{_unitdir}/runlevel1.target.wants %dir %{_unitdir}/runlevel2.target.wants %dir %{_unitdir}/runlevel3.target.wants @@ -19,55 +17,6 @@ %{_sbindir}/runlevel %{_sbindir}/telinit %{_systemd_util_dir}/systemd-initctl -%{_systemd_util_dir}/systemd-sysv-convert -%{_systemd_util_dir}/systemd-sysv-install -%{_systemdgeneratordir}/systemd-rc-local-generator -%{_systemdgeneratordir}/systemd-sysv-generator -%{_unitdir}/graphical.target.wants/systemd-update-utmp-runlevel.service -%{_unitdir}/local-fs.target.wants/var-lock.mount -%{_unitdir}/local-fs.target.wants/var-run.mount -%{_unitdir}/multi-user.target.wants/systemd-update-utmp-runlevel.service -%{_unitdir}/rc-local.service -%{_unitdir}/rescue.target.wants/systemd-update-utmp-runlevel.service -%{_unitdir}/runlevel0.target -%{_unitdir}/runlevel1.target -%{_unitdir}/runlevel2.target -%{_unitdir}/runlevel3.target -%{_unitdir}/runlevel4.target -%{_unitdir}/runlevel5.target -%{_unitdir}/runlevel6.target -%{_unitdir}/sockets.target.wants/systemd-initctl.socket -%{_unitdir}/systemd-initctl.service -%{_unitdir}/systemd-initctl.socket -%{_unitdir}/systemd-update-utmp-runlevel.service -%{_unitdir}/var-lock.mount -%{_unitdir}/var-run.mount -%if %{with split_usr} -/sbin/runlevel -/sbin/telinit -%endif -# -# Please keep the list sorted (with `LC_ALL=C sort`). -# -%dir %{_localstatedir}/lib/systemd/migrated -%dir %{_localstatedir}/lib/systemd/sysv-convert -%dir %{_unitdir}/runlevel1.target.wants -%dir %{_unitdir}/runlevel2.target.wants -%dir %{_unitdir}/runlevel3.target.wants -%dir %{_unitdir}/runlevel4.target.wants -%dir %{_unitdir}/runlevel5.target.wants -%{_mandir}/man8/runlevel.8.gz -%{_mandir}/man8/systemd-initctl.8.gz -%{_mandir}/man8/systemd-initctl.service.8.gz -%{_mandir}/man8/systemd-initctl.socket.8.gz -%{_mandir}/man8/systemd-rc-local-generator.8.gz -%{_mandir}/man8/systemd-sysv-generator.8.gz -%{_mandir}/man8/systemd-update-utmp-runlevel.service.8.gz -%{_mandir}/man8/telinit.8.gz -%{_sbindir}/runlevel -%{_sbindir}/telinit -%{_systemd_util_dir}/systemd-initctl -%{_systemd_util_dir}/systemd-sysv-convert %{_systemd_util_dir}/systemd-sysv-install %{_systemdgeneratordir}/systemd-rc-local-generator %{_systemdgeneratordir}/systemd-sysv-generator diff --git a/systemd-sysv-convert b/systemd-sysv-convert deleted file mode 100644 index f441770..0000000 --- a/systemd-sysv-convert +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/bash - -info() { - echo "$(basename $0): $*" -} - -warn() { - echo >&2 "$(basename $0): warning, $*" -} - -usage() { - echo >&2 "usage: $(basename $0) --apply [ ...]" -} - -if [ "$UID" != "0" ]; then - warn "need to be root, aborting" - exit 1 -fi - -if [ $# -lt 2 ]; then - usage - exit 1 -fi - -database_lookup() { - local service unused - - # 'priority' field is not used but is kept for backward compat reason. - while read service unused; do - if [ $service == $1 ]; then - return 0 - fi - done >/var/lib/systemd/sysv-convert/database -} - -# Initialize the database. -if [ ! -e /var/lib/systemd/sysv-convert/database ]; then - touch /var/lib/systemd/sysv-convert/database -fi - -case "$1" in ---save) - # --save is kept for backward compatibility. - ;; ---apply) - shift - for service in $@; do - # For backward compat we accept the name of the - # service with or without the unit type suffix. If the - # suffix is not there, assume .service type. - case "$service" in - *.*) initscript="${service%.*}" ;; - *) initscript="$service" - service="$service.service" - esac - - # Did we already migrate this service during a previous update ? - database_lookup $initscript && - continue - - # Sanity check. - unit="/usr/lib/systemd/system/$service" - if [ ! -f "$unit" ]; then - warn "$unit not found, skipping" - continue - fi - - # Mark the service as processed to make sure we will do the migration only - # once. This is important especially for packages that keep their init - # scripts around even if they're no more used. Since the saved info won't - # be reused again we simply use an invalid runlevel and add the service - # in the db only once. - database_add $initscript -1 - - # Some services were renamed during the transition from SySV init to - # systemd (bsc#1181788). Rather than letting packages fixing that - # themselves by hacking our database directly, let's hard-code renames - # here. Not really nice but that's the least worst solution. - case $initscript in - ntpd) initscript=ntp ;; - esac - - # The package is introducing new services and never has any sysv init - # scripts (bsc#982303). - if [ ! -r /etc/init.d/$initscript ] && - [ ! -r /etc/init.d/boot.$initscript ]; then - continue - fi - - for rcnd in rc2.d rc3.d rc4.d rc5.d boot.d; do - # Was the sysvinit script enabled ? (bsc#982211) - case $rcnd in - boot.d) [ -L /etc/rc.d/boot.d/S??boot.$initscript ] || continue ;; - *) [ -L /etc/rc.d/$rcnd/S??$initscript ] || continue - esac - - case $rcnd in - boot.d) runlevel=3 ;; - *) runlevel=${rcnd:2:1} - esac - - target=runlevel$runlevel.target - info "enabling $unit (wanted by $target)..." - - mkdir -p "/etc/systemd/system/$target.wants" - ln -sf $unit /etc/systemd/system/$target.wants/$service - done - done - ;; -*) - usage - exit 1 -esac diff --git a/systemd.changes b/systemd.changes index 5a4bf44..5f1181f 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Feb 17 18:30:12 UTC 2022 - Franck Bui + +- Drop enablement symlink migration support of SysV init scripts + + And let's finish reducing the support of SysV init scripts to its minimum. + ------------------------------------------------------------------- Mon Feb 14 15:11:04 UTC 2022 - Franck Bui diff --git a/systemd.spec b/systemd.spec index af74fda..559de80 100644 --- a/systemd.spec +++ b/systemd.spec @@ -183,7 +183,6 @@ Source0: systemd-v%{version}%{suse_version}.tar.xz Source1: systemd-rpmlintrc Source2: systemd-user %if %{with sysvcompat} -Source3: systemd-sysv-convert Source4: systemd-sysv-install %endif Source5: tmpfiles-suse.conf @@ -720,10 +719,6 @@ rm %{buildroot}%{_mandir}/man1/resolvconf.1* %endif %if %{with sysvcompat} -mkdir -p %{buildroot}%{_localstatedir}/lib/systemd/sysv-convert -mkdir -p %{buildroot}%{_localstatedir}/lib/systemd/migrated - -install -m0755 -D %{SOURCE3} %{buildroot}/%{_systemd_util_dir}/systemd-sysv-convert install -m0755 -D %{SOURCE4} %{buildroot}/%{_systemd_util_dir}/systemd-sysv-install %endif