Compare commits

...

1 Commits

Author SHA1 Message Date
28e28251c8 import RHEL 10 Beta kdump-utils-1.0.43-1.el10 2024-11-20 13:41:32 +00:00
7 changed files with 27 additions and 187 deletions

4
.gitignore vendored
View File

@ -1,3 +1 @@
/kdump-utils-1.0.42.tar.gz
/kdump-utils-1.0.43.tar.gz
/kdump-utils-1.0.45.tar.gz
kdump-utils-1.0.43.tar.gz

View File

@ -1,44 +0,0 @@
From f6e00948aba7c31f722af79ed72c4020868dcad7 Mon Sep 17 00:00:00 2001
From: Tao Liu <ltao@redhat.com>
Date: Fri, 18 Oct 2024 21:45:03 +1300
Subject: [PATCH] Return the correct exit code of rebuild initrd
Resolves: https://issues.redhat.com/browse/RHEL-63047
The exit code of rebuild_initrd() should be either of
rebuild_kdump/fadump_initrd(), rather than set_vmcore_creation_status(),
otherwise it will cause a regression when rebuild initrd fails.
Fixes: 88525ebf ("Introduce vmcore creation notification to kdump")
Signed-off-by: Tao Liu <ltao@redhat.com>
---
kdumpctl | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kdumpctl b/kdumpctl
index 82b7fb1..0140eeb 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -173,6 +173,7 @@ rebuild_kdump_initrd()
rebuild_initrd()
{
+ local _ret
dinfo "Rebuilding $TARGET_INITRD"
if [[ ! -w $(dirname "$TARGET_INITRD") ]]; then
@@ -185,8 +186,10 @@ rebuild_initrd()
else
rebuild_kdump_initrd
fi
+ _ret=$?
set_vmcore_creation_status 'clear' "$VMCORE_CREATION_STATUS"
+ return $_ret
}
#$1: the files to be checked with IFS=' '
--
2.40.1

View File

@ -1,115 +0,0 @@
From 4244c20ba021e8563a9f0bc297060338ed3a1158 Mon Sep 17 00:00:00 2001
From: Coiby Xu <coxu@redhat.com>
Date: Tue, 15 Oct 2024 15:11:48 +0800
Subject: [PATCH 2/2] Allow ssh opts to be processed correctly
Resolves: https://github.com/rhkdump/kdump-utils/issues/46
ssh opts shouldn't be quoted otherwise it will be treated as one
argument. For clarity, also rename ssh_opt to ssh_opts.
Fixes: 7218f584 ("99kdumpbase: fix shellcheck warnings")
Reported-by: Jean-Baptiste Trystram <jbtrystram@redhat.com>
Signed-off-by: Coiby Xu <coxu@redhat.com>
---
dracut/99kdumpbase/kdump.sh | 43 +++++++++++++++++++++++--------------
1 file changed, 27 insertions(+), 16 deletions(-)
diff --git a/dracut/99kdumpbase/kdump.sh b/dracut/99kdumpbase/kdump.sh
index e35a76d..00a61f9 100755
--- a/dracut/99kdumpbase/kdump.sh
+++ b/dracut/99kdumpbase/kdump.sh
@@ -396,7 +396,7 @@ dump_raw() {
# $2: ssh address in <user>@<host> format
dump_ssh() {
_ret=0
- _ssh_opt="-i $1 -o BatchMode=yes -o StrictHostKeyChecking=yes"
+ _ssh_opts="-i $1 -o BatchMode=yes -o StrictHostKeyChecking=yes"
_ssh_dir="$KDUMP_PATH/$HOST_IP-$DATEDIR"
if is_ipv6_address "$2"; then
_scp_address=${2%@*}@"[${2#*@}]"
@@ -407,31 +407,37 @@ dump_ssh() {
dinfo "saving to $2:$_ssh_dir"
cat /var/lib/random-seed > /dev/urandom
- ssh -q "$_ssh_opt" "$2" mkdir -p "$_ssh_dir" || return 1
+ # shellcheck disable=SC2086 # ssh_opts needs to be split
+ ssh -q $_ssh_opts "$2" mkdir -p "$_ssh_dir" || return 1
- save_vmcore_dmesg_ssh "$DMESG_COLLECTOR" "$_ssh_dir" "$_ssh_opt" "$2"
+ save_vmcore_dmesg_ssh "$DMESG_COLLECTOR" "$_ssh_dir" "$_ssh_opts" "$2"
dinfo "saving vmcore"
KDUMP_LOG_DEST=$2:$_ssh_dir/
- KDUMP_LOG_OP="scp -q $_ssh_opt '$KDUMP_LOG_FILE' '$_scp_address:$_ssh_dir/'"
+ KDUMP_LOG_OP="scp -q $_ssh_opts '$KDUMP_LOG_FILE' '$_scp_address:$_ssh_dir/'"
- save_opalcore_ssh "$_ssh_dir" "$_ssh_opt" "$2" "$_scp_address"
+ save_opalcore_ssh "$_ssh_dir" "$_ssh_opts" "$2" "$_scp_address"
if [ "${CORE_COLLECTOR%%[[:blank:]]*}" = "scp" ]; then
- scp -q "$_ssh_opt" /proc/vmcore "$_scp_address:$_ssh_dir/vmcore-incomplete"
+ # shellcheck disable=SC2086 # ssh_opts needs to be split
+ scp -q $_ssh_opts /proc/vmcore "$_scp_address:$_ssh_dir/vmcore-incomplete"
_ret=$?
_vmcore="vmcore"
else
- # shellcheck disable=SC2029
- $CORE_COLLECTOR /proc/vmcore | ssh "$_ssh_opt" "$2" "umask 0077 && dd bs=512 of='$_ssh_dir/vmcore-incomplete'"
+ # shellcheck disable=SC2029,SC2086
+ # - _ssh_opts needs to be split
+ # - _ssh_dir needs to be expanded
+ $CORE_COLLECTOR /proc/vmcore | ssh $_ssh_opts "$2" "umask 0077 && dd bs=512 of='$_ssh_dir/vmcore-incomplete'"
_ret=$?
_vmcore="vmcore.flat"
fi
if [ $_ret -eq 0 ]; then
- # shellcheck disable=SC2029
- ssh "$_ssh_opt" "$2" "mv '$_ssh_dir/vmcore-incomplete' '$_ssh_dir/$_vmcore'"
+ # shellcheck disable=SC2029,SC2086
+ # - _ssh_opts needs to be split
+ # - _ssh_dir needs to be expanded
+ ssh $_ssh_opts "$2" "mv '$_ssh_dir/vmcore-incomplete' '$_ssh_dir/$_vmcore'"
_ret=$?
if [ $_ret -ne 0 ]; then
derror "moving vmcore failed, exitcode:$_ret"
@@ -461,13 +467,16 @@ save_opalcore_ssh() {
dinfo "saving opalcore:$OPALCORE to $3:$1"
- if ! scp "$2" "$OPALCORE" "$4:$1/opalcore-incomplete"; then
+ # shellcheck disable=SC2086 # $2 (_ssh_opts) needs to be split
+ if ! scp $2 "$OPALCORE" "$4:$1/opalcore-incomplete"; then
derror "saving opalcore failed"
return 1
fi
- # shellcheck disable=SC2029
- ssh "$2" "$3" mv "$1/opalcore-incomplete" "$1/opalcore"
+ # shellcheck disable=SC2029,SC2086
+ # - $1 (dump path) needs to be expanded
+ # - $2 (_ssh_opts) needs to be split
+ ssh $2 "$3" mv "$1/opalcore-incomplete" "$1/opalcore"
dinfo "saving opalcore complete"
return 0
}
@@ -478,9 +487,11 @@ save_opalcore_ssh() {
# $4: ssh address in <user>@<host> format
save_vmcore_dmesg_ssh() {
dinfo "saving vmcore-dmesg.txt to $4:$2"
- # shellcheck disable=SC2029
- if "$1" /proc/vmcore | ssh "$3" "$4" "umask 0077 && dd of='$2/vmcore-dmesg-incomplete.txt'"; then
- ssh -q "$3" "$4" mv "$2/vmcore-dmesg-incomplete.txt" "$2/vmcore-dmesg.txt"
+ # shellcheck disable=SC2029,SC2086
+ # - $2 (_ssh_dir) needs to be expanded
+ # - $3 (_ssh_opts) needs to be split
+ if "$1" /proc/vmcore | ssh $3 "$4" "umask 0077 && dd of='$2/vmcore-dmesg-incomplete.txt'"; then
+ ssh -q $3 "$4" mv "$2/vmcore-dmesg-incomplete.txt" "$2/vmcore-dmesg.txt"
dinfo "saving vmcore-dmesg.txt complete"
else
derror "saving vmcore-dmesg.txt failed"
--
2.47.0

View File

@ -1,3 +0,0 @@
# kdump-utils
The kdump-utils package

View File

@ -1,6 +0,0 @@
--- !Policy
product_versions:
- rhel-10
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: kernel-qe.kernel-ci.general-kdump.tier0.functional}

View File

@ -1,21 +1,14 @@
# kdump-utils has no debug source
%global debug_package %{nil}
Name: kdump-utils
Version:1.0.45
Release: %autorelease
Version:1.0.43
Release: 1%{?dist}
Summary: Kernel crash dump collection utilities
License: GPL-2.0-only
URL: https://github.com/rhkdump/kdump-utils
Source0: https://github.com/rhkdump/kdump-utils/archive/v%{version}/%{name}-%{version}.tar.gz
# Return the correct exit code of rebuild initrd
# Author: Tao Liu <ltao@redhat.com>
Patch1: 0001-Return-the-correct-exit-code-of-rebuild-initrd.patch
# Allow ssh opts to be processed correctly
# Author: Coiby Xu <coxu@redhat.com>
Patch2: 0002-Allow-ssh-opts-to-be-processed-correctly.patch
%ifarch ppc64 ppc64le
Requires(post): servicelog
Recommends: keyutils
@ -46,15 +39,23 @@ kdump kernel and initramfs to save the collected crash kernel dump to specified
target.
%prep
%autosetup -p1
%autosetup
%install
%make_install sbindir=%_sbindir
%post
# kdumpctl will only set up default crashkernel when kdump.service is enabled
%systemd_post kdump.service
# don't try to systemctl preset the kdump service for old kexec-tools
#
# when the old kexec-tools gets removed, this trigger will be excuted to
# create a file. So later the posttrans scriptlet will know there is no need to
# systemctl preset the kdump service.
# This solution can be dropped in F41 when we assume no users will use old
# version of kexec-tools.
%define kexec_tools_no_preset %{_localstatedir}/lib/rpm-state/kexec-tools.no-preset
%triggerun -- kexec-tools
touch %{kexec_tools_no_preset}
touch /etc/kdump.conf
@ -74,6 +75,14 @@ servicelog_notify --remove --command=/usr/lib/kdump/kdump-migrate-action.sh >/de
%systemd_preun kdump.service
%posttrans
# don't try to systemctl preset the kdump service for old kexec-tools
if [[ -f %{kexec_tools_no_preset} ]]; then
# this if branch can be removed in F41 when we assume no users will use the old kexec-tools
rm %{kexec_tools_no_preset}
else
# Initial installation
%systemd_post kdump.service
fi
# Try to reset kernel crashkernel value to new default value or set up
# crasherkernel value for new install
#
@ -81,7 +90,6 @@ servicelog_notify --remove --command=/usr/lib/kdump/kdump-migrate-action.sh >/de
# 1. Skip ostree systems as they are not supported.
# 2. For Fedora 36 and RHEL9, "[ $1 == 1 ]" in posttrans scriptlet means both install and upgrade;
# For Fedora > 36, "[ $1 == 1 ]" only means install and "[ $1 == 2 ]" means upgrade
# 3. osbuild depends on "kdumpctl _reset-crashkernel-for-installed_kernel" to set up crashkernel
if [ ! -f /run/ostree-booted ] && [ $1 == 1 -o $1 == 2 ]; then
kdumpctl _reset-crashkernel-after-update
:
@ -124,4 +132,8 @@ fi
%doc supported-kdump-targets.txt
%changelog
%autochangelog
* Mon Jul 15 2024 Lichen Liu <lichliu@redhat.com> - 1.0.43-1
- Update to upstream 1.0.43
* Tue Oct 24 2023 Coiby <coxu@redhat.com> - 1.0.42-10
- split from kexec-tools

View File

@ -1,3 +1 @@
SHA512 (kdump-utils-1.0.42.tar.gz) = 2d8717a010bfbffd4410ef57ade1402316cda07faa1063631b8665ac273fac618bff0afd9bdc02292c859d956790e06a51d81b141db158957ef97eb8408111c4
SHA512 (kdump-utils-1.0.43.tar.gz) = ede87a85f63f1f08aec477729a2fe7858d78bd21588b00d13c8ce25b6d951bd400a0642bc2ae34c62ebcce54b8b8ff0c7a8d1d867be18217c9b015adc4131707
SHA512 (kdump-utils-1.0.45.tar.gz) = 4df7136473978cdf80690cb25f1e4a5bde6c6b2e4e99940a06210b4a8e491afb0918a63fc4590fcac2379122fec6e9369e1370ec9ce6fcdbe2e80102e43a023d