kdump-utils/0008-kdumpctl-fix-shellcheck-warnings.patch
Philipp Rudo d38412baaf Enable erofs support for the kdump initrd
Resolves: RHEL-50942
Upstream: https://github.com/rhkdump/kdump-utils.git
Conflict: Dropped hunks concerning OVS bridge support in patch 3 and 5
	   due to missing 224d310 ("Support setting up Open vSwitch
	   (Ovs) Bridge network")

Also contains upstream commit

commit 2970176d9e9b7b6a1191a9ee54423d2f1c56fbaf
Author: Philipp Rudo <prudo@redhat.com>
Date:   Tue Sep 24 10:39:32 2024 +0200

    spec: fix patching of files in subdirectories

    With 23df04b ("dracut: create sub-directories for dracut modules") the
    dracut modules were moved to subdirectories. This causes problems when
    someone wants to include a patch to the spec file to change one of the
    files in those subdirectories. Reason is that '%autosetup' in the spec
    file calls 'patch' per default. 'patch' however, will strip all
    directories when it is called without option -p. Which means that it
    will search the file in the root directory and then fail because it
    cannot find it. Thus add option -p1 to '%autosetup' which will be passed
    on to 'patch'. Choose -p1 as that will work with the most common patch
    creation tools like git and packit.

    Signed-off-by: Philipp Rudo <prudo@redhat.com>

Signed-off-by: Philipp Rudo <prudo@redhat.com>
2024-09-27 15:48:12 +02:00

76 lines
2.4 KiB
Diff

From e7813e45234e615bf5c937b30294c63c4885c5f9 Mon Sep 17 00:00:00 2001
From: Philipp Rudo <prudo@redhat.com>
Date: Wed, 14 Aug 2024 12:58:17 +0200
Subject: [PATCH 08/16] kdumpctl: fix shellcheck warnings
Fix the shellcheck warnings for kdumpctl. With this
$ $ shellcheck -x kdumpctl
now returns without finding.
While at it make use of the special SCRIPTDIR value for source-path.
Signed-off-by: Philipp Rudo <prudo@redhat.com>
---
kdumpctl | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/kdumpctl b/kdumpctl
index 1b6f7b9..612a159 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -33,9 +33,9 @@ if [[ ${__SOURCED__:+x} ]]; then
else
KDUMP_LIB_PATH=/lib/kdump
fi
-# shellcheck source=./kdump-lib.sh
+# shellcheck source=SCRIPTDIR/kdump-lib.sh
. $KDUMP_LIB_PATH/kdump-lib.sh
-# shellcheck source=./kdump-logger.sh
+# shellcheck source=SCRIPTDIR/kdump-logger.sh
. $KDUMP_LIB_PATH/kdump-logger.sh
#initiate the kdump logger
@@ -1199,16 +1199,15 @@ get_kernel_size()
check_vmlinux "$img" && get_vmlinux_size "$img" && return 0
# That didn't work, so retry after decompression.
- try_decompress '\037\213\010' xy gunzip "$img" "$tmp" ||
+ if try_decompress '\037\213\010' xy gunzip "$img" "$tmp" ||
try_decompress '\3757zXZ\000' abcde unxz "$img" "$tmp" ||
try_decompress 'BZh' xy bunzip2 "$img" "$tmp" ||
try_decompress '\135\0\0\0' xxx unlzma "$img" "$tmp" ||
try_decompress '\211\114\132' xy 'lzop -d' "$img" "$tmp" ||
try_decompress '\002!L\030' xxx 'lz4 -d' "$img" "$tmp" ||
- try_decompress '(\265/\375' xxx unzstd "$img" "$tmp"
-
- # Finally check for uncompressed images or objects:
- [[ $? -eq 0 ]] && get_vmlinux_size "$tmp" && return 0
+ try_decompress '(\265/\375' xxx unzstd "$img" "$tmp"; then
+ get_vmlinux_size "$tmp" && return 0
+ fi
# Fallback to use iomem
local _size=0 _seg
@@ -1475,14 +1474,14 @@ reset_crashkernel()
exit 1
fi
_opt_fadump=${_opt#*=}
- if ! _dump_mode=$(get_dump_mode_by_fadump_val $_opt_fadump); then
+ if ! _dump_mode=$(get_dump_mode_by_fadump_val "$_opt_fadump"); then
derror "failed to determine dump mode"
exit
fi
;;
--kernel=*)
_val=${_opt#*=}
- if ! _valid_grubby_kernel_path $_val; then
+ if ! _valid_grubby_kernel_path "$_val"; then
derror "Invalid $_opt, please specify a valid kernel path, ALL or DEFAULT"
exit
fi
--
2.46.1