Sync from SUSE:SLFO:Main kernel-livepatch-tools revision 43f8724f091c294e5f7528f74c5e9015

This commit is contained in:
2025-06-30 17:48:50 +02:00
parent 76388a604c
commit a25c27a8ad
3 changed files with 36 additions and 2 deletions

View File

@@ -1,3 +1,21 @@
-------------------------------------------------------------------
Wed Jun 25 15:20:40 UTC 2025 - Petr Mladek <pmladek@suse.com>
- Hardcode version 1.2 when building for older distributions
than SL 16.0. The existing livepatch packages require exactly
this version. But new versions are backward compatible.
-------------------------------------------------------------------
Wed Jun 25 13:30:09 UTC 2025 - Petr Mladek <pmladek@suse.com>
- Release version 1.7
-------------------------------------------------------------------
Wed Jun 25 10:34:15 UTC 2025 - Petr Mladek <pmladek@suse.com>
- Use "transactional-update" for downgrading livepatch package
on transactional systems (bsc#1245346)
-------------------------------------------------------------------
Fri Jan 31 10:10:30 UTC 2025 - Petr Mladek <pmladek@suse.com>

View File

@@ -19,7 +19,11 @@
%define dracutlibdir %{_prefix}/lib/dracut
Name: kernel-livepatch-tools
Version: 1.6
%if 0%{?suse_version} >= 1600
Version: 1.7
%else
Version: 1.2
%endif
Release: 0
Summary: Scripts for installing kernel live patches
License: GPL-2.0-only

14
klp.sh
View File

@@ -194,6 +194,13 @@ function klp_detailed_patch_info() {
fi
}
# This check is inspired by zypper source code
function is_transactional_system() {
findmnt -O "ro" -t "btrfs" "/" >/dev/null 2>&1 || return 1
which "transactional-update" >/dev/null 2>&1 || return 1
return 0
}
function klp_downgrade()
{
VERBOSE_ORIG="$VERBOSE"
@@ -237,7 +244,12 @@ function klp_downgrade()
exit 1
fi
ZYPPER_COMMAND="zypper -n in --oldpackage $RPM_NAME = $PREV_RPM_VERSION"
if is_transactional_system ; then
ZYPPER_COMMAND="transactional-update pkg in -n"
else
ZYPPER_COMMAND="zypper -n in"
fi
ZYPPER_COMMAND="$ZYPPER_COMMAND --oldpackage $RPM_NAME = $PREV_RPM_VERSION"
echo "KLP tool will replace the current kernel live patch with its previous version."
echo "The command for downgrade is: $ZYPPER_COMMAND"
if [ -z "$NON_INTERACTIVE" ]; then