From ca289d63af0b613bce162e93e5ab2b9194635827fbb87ec5135aa8c7e2a131ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Tue, 24 Dec 2024 17:14:38 +0100 Subject: [PATCH] Sync from SUSE:SLFO:Main purge-kernels-service revision 24588d5d221b35675ad1a5d828f5a2a8 --- .gitattributes | 23 ++++++++++++++ purge-kernels-service.changes | 44 +++++++++++++++++++++++++++ purge-kernels-service.spec | 56 +++++++++++++++++++++++++++++++++++ purge-kernels.service | 16 ++++++++++ 4 files changed, 139 insertions(+) create mode 100644 .gitattributes create mode 100644 purge-kernels-service.changes create mode 100644 purge-kernels-service.spec create mode 100644 purge-kernels.service diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/purge-kernels-service.changes b/purge-kernels-service.changes new file mode 100644 index 0000000..c675c64 --- /dev/null +++ b/purge-kernels-service.changes @@ -0,0 +1,44 @@ +------------------------------------------------------------------- +Fri May 13 13:08:14 UTC 2022 - Michal Suchanek + +- Change service type to exec (boo#1198668). + +------------------------------------------------------------------- +Thu May 6 14:05:53 UTC 2021 - Michal Suchanek + +- Add ZYPP_LOCK_TIMEOUT=-1 to keep waiting for the lock (boo#1184399). + +------------------------------------------------------------------- +Wed May 27 16:11:09 UTC 2020 - Michal Suchanek + +- Add split provides for upgrade from old dracut (boo#1168727). + +------------------------------------------------------------------- +Sun Mar 8 08:46:45 UTC 2020 - Antoine Belvire + +- Set build architecture to noarch. + +------------------------------------------------------------------- +Mon Mar 2 10:56:45 UTC 2020 - Michal Suchanek + +- Clear do_purge_kernels with ExecStartPost rather than ExecStartPre (boo#1162163). + +------------------------------------------------------------------- +Fri Jan 31 18:23:25 UTC 2020 - Dominique Leuenberger + +- Fix typo in Summary. + +------------------------------------------------------------------- +Fri Jan 24 14:45:26 UTC 2020 - Michal Suchanek + +- Fix zypper asking for confirmation in service (boo#1161620). + +------------------------------------------------------------------- +Mon Jan 20 12:02:24 UTC 2020 - Michal Suchanek + +- Fix dracut version in conflicts. + +------------------------------------------------------------------- +Fri Dec 13 16:21:40 UTC 2019 - Michal Suchanek + +- Intial package purge-kernels-service (jsc#SLE-10162, jsc#SLE-10465) diff --git a/purge-kernels-service.spec b/purge-kernels-service.spec new file mode 100644 index 0000000..6c722ba --- /dev/null +++ b/purge-kernels-service.spec @@ -0,0 +1,56 @@ +# +# spec file for package purge-kernels-service +# +# Copyright (c) 2022 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: purge-kernels-service +Version: 0 +Release: 0 +Summary: The service for removing old kernels when multiversion is enabled +License: MIT +Source: purge-kernels.service +Conflicts: dracut < 049+git118 +Provides: dracut:/usr/lib/systemd/system/purge-kernels.service +Requires: zypper(purge-kernels) +BuildRequires: systemd-rpm-macros +BuildArch: noarch + +%description +This service runs zypper purge-kernels on boot after a kernel package was installed. + +%prep + +%build + +%install +install -m 644 -D -t %{buildroot}/%{_unitdir}/ %{SOURCE0} + +%pre +%service_add_pre purge-kernels.service + +%post +%service_add_post purge-kernels.service + +%preun +%service_del_preun purge-kernels.service + +%postun +%service_del_postun purge-kernels.service + +%files +%{_unitdir}/purge-kernels.service + +%changelog diff --git a/purge-kernels.service b/purge-kernels.service new file mode 100644 index 0000000..ff0b2dd --- /dev/null +++ b/purge-kernels.service @@ -0,0 +1,16 @@ +[Unit] +Description=Purge old kernels +After=local-fs.target +ConditionPathExists=/boot/do_purge_kernels +ConditionPathIsReadWrite=/ + +[Service] +Type=exec +Nice=19 +IOSchedulingClass=idle +Environment=ZYPP_LOCK_TIMEOUT=-1 +ExecStart=/usr/bin/zypper -n purge-kernels +ExecStartPost=/bin/rm -f /boot/do_purge_kernels + +[Install] +WantedBy=multi-user.target