From e917284dffdf40bf8f19214eb8147685a7c06600b06ff4951d396a94bb1df836 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Mon, 23 Jan 2023 10:49:38 +0000 Subject: [PATCH 1/2] - Make sure we apply the presets on units shipped by systemd package OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1340 --- systemd.changes | 5 +++ systemd.spec | 103 ++++++++++++++++++++++++++---------------------- 2 files changed, 61 insertions(+), 47 deletions(-) diff --git a/systemd.changes b/systemd.changes index cd0000d2..e1d45cbf 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Jan 23 10:48:30 UTC 2023 - Franck Bui + +- Make sure we apply the presets on units shipped by systemd package + ------------------------------------------------------------------- Fri Jan 6 10:10:37 UTC 2023 - Franck Bui diff --git a/systemd.spec b/systemd.spec index 71f0d042..c95d969b 100644 --- a/systemd.spec +++ b/systemd.spec @@ -959,11 +959,16 @@ find %{buildroot}%{_testsuitedir}/ -name .git\* -exec rm -fr {} \; %find_lang systemd %endif -# Build of installation images uses a hard coded list of packages with a %%pre -# that needs to be run during the build. systemd is one of them so keep the -# section even if it's empty. +# Don't drop %%pre section even if it becomes empty: the build process of +# installation images uses a hardcoded list of packages with a %%pre that needs +# to be run during the build and complains if it can't find one. %pre -: +# Units listed below can be enabled at installation according to their preset +# setting. +%systemd_pre machines.target +%systemd_pre remote-fs.target +%systemd_pre getty@.service +%systemd_pre systemd-timesyncd.service %post # Make /etc/machine-id an empty file during package installation. On the first @@ -1018,11 +1023,11 @@ fi %journal_catalog_update %tmpfiles_create -# Create default config in /etc at first install. -# Later package updates should not overwrite these settings. -%systemd_post getty@.service +# Units listed below can be enabled at installation accoding to their preset +# setting. %systemd_post machines.target %systemd_post remote-fs.target +%systemd_post getty@.service %systemd_post systemd-timesyncd.service # v228 wrongly set world writable suid root permissions on timestamp files used @@ -1069,6 +1074,8 @@ fi # Avoid restarting logind until fixed upstream (issue #1163) %pre -n udev%{?mini} +# Units listed below can be enabled at installation accoding to their preset +# setting. %systemd_pre remote-cryptsetup.target %systemd_pre systemd-pstore.service @@ -1086,6 +1093,8 @@ fi %tmpfiles_create systemd-pstore.conf +# Units listed below can be enabled at installation accoding to their preset +# setting. %systemd_post remote-cryptsetup.target %systemd_post systemd-pstore.service @@ -1162,107 +1171,107 @@ fi %if %{with journal_remote} %pre journal-remote -%service_add_pre systemd-journal-gatewayd.socket systemd-journal-gatewayd.service -%service_add_pre systemd-journal-remote.socket systemd-journal-remote.service -%service_add_pre systemd-journal-upload.service +%systemd_pre systemd-journal-gatewayd.socket systemd-journal-gatewayd.service +%systemd_pre systemd-journal-remote.socket systemd-journal-remote.service +%systemd_pre systemd-journal-upload.service %post journal-remote # Assume that all files shipped by systemd-journal-remove are owned by root. %sysusers_create systemd-remote.conf -%service_add_post systemd-journal-gatewayd.socket systemd-journal-gatewayd.service -%service_add_post systemd-journal-remote.socket systemd-journal-remote.service -%service_add_post systemd-journal-upload.service +%systemd_post systemd-journal-gatewayd.socket systemd-journal-gatewayd.service +%systemd_post systemd-journal-remote.socket systemd-journal-remote.service +%systemd_post systemd-journal-upload.service %preun journal-remote -%service_del_preun systemd-journal-gatewayd.socket systemd-journal-gatewayd.service -%service_del_preun systemd-journal-remote.socket systemd-journal-remote.service -%service_del_preun systemd-journal-upload.service +%systemd_preun systemd-journal-gatewayd.socket systemd-journal-gatewayd.service +%systemd_preun systemd-journal-remote.socket systemd-journal-remote.service +%systemd_preun systemd-journal-upload.service %postun journal-remote -%service_del_postun systemd-journal-gatewayd.socket systemd-journal-gatewayd.service -%service_del_postun systemd-journal-remote.socket systemd-journal-remote.service -%service_del_postun systemd-journal-upload.service +%systemd_postun systemd-journal-gatewayd.socket systemd-journal-gatewayd.service +%systemd_postun systemd-journal-remote.socket systemd-journal-remote.service +%systemd_postun systemd-journal-upload.service %endif %if %{with networkd} || %{with resolved} %pre network %if %{with networkd} -%service_add_pre systemd-networkd.service -%service_add_pre systemd-networkd-wait-online.service +%systemd_pre systemd-networkd.service +%systemd_pre systemd-networkd-wait-online.service %endif %if %{with resolved} -%service_add_pre systemd-resolved.service +%systemd_pre systemd-resolved.service %endif %post network %if %{with networkd} %sysusers_create systemd-network.conf %tmpfiles_create systemd-network.conf -%service_add_post systemd-networkd.service -%service_add_post systemd-networkd-wait-online.service +%systemd_post systemd-networkd.service +%systemd_post systemd-networkd-wait-online.service %endif %if %{with resolved} %ldconfig %sysusers_create systemd-resolve.conf -%service_add_post systemd-resolved.service +%systemd_post systemd-resolved.service %endif %preun network %if %{with networkd} -%service_del_preun systemd-networkd.service -%service_del_preun systemd-networkd-wait-online.service +%systemd_preun systemd-networkd.service +%systemd_preun systemd-networkd-wait-online.service %endif %if %{with resolved} -%service_del_preun systemd-resolved.service +%systemd_preun systemd-resolved.service %endif %postun network %if %{with networkd} -%service_del_postun systemd-networkd.service -%service_del_postun systemd-networkd-wait-online.service +%systemd_postun systemd-networkd.service +%systemd_postun systemd-networkd-wait-online.service %endif %if %{with resolved} %ldconfig -%service_del_postun systemd-resolved.service +%systemd_postun systemd-resolved.service %endif %endif %if %{with portabled} %pre portable -%service_add_pre systemd-portabled.service +%systemd_pre systemd-portabled.service %post portable %tmpfiles_create portables.conf -%service_add_post systemd-portabled.service +%systemd_post systemd-portabled.service %preun portable -%service_del_preun systemd-portabled.service +%systemd_preun systemd-portabled.service %postun portable -%service_del_postun systemd-portabled.service +%systemd_postun systemd-portabled.service %endif %if %{with experimental} %pre experimental -%service_add_pre systemd-homed.service -%service_add_pre systemd-oomd.service systemd-oomd.socket -%service_add_pre systemd-userdbd.service systemd-userdbd.socket +%systemd_pre systemd-homed.service +%systemd_pre systemd-oomd.service systemd-oomd.socket +%systemd_pre systemd-userdbd.service systemd-userdbd.socket %post experimental %sysusers_create systemd-oom.conf -%service_add_post systemd-homed.service -%service_add_post systemd-oomd.service systemd-oomd.socket -%service_add_post systemd-userdbd.service systemd-userdbd.socket +%systemd_post systemd-homed.service +%systemd_post systemd-oomd.service systemd-oomd.socket +%systemd_post systemd-userdbd.service systemd-userdbd.socket %preun experimental -%service_del_preun systemd-homed.service -%service_del_preun systemd-oomd.service systemd-oomd.socket -%service_del_preun systemd-userdbd.service systemd-userdbd.socket +%systemd_preun systemd-homed.service +%systemd_preun systemd-oomd.service systemd-oomd.socket +%systemd_preun systemd-userdbd.service systemd-userdbd.socket %postun experimental -%service_del_postun systemd-homed.service -%service_del_postun systemd-oomd.service systemd-oomd.socket -%service_del_postun systemd-userdbd.service systemd-userdbd.socket +%systemd_postun systemd-homed.service +%systemd_postun systemd-oomd.service systemd-oomd.socket +%systemd_postun systemd-userdbd.service systemd-userdbd.socket %endif %files From b595a7728456fca0a43942bea849dc6335d995cb58e1fc9cef0fc2450f37295e Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Tue, 24 Jan 2023 13:21:01 +0000 Subject: [PATCH 2/2] - Drop 1000-Revert-getty-Pass-tty-to-use-by-agetty-via-stdin.patch It's no more necessary since util-linux 2.38 has been released in Factory. OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1341 --- ...-Pass-tty-to-use-by-agetty-via-stdin.patch | 90 ------------------- systemd.changes | 7 ++ systemd.spec | 3 - 3 files changed, 7 insertions(+), 93 deletions(-) delete mode 100644 1000-Revert-getty-Pass-tty-to-use-by-agetty-via-stdin.patch diff --git a/1000-Revert-getty-Pass-tty-to-use-by-agetty-via-stdin.patch b/1000-Revert-getty-Pass-tty-to-use-by-agetty-via-stdin.patch deleted file mode 100644 index 9100a4e9..00000000 --- a/1000-Revert-getty-Pass-tty-to-use-by-agetty-via-stdin.patch +++ /dev/null @@ -1,90 +0,0 @@ -From 9e41b33e4e0d0fcc1dba654b485d6f5238e71ea8 Mon Sep 17 00:00:00 2001 -From: Franck Bui -Date: Thu, 17 Mar 2022 11:35:33 +0100 -Subject: [PATCH 8/8] Revert "getty: Pass tty to use by agetty via stdin" - -This reverts commit b4bf9007cbee7dc0b1356897344ae2a7890df84c. ---- - units/console-getty.service.in | 4 +--- - units/container-getty@.service.in | 4 +--- - units/getty@.service.in | 4 +--- - units/serial-getty@.service.in | 4 +--- - 4 files changed, 4 insertions(+), 12 deletions(-) - -diff --git a/units/console-getty.service.in b/units/console-getty.service.in -index 606b7dbe16..54fd7c292d 100644 ---- a/units/console-getty.service.in -+++ b/units/console-getty.service.in -@@ -22,12 +22,10 @@ ConditionPathExists=/dev/console - [Service] - # The '-o' option value tells agetty to replace 'login' arguments with an option to preserve environment (-p), - # followed by '--' for safety, and then the entered username. --ExecStart=-/sbin/agetty -o '-p -- \\u' --noclear --keep-baud - 115200,38400,9600 $TERM -+ExecStart=-/sbin/agetty -o '-p -- \\u' --noclear --keep-baud console 115200,38400,9600 $TERM - Type=idle - Restart=always - UtmpIdentifier=cons --StandardInput=tty --StandardOutput=tty - TTYPath=/dev/console - TTYReset=yes - TTYVHangup=yes -diff --git a/units/container-getty@.service.in b/units/container-getty@.service.in -index 8d7e20d5ec..5dc75f769e 100644 ---- a/units/container-getty@.service.in -+++ b/units/container-getty@.service.in -@@ -27,13 +27,11 @@ Before=rescue.service - [Service] - # The '-o' option value tells agetty to replace 'login' arguments with an option to preserve environment (-p), - # followed by '--' for safety, and then the entered username. --ExecStart=-/sbin/agetty -o '-p -- \\u' --noclear - $TERM -+ExecStart=-/sbin/agetty -o '-p -- \\u' --noclear pts/%I $TERM - Type=idle - Restart=always - RestartSec=0 - UtmpIdentifier=pts/%I --StandardInput=tty --StandardOutput=tty - TTYPath=/dev/pts/%I - TTYReset=yes - TTYVHangup=yes -diff --git a/units/getty@.service.in b/units/getty@.service.in -index 21d66f9367..78deb7cffe 100644 ---- a/units/getty@.service.in -+++ b/units/getty@.service.in -@@ -38,13 +38,11 @@ ConditionPathExists=/dev/tty0 - # The '-o' option value tells agetty to replace 'login' arguments with an - # option to preserve environment (-p), followed by '--' for safety, and then - # the entered username. --ExecStart=-/sbin/agetty -o '-p -- \\u' --noclear - $TERM -+ExecStart=-/sbin/agetty -o '-p -- \\u' --noclear %I $TERM - Type=idle - Restart=always - RestartSec=0 - UtmpIdentifier=%I --StandardInput=tty --StandardOutput=tty - TTYPath=/dev/%I - TTYReset=yes - TTYVHangup=yes -diff --git a/units/serial-getty@.service.in b/units/serial-getty@.service.in -index 2433124c55..bb7af3105d 100644 ---- a/units/serial-getty@.service.in -+++ b/units/serial-getty@.service.in -@@ -33,12 +33,10 @@ Before=rescue.service - # The '-o' option value tells agetty to replace 'login' arguments with an - # option to preserve environment (-p), followed by '--' for safety, and then - # the entered username. --ExecStart=-/sbin/agetty -o '-p -- \\u' --keep-baud 115200,57600,38400,9600 - $TERM -+ExecStart=-/sbin/agetty -o '-p -- \\u' --keep-baud 115200,57600,38400,9600 %I $TERM - Type=idle - Restart=always - UtmpIdentifier=%I --StandardInput=tty --StandardOutput=tty - TTYPath=/dev/%I - TTYReset=yes - TTYVHangup=yes --- -2.35.3 - diff --git a/systemd.changes b/systemd.changes index e1d45cbf..7940f4e3 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Jan 24 13:19:01 UTC 2023 - Franck Bui + +- Drop 1000-Revert-getty-Pass-tty-to-use-by-agetty-via-stdin.patch + + It's no more necessary since util-linux 2.38 has been released in Factory. + ------------------------------------------------------------------- Mon Jan 23 10:48:30 UTC 2023 - Franck Bui diff --git a/systemd.spec b/systemd.spec index c95d969b..cdcc6532 100644 --- a/systemd.spec +++ b/systemd.spec @@ -208,9 +208,6 @@ Patch8: 0008-sysv-generator-translate-Required-Start-into-a-Wants.patch Patch10: 0001-conf-parser-introduce-early-drop-ins.patch Patch12: 0009-pid1-handle-console-specificities-weirdness-for-s390.patch -# Temporary workaround until bsc#1197178 is addressed. -Patch1000: 1000-Revert-getty-Pass-tty-to-use-by-agetty-via-stdin.patch - # Patches listed below are put in quarantine. Normally all changes must go to # upstream first and then are cherry-picked in the SUSE git repository. But for # very few cases, some stuff might be broken in upstream and need to be fixed