Sync from SUSE:SLFO:Main purge-kernels-service revision 24588d5d221b35675ad1a5d828f5a2a8

This commit is contained in:
Adrian Schröter 2024-12-24 17:14:38 +01:00
commit ca289d63af
4 changed files with 139 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -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

View File

@ -0,0 +1,44 @@
-------------------------------------------------------------------
Fri May 13 13:08:14 UTC 2022 - Michal Suchanek <msuchanek@suse.com>
- Change service type to exec (boo#1198668).
-------------------------------------------------------------------
Thu May 6 14:05:53 UTC 2021 - Michal Suchanek <msuchanek@suse.de>
- Add ZYPP_LOCK_TIMEOUT=-1 to keep waiting for the lock (boo#1184399).
-------------------------------------------------------------------
Wed May 27 16:11:09 UTC 2020 - Michal Suchanek <msuchanek@suse.de>
- Add split provides for upgrade from old dracut (boo#1168727).
-------------------------------------------------------------------
Sun Mar 8 08:46:45 UTC 2020 - Antoine Belvire <antoine.belvire@opensuse.org>
- Set build architecture to noarch.
-------------------------------------------------------------------
Mon Mar 2 10:56:45 UTC 2020 - Michal Suchanek <msuchanek@suse.com>
- Clear do_purge_kernels with ExecStartPost rather than ExecStartPre (boo#1162163).
-------------------------------------------------------------------
Fri Jan 31 18:23:25 UTC 2020 - Dominique Leuenberger <dimstar@opensuse.org>
- Fix typo in Summary.
-------------------------------------------------------------------
Fri Jan 24 14:45:26 UTC 2020 - Michal Suchanek <msuchanek@suse.com>
- Fix zypper asking for confirmation in service (boo#1161620).
-------------------------------------------------------------------
Mon Jan 20 12:02:24 UTC 2020 - Michal Suchanek <msuchanek@suse.de>
- Fix dracut version in conflicts.
-------------------------------------------------------------------
Fri Dec 13 16:21:40 UTC 2019 - Michal Suchanek <msuchanek@suse.de>
- Intial package purge-kernels-service (jsc#SLE-10162, jsc#SLE-10465)

View File

@ -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

16
purge-kernels.service Normal file
View File

@ -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