From f3a1dd8bfadbc84a71c0a5dc3731719cf2fe81c75b44e18237141850196cc5ed Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Wed, 3 May 2023 06:34:19 +0000 Subject: [PATCH 1/7] - Import commit 3ce9610975b5239a21c0c886cb893bb172966de7 3ce9610975 test: dont use anchor char '$' to match a part of a string 03ede3eaa2 locale: when no xvariant match select the entry with an empty xvariant f08017efd5 locale: convert generated vconsole keymap to x11 layout automatically e8cf56459b localed-util: make use of strdupcspn() 821c684440 test: use kbd-mode-map we ship in TEST-73-LOCALE - Mapping for converted keymaps is not needed anymore since their conversion to their x11 layout counterpart is now done automatically by localed (commit f08017efd5). OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1382 --- systemd-v253.3+suse.22.g66f3a8a47d.tar.xz | 3 --- systemd-v253.3+suse.27.g3ce9610975.tar.xz | 3 +++ systemd.changes | 15 +++++++++++++++ systemd.spec | 16 +--------------- 4 files changed, 19 insertions(+), 18 deletions(-) delete mode 100644 systemd-v253.3+suse.22.g66f3a8a47d.tar.xz create mode 100644 systemd-v253.3+suse.27.g3ce9610975.tar.xz diff --git a/systemd-v253.3+suse.22.g66f3a8a47d.tar.xz b/systemd-v253.3+suse.22.g66f3a8a47d.tar.xz deleted file mode 100644 index 27f4e3fe..00000000 --- a/systemd-v253.3+suse.22.g66f3a8a47d.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c5e09e6e9eb4c0b383578dad276f56c174eacd2d7752e0f545db6d2480d627d0 -size 8205724 diff --git a/systemd-v253.3+suse.27.g3ce9610975.tar.xz b/systemd-v253.3+suse.27.g3ce9610975.tar.xz new file mode 100644 index 00000000..8a7621d8 --- /dev/null +++ b/systemd-v253.3+suse.27.g3ce9610975.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c3f34496d7ed206b908455ec3c1a3794e94fe25ade2e06814e416744231446f2 +size 8207228 diff --git a/systemd.changes b/systemd.changes index 16ab984f..eaa530d0 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Wed May 3 06:20:28 UTC 2023 - Franck Bui + +- Import commit 3ce9610975b5239a21c0c886cb893bb172966de7 + + 3ce9610975 test: dont use anchor char '$' to match a part of a string + 03ede3eaa2 locale: when no xvariant match select the entry with an empty xvariant + f08017efd5 locale: convert generated vconsole keymap to x11 layout automatically + e8cf56459b localed-util: make use of strdupcspn() + 821c684440 test: use kbd-mode-map we ship in TEST-73-LOCALE + +- Mapping for converted keymaps is not needed anymore since their conversion to + their x11 layout counterpart is now done automatically by localed (commit + f08017efd5). + ------------------------------------------------------------------- Tue May 2 10:34:43 UTC 2023 - Franck Bui diff --git a/systemd.spec b/systemd.spec index 1b971cd7..9e050f26 100644 --- a/systemd.spec +++ b/systemd.spec @@ -19,7 +19,7 @@ %global flavor @BUILD_FLAVOR@%{nil} %define min_kernel_version 4.5 -%define archive_version +suse.22.g66f3a8a47d +%define archive_version +suse.27.g3ce9610975 %define _testsuitedir /usr/lib/systemd/tests %define xinitconfdir %{?_distconfdir}%{!?_distconfdir:%{_sysconfdir}}/X11/xinit @@ -925,20 +925,6 @@ install -m 644 %{SOURCE5} %{buildroot}%{_tmpfilesdir}/suse.conf # consume those configs (like glibc or pam), see bsc#1170146. rm -fr %{buildroot}%{_datadir}/factory/* -# Add entries for xkeyboard-config converted keymaps; mappings, which -# already exist in original systemd mapping table are being ignored -# though, i.e. not overwritten; needed as long as YaST uses console -# keymaps internally and calls localectl to convert from vconsole to -# X11 keymaps. Ideally YaST should switch to X11 layout names (the -# mapping table wouldn't be needed since each X11 keymap has a -# generated xkbd keymap) and let localectl initialize -# /etc/vconsole.conf and /etc/X11/xorg.conf.d/00-keyboard.conf -# (FATE#319454). -if [ -f /usr/share/systemd/kbd-model-map.xkb-generated ]; then - cat /usr/share/systemd/kbd-model-map.xkb-generated \ - >>%{buildroot}%{_datarootdir}/systemd/kbd-model-map -fi - # kbd-model-map.legacy is used to provide mapping for legacy keymaps, which may # still be used by yast. cat %{SOURCE14} >>%{buildroot}%{_datarootdir}/systemd/kbd-model-map From 3929c646ed80323698b09bb5ded41f9522f9f34025560ab94054ab96b2c27173 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Wed, 3 May 2023 07:31:31 +0000 Subject: [PATCH 2/7] - Import commit 25aec157888f7aa9a36726962fcbbf2c74ead440 (merge of v253.4) For a complete list of changes, visit: https://github.com/openSUSE/systemd/compare/3ce9610975b5239a21c0c886cb893bb172966de7...25aec157888f7aa9a36726962fcbbf2c74ead440 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1383 --- systemd-v253.3+suse.27.g3ce9610975.tar.xz | 3 --- systemd-v253.4+suse.28.g25aec15788.tar.xz | 3 +++ systemd.changes | 8 ++++++++ systemd.spec | 4 ++-- 4 files changed, 13 insertions(+), 5 deletions(-) delete mode 100644 systemd-v253.3+suse.27.g3ce9610975.tar.xz create mode 100644 systemd-v253.4+suse.28.g25aec15788.tar.xz diff --git a/systemd-v253.3+suse.27.g3ce9610975.tar.xz b/systemd-v253.3+suse.27.g3ce9610975.tar.xz deleted file mode 100644 index 8a7621d8..00000000 --- a/systemd-v253.3+suse.27.g3ce9610975.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c3f34496d7ed206b908455ec3c1a3794e94fe25ade2e06814e416744231446f2 -size 8207228 diff --git a/systemd-v253.4+suse.28.g25aec15788.tar.xz b/systemd-v253.4+suse.28.g25aec15788.tar.xz new file mode 100644 index 00000000..6f770326 --- /dev/null +++ b/systemd-v253.4+suse.28.g25aec15788.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b619c2dbcc175b630519a1e84553f744ae003b49b031c83ee4cdbfd9226701fe +size 8216304 diff --git a/systemd.changes b/systemd.changes index eaa530d0..c6a652fa 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed May 3 06:34:54 UTC 2023 - Franck Bui + +- Import commit 25aec157888f7aa9a36726962fcbbf2c74ead440 (merge of v253.4) + + For a complete list of changes, visit: + https://github.com/openSUSE/systemd/compare/3ce9610975b5239a21c0c886cb893bb172966de7...25aec157888f7aa9a36726962fcbbf2c74ead440 + ------------------------------------------------------------------- Wed May 3 06:20:28 UTC 2023 - Franck Bui diff --git a/systemd.spec b/systemd.spec index 9e050f26..363cfb97 100644 --- a/systemd.spec +++ b/systemd.spec @@ -19,7 +19,7 @@ %global flavor @BUILD_FLAVOR@%{nil} %define min_kernel_version 4.5 -%define archive_version +suse.27.g3ce9610975 +%define archive_version +suse.28.g25aec15788 %define _testsuitedir /usr/lib/systemd/tests %define xinitconfdir %{?_distconfdir}%{!?_distconfdir:%{_sysconfdir}}/X11/xinit @@ -73,7 +73,7 @@ Name: systemd%{?mini} URL: http://www.freedesktop.org/wiki/Software/systemd -Version: 253.3 +Version: 253.4 Release: 0 Summary: A System and Session Manager License: LGPL-2.1-or-later From d6badd1a2e74334da4677f8111dcd97c610140f7118a9f3e5f7bff3f06d486cf Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Thu, 4 May 2023 09:05:47 +0000 Subject: [PATCH 3/7] - kbd-model-map.legacy: drop entry for 'ruwin_alt-UTF-8' as yast doesn't rely on it anymore, see https://github.com/yast/yast-country/pull/307 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1384 --- kbd-model-map.legacy | 6 ------ systemd.changes | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kbd-model-map.legacy b/kbd-model-map.legacy index a3b6d9d7..69326298 100644 --- a/kbd-model-map.legacy +++ b/kbd-model-map.legacy @@ -5,9 +5,3 @@ arabic ara,us pc105 - terminate:ctrl_alt_bksp,grp:shift_toggle ara ara,us pc105 - terminate:ctrl_alt_bksp,grp:shift_toggle ir ir pc105 - terminate:ctrl_alt_bksp - -# FIXME: ruwin_alt-UTF-8 is not needed as the legacy "ru" keymap -# (/usr/share/kbd/keymaps/i386/qwerty/ru.map.gz) is a dual layout and contains -# the Latin letters. Keep it until YaST is updated. - -ruwin_alt-UTF-8 us,ru pc105 ,winkeys terminate:ctrl_alt_bksp,grp:ctrl_shift_toggle,grp_led:scroll diff --git a/systemd.changes b/systemd.changes index c6a652fa..bc46bcfe 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu May 4 08:40:15 UTC 2023 - Franck Bui + +- kbd-model-map.legacy: drop entry for 'ruwin_alt-UTF-8' as yast doesn't rely on + it anymore, see https://github.com/yast/yast-country/pull/307 + ------------------------------------------------------------------- Wed May 3 06:34:54 UTC 2023 - Franck Bui From 932bbabfac075f79f03a9890863489a10144f90579bdeca4d2e1c0101b803a69 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Thu, 4 May 2023 10:06:44 +0000 Subject: [PATCH 4/7] - Make use of %_systemd_util_dir in the spec file. - Rename the SUSE specific scripts used to fix up the system where systemd is installed on. Also rename the directory where these scripts are stored. OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1385 --- files.container | 2 +- files.systemd | 6 +-- ... fixlet-container-machines-btrfs-subvol.sh | 0 ...18n.sh => fixlet-migrate-sysconfig-i18n.sh | 0 ...-210.sh => fixlet-upgrade-from-sysvinit.sh | 0 systemd.changes | 8 ++++ systemd.spec | 43 +++++++++---------- 7 files changed, 33 insertions(+), 26 deletions(-) rename scripts-systemd-fix-machines-btrfs-subvol.sh => fixlet-container-machines-btrfs-subvol.sh (100%) rename scripts-systemd-migrate-sysconfig-i18n.sh => fixlet-migrate-sysconfig-i18n.sh (100%) rename scripts-systemd-upgrade-from-pre-210.sh => fixlet-upgrade-from-sysvinit.sh (100%) diff --git a/files.container b/files.container index 181cd26c..a5445635 100644 --- a/files.container +++ b/files.container @@ -30,7 +30,7 @@ %{_mandir}/man5/org.freedesktop.machine1.5.gz %{_mandir}/man8/systemd-machined.8.gz %{_mandir}/man8/systemd-machined.service.8.gz -%{_systemd_util_dir}/scripts/fix-machines-btrfs-subvol.sh +%{_systemd_util_dir}/rpm/fixlet-container-machines-btrfs-subvol.sh %{_systemd_util_dir}/systemd-machined %{_tmpfilesdir}/systemd-nspawn.conf %{_unitdir}/dbus-org.freedesktop.machine1.service diff --git a/files.systemd b/files.systemd index e2be4037..95f44378 100644 --- a/files.systemd +++ b/files.systemd @@ -44,7 +44,7 @@ %dir %{_systemd_user_env_generator_dir} %dir %{_systemd_util_dir} %dir %{_systemd_util_dir}/ntp-units.d -%dir %{_systemd_util_dir}/scripts +%dir %{_systemd_util_dir}/rpm %dir %{_systemd_util_dir}/system-preset %dir %{_systemd_util_dir}/system-shutdown %dir %{_systemd_util_dir}/system-sleep @@ -440,8 +440,8 @@ %{_sysctldir}/99-sysctl.conf %{_systemd_user_env_generator_dir}/30-systemd-environment-d-generator %{_systemd_util_dir}/ntp-units.d/80-systemd-timesync.list -%{_systemd_util_dir}/scripts/migrate-sysconfig-i18n.sh -%{_systemd_util_dir}/scripts/upgrade-from-pre-210.sh +%{_systemd_util_dir}/rpm/fixlet-migrate-sysconfig-i18n.sh +%{_systemd_util_dir}/rpm/fixlet-upgrade-from-sysvinit.sh %{_systemd_util_dir}/system-preset/99-default.preset %{_systemd_util_dir}/systemd %{_systemd_util_dir}/systemd-binfmt diff --git a/scripts-systemd-fix-machines-btrfs-subvol.sh b/fixlet-container-machines-btrfs-subvol.sh similarity index 100% rename from scripts-systemd-fix-machines-btrfs-subvol.sh rename to fixlet-container-machines-btrfs-subvol.sh diff --git a/scripts-systemd-migrate-sysconfig-i18n.sh b/fixlet-migrate-sysconfig-i18n.sh similarity index 100% rename from scripts-systemd-migrate-sysconfig-i18n.sh rename to fixlet-migrate-sysconfig-i18n.sh diff --git a/scripts-systemd-upgrade-from-pre-210.sh b/fixlet-upgrade-from-sysvinit.sh similarity index 100% rename from scripts-systemd-upgrade-from-pre-210.sh rename to fixlet-upgrade-from-sysvinit.sh diff --git a/systemd.changes b/systemd.changes index bc46bcfe..70f67463 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu May 4 09:32:44 UTC 2023 - Franck Bui + +- Make use of %_systemd_util_dir in the spec file. + +- Rename the SUSE specific scripts used to fix up the system where systemd is + installed on. Also rename the directory where these scripts are stored. + ------------------------------------------------------------------- Thu May 4 08:40:15 UTC 2023 - Franck Bui diff --git a/systemd.spec b/systemd.spec index 363cfb97..0e843727 100644 --- a/systemd.spec +++ b/systemd.spec @@ -21,7 +21,7 @@ %define min_kernel_version 4.5 %define archive_version +suse.28.g25aec15788 -%define _testsuitedir /usr/lib/systemd/tests +%define _testsuitedir %{_systemd_util_dir}/tests %define xinitconfdir %{?_distconfdir}%{!?_distconfdir:%{_sysconfdir}}/X11/xinit # Similar to %%with but returns true/false. The 'true' value can be redefined @@ -176,9 +176,9 @@ Source6: baselibs.conf Source11: after-local.service Source14: kbd-model-map.legacy -Source100: scripts-systemd-fix-machines-btrfs-subvol.sh -Source101: scripts-systemd-upgrade-from-pre-210.sh -Source102: scripts-systemd-migrate-sysconfig-i18n.sh +Source100: fixlet-container-machines-btrfs-subvol.sh +Source101: fixlet-upgrade-from-sysvinit.sh +Source102: fixlet-migrate-sysconfig-i18n.sh Source200: files.systemd Source201: files.udev @@ -748,7 +748,7 @@ export CFLAGS="%{optflags} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2" %if %{with sd_boot} %ifarch x86_64 -export BRP_PESIGN_FILES="/usr/lib/systemd/boot/efi/systemd-bootx64.efi" +export BRP_PESIGN_FILES="%{_systemd_util_dir}/boot/efi/systemd-bootx64.efi" %endif %endif @@ -766,14 +766,13 @@ install -m0755 -D %{SOURCE4} %{buildroot}/%{_systemd_util_dir}/systemd-sysv-inst mkdir -p % %{buildroot}%{_sysconfdir}/systemd/network mkdir -p % %{buildroot}%{_sysconfdir}/systemd/nspawn -# Package the scripts used to fix all packaging issues. Also drop the -# "scripts-{systemd/udev}" prefix which is used because osc doesn't allow -# directories in the workspace... +# Install the fixlets +mkdir -p %{buildroot}%{_systemd_util_dir}/rpm %if %{with machined} -install -m0755 -D %{SOURCE100} %{buildroot}%{_systemd_util_dir}/scripts/fix-machines-btrfs-subvol.sh +install -m0755 %{SOURCE100} %{buildroot}%{_systemd_util_dir}/rpm/ %endif -install -m0755 -D %{SOURCE101} %{buildroot}%{_systemd_util_dir}/scripts/upgrade-from-pre-210.sh -install -m0755 -D %{SOURCE102} %{buildroot}%{_systemd_util_dir}/scripts/migrate-sysconfig-i18n.sh +install -m0755 %{SOURCE101} %{buildroot}%{_systemd_util_dir}/rpm/ +install -m0755 %{SOURCE102} %{buildroot}%{_systemd_util_dir}/rpm/ %if %{with split_usr} mkdir -p %{buildroot}/{bin,sbin} @@ -849,8 +848,8 @@ mkdir -p %{buildroot}%{_localstatedir}/lib/systemd/catalog mkdir -p %{buildroot}%{_ntpunitsdir} # Make sure the shutdown/sleep drop-in dirs exist. -mkdir -p %{buildroot}%{_prefix}/lib/systemd/system-shutdown/ -mkdir -p %{buildroot}%{_prefix}/lib/systemd/system-sleep/ +mkdir -p %{buildroot}%{_systemd_util_dir}/system-shutdown/ +mkdir -p %{buildroot}%{_systemd_util_dir}/system-sleep/ # Make sure these directories are properly owned. mkdir -p %{buildroot}%{_unitdir}/basic.target.wants @@ -1049,7 +1048,7 @@ if [ -L %{_localstatedir}/lib/systemd/timesync ]; then fi # This includes all hacks needed when upgrading from SysV. -%{_prefix}/lib/systemd/scripts/upgrade-from-pre-210.sh || : +%{_systemd_util_dir}/rpm/fixlet-upgrade-from-sysvinit.sh || : # Migrate old i18n settings previously configured in /etc/sysconfig to the new # locations used by systemd (/etc/locale.conf, /etc/vconsole.conf, ...). Recent @@ -1060,7 +1059,7 @@ fi # is being installed). # # It's run only once. -%{_prefix}/lib/systemd/scripts/migrate-sysconfig-i18n.sh || : +%{_systemd_util_dir}/rpm/fixlet-migrate-sysconfig-i18n.sh || : %postun # daemon-reload is implied by systemd_postun_with_restart @@ -1147,7 +1146,7 @@ if [ $1 -gt 1 ]; then # if needed. See bsc#992573. The installer has been fixed to create it # at installation time. # - # The convertion might only be problematic for openSUSE distros + # The conversion might only be problematic for openSUSE distros # (TW/Factory) where previous versions had already created the subvolume # at the wrong place (via tmpfiles for example) and user started to # populate and use it. In this case we'll let the user fix it manually. @@ -1156,7 +1155,7 @@ if [ $1 -gt 1 ]; then # v210 to v228 when we added this workaround. Note that the subvolume is # still created at the wrong place due to the call to tmpfiles_create # macro previously however it's empty so there shouldn't be any issues. - %{_prefix}/lib/systemd/scripts/fix-machines-btrfs-subvol.sh || : + %{_systemd_util_dir}/rpm/fixlet-container-machines-btrfs-subvol.sh || : fi %preun container @@ -1341,9 +1340,9 @@ fi %{_unitdir}/systemd-journal-gatewayd.* %{_unitdir}/systemd-journal-remote.* %{_unitdir}/systemd-journal-upload.* -%{_prefix}/lib/systemd/systemd-journal-gatewayd -%{_prefix}/lib/systemd/systemd-journal-remote -%{_prefix}/lib/systemd/systemd-journal-upload +%{_systemd_util_dir}/systemd-journal-gatewayd +%{_systemd_util_dir}/systemd-journal-remote +%{_systemd_util_dir}/systemd-journal-upload %{_sysusersdir}/systemd-remote.conf %{_mandir}/man5/journal-remote.conf* %{_mandir}/man5/journal-upload.conf* @@ -1358,8 +1357,8 @@ fi %files portable %defattr(-,root,root) %{_bindir}/portablectl -%{_prefix}/lib/systemd/systemd-portabled -%{_prefix}/lib/systemd/portable +%{_systemd_util_dir}/systemd-portabled +%{_systemd_util_dir}/portable %{_unitdir}/systemd-portabled.service %{_unitdir}/dbus-org.freedesktop.portable1.service %{_datadir}/dbus-1/system.d/org.freedesktop.portable1.conf From 8fe894317981ff539f8c31fce14f661e819e9c3b75202197fce818c441de6e0d Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Fri, 5 May 2023 13:03:20 +0000 Subject: [PATCH 5/7] - Rather than having one script per fix, use a single script (or "fixlet") per (sub) package that contains all the fixups relative to a (sub) package. This has the advantage to limit the number of scripts but more importantly it will ease the sharing of the spec file between TW and SLE. We should also be able to compare the fixlets of two distros even if the spec files have diverged. Note that all the fixups are run just once now. OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1386 --- files.container | 2 +- files.systemd | 5 +- fixlet-container-machines-btrfs-subvol.sh | 139 ----------------- fixlet-container-post.sh | 146 ++++++++++++++++++ ...ysconfig-i18n.sh => fixlet-systemd-post.sh | 104 +++++++++++-- fixlet-upgrade-from-sysvinit.sh | 34 ---- systemd.changes | 11 ++ systemd.spec | 59 +++---- 8 files changed, 270 insertions(+), 230 deletions(-) delete mode 100644 fixlet-container-machines-btrfs-subvol.sh create mode 100644 fixlet-container-post.sh rename fixlet-migrate-sysconfig-i18n.sh => fixlet-systemd-post.sh (55%) delete mode 100644 fixlet-upgrade-from-sysvinit.sh diff --git a/files.container b/files.container index a5445635..a8371899 100644 --- a/files.container +++ b/files.container @@ -30,7 +30,7 @@ %{_mandir}/man5/org.freedesktop.machine1.5.gz %{_mandir}/man8/systemd-machined.8.gz %{_mandir}/man8/systemd-machined.service.8.gz -%{_systemd_util_dir}/rpm/fixlet-container-machines-btrfs-subvol.sh +%{_systemd_util_dir}/rpm/fixlet-container-post.sh %{_systemd_util_dir}/systemd-machined %{_tmpfilesdir}/systemd-nspawn.conf %{_unitdir}/dbus-org.freedesktop.machine1.service diff --git a/files.systemd b/files.systemd index 95f44378..a53901b8 100644 --- a/files.systemd +++ b/files.systemd @@ -30,6 +30,7 @@ %dir %{_libdir}/systemd %dir %{_localstatedir}/lib/systemd %dir %{_localstatedir}/lib/systemd/catalog +%dir %{_localstatedir}/lib/systemd/rpm %dir %{_modprobedir} %dir %{_sysconfdir}/X11/xorg.conf.d %dir %{_sysconfdir}/binfmt.d @@ -91,7 +92,6 @@ %ghost %config(noreplace) %{_sysconfdir}/vconsole.conf %ghost %dir %attr(2755, root, systemd-journal) %{_localstatedir}/log/journal %ghost %{_localstatedir}/lib/systemd/catalog/database -%ghost %{_localstatedir}/lib/systemd/i18n-migrated %license LICENSE.GPL2 %license LICENSE.LGPL2.1 %{_bindir}/busctl @@ -440,8 +440,7 @@ %{_sysctldir}/99-sysctl.conf %{_systemd_user_env_generator_dir}/30-systemd-environment-d-generator %{_systemd_util_dir}/ntp-units.d/80-systemd-timesync.list -%{_systemd_util_dir}/rpm/fixlet-migrate-sysconfig-i18n.sh -%{_systemd_util_dir}/rpm/fixlet-upgrade-from-sysvinit.sh +%{_systemd_util_dir}/rpm/fixlet-systemd-post.sh %{_systemd_util_dir}/system-preset/99-default.preset %{_systemd_util_dir}/systemd %{_systemd_util_dir}/systemd-binfmt diff --git a/fixlet-container-machines-btrfs-subvol.sh b/fixlet-container-machines-btrfs-subvol.sh deleted file mode 100644 index 6ff4f688..00000000 --- a/fixlet-container-machines-btrfs-subvol.sh +++ /dev/null @@ -1,139 +0,0 @@ -#! /bin/bash -# -# This is used to initially create /var/lib/machines subvolume in case -# the system we're running on is using BTRFS with the specific layout -# used by snapper to perform snapshots, rollbacks, etc... -# -# Unfortunately some distros (TW) already shipped versions with -# systemd creating a plain subvolume which breaks snapper. -# -# If /var/lib/machines is already populated then it's going to be -# pretty ugly to convert the old subvolume into a new one specially -# since it can be in use. -# -# Hopefully not a lot of users are using machinectl to import -# container/VM images. So in most of the cases this directory should -# be empty and we can then simple delete the subvolume and create a -# new one respecting the snapper layout. -# -# In the rare case where /var/lib/machines is populated, we will warn -# the user and let him fix it manually. -# -# In order to avoid ugly dependencies added in systemd package, this -# script should only be called during package updates when -# mksubvolume(8) is available. During installation, /var/lib/machines -# is supposed to be created by the installer now. -# -# See bsc#992573 -# - -warn() { - echo >&2 "warning: $@" -} - -is_btrfs_subvolume() { - # On btrfs subvolumes always have the inode 256 - test $(stat --format=%i "$1") -eq 256 -} - -# This assumes the directory/subvol is emptied by the caller. -rm_subvolume_or_directory() { - is_btrfs_subvolume "$1" && { - btrfs subvolume delete "$1" - return - } - rmdir "$1" -} - -on_exit() { - # Simply print a common error message in case something went - # wrong. - if test $? -ne 0; then - warn "Please fix /var/lib/machines manually." - # FIXME: point to a documentation explaining how to do - # that. - exit 1 - fi -} - -# -# If there's already an entry in fstab for /var/lib/machines, it -# means that: -# -# - the installer initialized /var/lib/machines correctly (default) -# - we already fixed it -# - the sysadmin added it manually -# -# In any cases we should exit. -# -# Note: we can't simply check if /var/lib/machines has been mounted -# because an update through a chroot might be in progress (see -# bsc#1030290). -# -if mount --fake /var/lib/machines 2>/dev/null; then - exit -fi - -# -# If there is already an entry in fstab for /var, it means that: -# -# - the system has a seperate /var subvolume (default from Feb 2018) -# - the system has a seperate /var partition -# -# In any case we should exit -# -if mount --fake /var 2>/dev/null; then - exit -fi - -# -# If something is already mounted don't try to fix anything, it's been -# done manually by the sysadmin. -# -if mountpoint -q /var/lib/machines; then - exit -fi - -# -# Let's try to figure out if the current filesystem uses a Snapper -# BTRFS specific layout. Note that TW uses a different layout than -# SLE... -# -# FIXME: not sure if it's correct, reliable or optimal. -# -case $(findmnt -nr -t btrfs -o FSROOT / 2>/dev/null) in -*.snapshots/*/snapshot*) - ;; -*) - exit 0 -esac - -trap on_exit EXIT - -if test -d /var/lib/machines; then - # - # Ok, we're on a system supporting rollbacks and - # /var/lib/machines is not a subvolume remotely mounted so it - # cannot be suitable for systems supporting rollback. Fix it. - # - echo "Making /var/lib/machines suitable for rollbacks..." - - type mksubvolume >/dev/null 2>&1 || { - warn "mksubvolume(8) is not installed, aborting." - exit 1 - } - test "$(ls -A /var/lib/machines/)" && { - warn "/var/lib/machines is not empty, aborting." - exit 1 - } - - echo "Deleting empty /var/lib/machines directory/subvolume" - rm_subvolume_or_directory /var/lib/machines || { - warn "fail to delete /var/lib/machines" - exit 1 - } -fi - -# At this point /var/lib/machines shouldn't exist. -echo "Creating /var/lib/machines subvolume suitable for rollbacks." -mksubvolume /var/lib/machines diff --git a/fixlet-container-post.sh b/fixlet-container-post.sh new file mode 100644 index 00000000..a61b0724 --- /dev/null +++ b/fixlet-container-post.sh @@ -0,0 +1,146 @@ +#! /bin/bash +# +# This script contains all the fixups run when systemd-container package is +# installed or updated. +# + +warn() { + echo >&2 "warning: $@" +} + +is_btrfs_subvolume() { + # On btrfs subvolumes always have the inode 256 + test $(stat --format=%i "$1") -eq 256 +} + +# This assumes the directory/subvol is emptied by the caller. +rm_subvolume_or_directory() { + is_btrfs_subvolume "$1" && { + btrfs subvolume delete "$1" + return + } + rmdir "$1" +} + +# On systems using BTRFS, convert /var/lib/machines into a subvolume suitable +# for snapper to perform snapshots, rollbacks.. in case it was not properly set +# up, see bsc#992573. The installer has been fixed to properly initialize it at +# installation time. +# +# The conversion might only be problematic for openSUSE distros (TW/Factory) +# where the subvolume was created at the wrong place (via tmpfiles for example) +# and it got populated before we had time to fix it. In this case we'll let the +# user fix it manually. +# +# On SLE12 this subvolume was only introduced during the upgrade from v210 to +# v228 (ie SLE12-SP[01] -> SLE12-SP2+ when we added this workaround hence no +# user should had time to populate it. Note that the subvolume is still created +# at the wrong place due to the call to tmpfiles_create macro in the %post +# section however it's empty so again we shouldn't face any issue to convert it. +# +# In order to avoid ugly dependencies added in systemd package, this function +# should only be called during package updates when mksubvolume(8) is +# available. During installation, /var/lib/machines is supposed to be created by +# the installer now. +# +# See bsc#992573 +# +fix_machines_subvol() { + local tagfile=/var/lib/systemd/rpm/container-machines_subvol + + if [ -e $tagfile ]; then + return 0 + fi + touch $tagfile + + # + # If there's already an entry in fstab for /var/lib/machines, it + # means that: + # + # - the installer initialized /var/lib/machines correctly (default) + # - we already fixed it + # - the sysadmin added it manually + # + # In any cases we should return. + # + # Note: we can't simply check if /var/lib/machines has been mounted + # because an update through a chroot might be in progress (see + # bsc#1030290). + # + if mount --fake /var/lib/machines 2>/dev/null; then + return + fi + + # + # If there is already an entry in fstab for /var, it means that: + # + # - the system has a seperate /var subvolume (default from Feb 2018) + # - the system has a seperate /var partition + # + # In any case we should return. + # + if mount --fake /var 2>/dev/null; then + return + fi + + # + # If something is already mounted don't try to fix anything, it's been + # done manually by the sysadmin. + # + if mountpoint -q /var/lib/machines; then + return + fi + + # + # Let's try to figure out if the current filesystem uses a Snapper + # BTRFS specific layout. Note that TW uses a different layout than + # SLE... + # + # FIXME: not sure if it's correct, reliable or optimal. + # + case $(findmnt -nr -t btrfs -o FSROOT / 2>/dev/null) in + *.snapshots/*/snapshot*) + ;; + *) + return 0 + esac + + if test -d /var/lib/machines; then + # + # Ok, we're on a system supporting rollbacks and + # /var/lib/machines is not a subvolume remotely mounted so it + # cannot be suitable for systems supporting rollback. Fix it. + # + echo "Making /var/lib/machines suitable for rollbacks..." + + type mksubvolume >/dev/null 2>&1 || { + warn "mksubvolume(8) is not installed, aborting." + return 1 + } + test "$(ls -A /var/lib/machines/)" && { + warn "/var/lib/machines is not empty, aborting." + return 1 + } + + echo "Deleting empty /var/lib/machines directory/subvolume" + rm_subvolume_or_directory /var/lib/machines || { + warn "fail to delete /var/lib/machines" + return 1 + } + fi + + # At this point /var/lib/machines shouldn't exist. + echo "Creating /var/lib/machines subvolume suitable for rollbacks." + mksubvolume /var/lib/machines +} + +r=0 +if [ $1 -gt 1 ]; then + # During upgrade + fix_machines_subvol || { + warn "Please fix /var/lib/machines manually." + r=1 + } +fi + +exit $r diff --git a/fixlet-migrate-sysconfig-i18n.sh b/fixlet-systemd-post.sh similarity index 55% rename from fixlet-migrate-sysconfig-i18n.sh rename to fixlet-systemd-post.sh index 432e9e74..185a5167 100644 --- a/fixlet-migrate-sysconfig-i18n.sh +++ b/fixlet-systemd-post.sh @@ -1,4 +1,8 @@ #! /bin/bash +# +# This script contains all the fixups run when systemd package is installed or +# updated. +# # /etc/sysconfig/console | /etc/vconsole.conf # -------------------------+--------------------- @@ -76,13 +80,12 @@ migrate_keyboard () { # According to # https://www.suse.com/documentation/sles-12/book_sle_admin/data/sec_suse_l10n.html, -# variables in /etc/sysconfig/language are supposed to be passed to -# the users' shell *only*. However it seems that there has been some -# confusion and they ended up configuring the system-wide locale as -# well. The logic followed by systemd was implemented in commit -# 01c4b6f4f0d951d17f6873f68156ecd7763429c6, which was reverted. The -# code below follows the same logic to migrate content of -# /etc/sysconfig/language into locale.conf. +# variables in /etc/sysconfig/language are supposed to be passed to the users' +# shell *only*. However it seems that there has been some confusion and they +# ended up configuring the system-wide locale as well. The logic followed by +# systemd was implemented in commit 01c4b6f4f0d951d17f6873f68156ecd7763429c6, +# which was reverted. The code below follows the same logic to migrate content +# of /etc/sysconfig/language into locale.conf. migrate_language () { local lang= local migrated=false @@ -128,18 +131,89 @@ 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. +# +# This is needed both at package updates and package installations because we +# might be upgrading from a system which was running SysV init (systemd package +# is being installed). +# +# It's run only once. +migrate_sysconfig_i18n() { + local tagfile=/var/lib/systemd/rpm/systemd-i18n_migrated + local -i rv=0 -# The marker could have been incorrectly put in /usr/lib. In this case -# move it to its new place. -mv /usr/lib/systemd/scripts/.migrate-sysconfig-i18n.sh~done \ - /var/lib/systemd/i18n-migrated &>/dev/null + if [ -e $tagfile ]; then + return 0 + fi -if ! test -e /var/lib/systemd/i18n-migrated; then - declare -i rv=0 + # The marker could have been incorrectly put in /usr/lib. + mv /usr/lib/systemd/scripts/.migrate-sysconfig-i18n.sh~done $tagfile &>/dev/null + # The tag files have been moved to /var/lib/systemd/rpm later. + mv /var/lib/systemd/i18n-migrated $tagfile &>/dev/null + + if [ -e $tagfile ]; then + return 0 + fi + touch $tagfile migrate_locale; rv+=$? migrate_keyboard; rv+=$? migrate_language; rv+=$? - test $rv -eq 0 && touch /var/lib/systemd/i18n-migrated -fi + return $rv +} + +# +# This function is supposed to be called from the %post section of the main +# package. It contains all the fixups needed when the system was running a +# version of systemd older than v210. +# +# All hacks can potentially break the admin settings since they work in /etc. +# +fix_pre_210() { + local tagfile=/var/lib/systemd/rpm/systemd-pre_210_fixed + + if [ -e $tagfile ]; then + return 0 + fi + touch $tagfile + + # + # During migration from sysvinit to systemd, we used to set the systemd + # default target to one of the 'runlevel*.target' after reading the + # default runlevel from /etc/inittab. We don't do that anymore because + # in most cases using the graphical.target target, which is the default, + # will do the right thing. Moreover the runlevel targets are considered + # as deprecated, so we convert them into "true" systemd targets instead + # here. + # + if target=$(readlink /etc/systemd/system/default.target); then + target=$(basename $target) + case "$target" in + runlevel?.target) + echo "Default target is '$target' but use of runlevels is deprecated, converting" + systemctl --no-reload set-default $target + esac + fi + + # + # Migrate any symlink which may refer to the old path (ie /lib/systemd). + # + for f in $(find /etc/systemd/system -type l -xtype l); do + new_target="/usr$(readlink $f)" + [ -f "$new_target" ] && ln -s -f "$new_target" "$f" + done +} + +r=0 +fix_pre_210 || { + r=1 +} +migrate_sysconfig_i18n || { + echo >&2 "Failed to migrate i18n settings from /etc/sysconfig, continuing..." + r=1 +} + +exit $r diff --git a/fixlet-upgrade-from-sysvinit.sh b/fixlet-upgrade-from-sysvinit.sh deleted file mode 100644 index 2f5e53ff..00000000 --- a/fixlet-upgrade-from-sysvinit.sh +++ /dev/null @@ -1,34 +0,0 @@ -#! /bin/bash - -# -# This script is supposed to be executed from the %post section. It contains all -# hacks needed to update a system which was running systemd < v210. This also -# includes systems migrating from SysV. -# -# All hacks can potentially break the admin settings since they work in /etc... -# - -# -# During migration from sysvinit to systemd, we used to set the systemd default -# target to one of the 'runlevel*.target' after reading the default runlevel -# from /etc/inittab. We don't do that anymore because in most cases using the -# graphical.target target, which is the default, will do the right -# thing. Moreover the runlevel targets are considered as deprecated, so we -# convert them into "true" systemd targets instead here. -# -if target=$(readlink /etc/systemd/system/default.target); then - target=$(basename $target) - case "$target" in - runlevel?.target) - echo "Default systemd target is '$target' but use of runlevels is deprecated" - systemctl --no-reload set-default $target - esac -fi - -# -# Migrate any symlink which may refer to the old path. -# -for f in $(find /etc/systemd/system -type l -xtype l); do - new_target="/usr$(readlink $f)" - [ -f "$new_target" ] && ln -s -f $new_target $f -done diff --git a/systemd.changes b/systemd.changes index 70f67463..942dbe2b 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Thu May 4 15:20:49 UTC 2023 - Franck Bui + +- Rather than having one script per fix, use a single script (or "fixlet") per + (sub) package that contains all the fixups relative to a (sub) package. This + has the advantage to limit the number of scripts but more importantly it will + ease the sharing of the spec file between TW and SLE. We should also be able + to compare the fixlets of two distros even if the spec files have diverged. + + Note that all the fixups are run just once now. + ------------------------------------------------------------------- Thu May 4 09:32:44 UTC 2023 - Franck Bui diff --git a/systemd.spec b/systemd.spec index 0e843727..b0267ef6 100644 --- a/systemd.spec +++ b/systemd.spec @@ -176,9 +176,8 @@ Source6: baselibs.conf Source11: after-local.service Source14: kbd-model-map.legacy -Source100: fixlet-container-machines-btrfs-subvol.sh -Source101: fixlet-upgrade-from-sysvinit.sh -Source102: fixlet-migrate-sysconfig-i18n.sh +Source100: fixlet-container-post.sh +Source101: fixlet-systemd-post.sh Source200: files.systemd Source201: files.udev @@ -772,7 +771,6 @@ mkdir -p %{buildroot}%{_systemd_util_dir}/rpm install -m0755 %{SOURCE100} %{buildroot}%{_systemd_util_dir}/rpm/ %endif install -m0755 %{SOURCE101} %{buildroot}%{_systemd_util_dir}/rpm/ -install -m0755 %{SOURCE102} %{buildroot}%{_systemd_util_dir}/rpm/ %if %{with split_usr} mkdir -p %{buildroot}/{bin,sbin} @@ -843,6 +841,7 @@ mkdir -p %{buildroot}%{_sysconfdir}/X11/xorg.conf.d # Make sure directories in /var exist. mkdir -p %{buildroot}%{_localstatedir}/lib/systemd/coredump mkdir -p %{buildroot}%{_localstatedir}/lib/systemd/catalog +mkdir -p %{buildroot}%{_localstatedir}/lib/systemd/rpm # Make sure the NTP units dir exists. mkdir -p %{buildroot}%{_ntpunitsdir} @@ -887,7 +886,6 @@ touch %{buildroot}%{_sysconfdir}/vconsole.conf touch %{buildroot}%{_sysconfdir}/locale.conf touch %{buildroot}%{_sysconfdir}/machine-info touch %{buildroot}%{_localstatedir}/lib/systemd/catalog/database -touch %{buildroot}%{_localstatedir}/lib/systemd/i18n-migrated %fdupes -s %{buildroot}%{_mandir} @@ -1047,19 +1045,9 @@ if [ -L %{_localstatedir}/lib/systemd/timesync ]; then mv %{_localstatedir}/lib/private/systemd/timesync %{_localstatedir}/lib/systemd/timesync fi -# This includes all hacks needed when upgrading from SysV. -%{_systemd_util_dir}/rpm/fixlet-upgrade-from-sysvinit.sh || : - -# 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. -# -# This is needed both at package updates and package installations because we -# might be upgrading from a system which was running SysV init (systemd package -# is being installed). -# -# It's run only once. -%{_systemd_util_dir}/rpm/fixlet-migrate-sysconfig-i18n.sh || : +# Run the hacks/fixups to clean up old garbages left by (very) old versions of +# systemd. +%{_systemd_util_dir}/rpm/fixlet-systemd-post.sh $1 || : %postun # daemon-reload is implied by systemd_postun_with_restart @@ -1133,30 +1121,17 @@ rm -f /etc/udev/rules.d/{20,55,65}-cdrom.rules %postun -n libudev%{?mini}1 -p %ldconfig %postun -n libsystemd0%{?mini} -p %ldconfig -%pre container -%systemd_pre machines.target - %post container -%systemd_post machines.target %tmpfiles_create systemd-nspawn.conf %if %{with machined} +%systemd_post machines.target %ldconfig -if [ $1 -gt 1 ]; then - # Convert /var/lib/machines subvolume to make it suitable for rollbacks, - # if needed. See bsc#992573. The installer has been fixed to create it - # at installation time. - # - # The conversion might only be problematic for openSUSE distros - # (TW/Factory) where previous versions had already created the subvolume - # at the wrong place (via tmpfiles for example) and user started to - # populate and use it. In this case we'll let the user fix it manually. - # - # For SLE12 this subvolume was only introduced during the upgrade from - # v210 to v228 when we added this workaround. Note that the subvolume is - # still created at the wrong place due to the call to tmpfiles_create - # macro previously however it's empty so there shouldn't be any issues. - %{_systemd_util_dir}/rpm/fixlet-container-machines-btrfs-subvol.sh || : -fi +%endif +%{_systemd_util_dir}/rpm/fixlet-container-post.sh $1 || : + +%if %{with machined} +%pre container +%systemd_pre machines.target %preun container %systemd_preun machines.target @@ -1166,6 +1141,14 @@ fi %ldconfig %endif +%post container +%tmpfiles_create systemd-nspawn.conf +%if %{with machined} +%systemd_post machines.target +%ldconfig +%endif +%{_systemd_util_dir}/rpm/fixlet-container-post.sh $1 || : + %if %{with coredump} %post coredump %sysusers_create systemd-coredump.conf From 48d1d3188b0250ac8a48c2fdb3696e47fa8a02f5eb18e6b8e90d83676e190667 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Fri, 5 May 2023 13:08:35 +0000 Subject: [PATCH 6/7] Revert commit r1382 temporarily until bsc#1211104 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1387 --- systemd.changes | 4 ---- systemd.spec | 12 ++++++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/systemd.changes b/systemd.changes index 942dbe2b..7818ebfa 100644 --- a/systemd.changes +++ b/systemd.changes @@ -42,10 +42,6 @@ Wed May 3 06:20:28 UTC 2023 - Franck Bui e8cf56459b localed-util: make use of strdupcspn() 821c684440 test: use kbd-mode-map we ship in TEST-73-LOCALE -- Mapping for converted keymaps is not needed anymore since their conversion to - their x11 layout counterpart is now done automatically by localed (commit - f08017efd5). - ------------------------------------------------------------------- Tue May 2 10:34:43 UTC 2023 - Franck Bui diff --git a/systemd.spec b/systemd.spec index b0267ef6..e744c648 100644 --- a/systemd.spec +++ b/systemd.spec @@ -922,6 +922,18 @@ install -m 644 %{SOURCE5} %{buildroot}%{_tmpfilesdir}/suse.conf # consume those configs (like glibc or pam), see bsc#1170146. rm -fr %{buildroot}%{_datadir}/factory/* +# Add entries for xkeyboard-config converted keymaps; mappings, which already +# exist in original systemd mapping table are being ignored though, i.e. not +# overwritten; needed as long as YaST uses console keymaps internally and calls +# localectl to convert from vconsole to X11 keymaps. Ideally YaST should switch +# to X11 layout names (the mapping table wouldn't be needed since each X11 +# keymap has a generated xkbd keymap) and let localectl initialize +# /etc/vconsole.conf and /etc/X11/xorg.conf.d/00-keyboard.conf (FATE#319454). +if [ -f /usr/share/systemd/kbd-model-map.xkb-generated ]; then + cat /usr/share/systemd/kbd-model-map.xkb-generated \ + >>%{buildroot}%{_datarootdir}/systemd/kbd-model-map +fi + # kbd-model-map.legacy is used to provide mapping for legacy keymaps, which may # still be used by yast. cat %{SOURCE14} >>%{buildroot}%{_datarootdir}/systemd/kbd-model-map From 75c2b43fcc0dbea01a3cc666b6585ac6362256e4bbb16e0d950985c644960aef Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Fri, 5 May 2023 16:43:41 +0000 Subject: [PATCH 7/7] fix duplicate %post container OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1388 --- systemd.spec | 8 -------- 1 file changed, 8 deletions(-) diff --git a/systemd.spec b/systemd.spec index e744c648..80b5f468 100644 --- a/systemd.spec +++ b/systemd.spec @@ -1133,14 +1133,6 @@ rm -f /etc/udev/rules.d/{20,55,65}-cdrom.rules %postun -n libudev%{?mini}1 -p %ldconfig %postun -n libsystemd0%{?mini} -p %ldconfig -%post container -%tmpfiles_create systemd-nspawn.conf -%if %{with machined} -%systemd_post machines.target -%ldconfig -%endif -%{_systemd_util_dir}/rpm/fixlet-container-post.sh $1 || : - %if %{with machined} %pre container %systemd_pre machines.target