kdump-utils/0004-99kdumpbase-drop-unnecessary-2-1.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

48 lines
1.8 KiB
Diff

From 3487bc2c6b24331eca01f2d0c2d30016e8686eaf Mon Sep 17 00:00:00 2001
From: Philipp Rudo <prudo@redhat.com>
Date: Tue, 13 Aug 2024 14:49:44 +0200
Subject: [PATCH 04/16] 99kdumpbase: drop unnecessary 2>&1
Bash allows to redirect/pipe the stdout and stderr together using
'&>' and '|&'. Make use of this to simplify the code a little bit.
Signed-off-by: Philipp Rudo <prudo@redhat.com>
---
dracut/99kdumpbase/module-setup.sh | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/dracut/99kdumpbase/module-setup.sh b/dracut/99kdumpbase/module-setup.sh
index 8e0bccc..56215e4 100755
--- a/dracut/99kdumpbase/module-setup.sh
+++ b/dracut/99kdumpbase/module-setup.sh
@@ -488,14 +488,13 @@ kdump_setup_znet() {
fi
for _netif in $1; do
- chzdev --export "$_tempfile" --active --by-interface "$_netif" \
- 2>&1 | ddebug
+ chzdev --export "$_tempfile" --active --by-interface "$_netif" |& ddebug
sed -i -e 's/^\[active /\[persistent /' "$_tempfile"
ddebug < "$_tempfile"
chzdev --import "$_tempfile" --persistent --base "/etc=$initdir/etc" \
- --yes --no-root-update --force 2>&1 | ddebug
+ --yes --no-root-update --force |& ddebug
lszdev --configured --persistent --info --by-interface "$_netif" \
- --base "/etc=$initdir/etc" 2>&1 | ddebug
+ --base "/etc=$initdir/etc" |& ddebug
done
rm -f "$_tempfile"
}
@@ -888,7 +887,7 @@ is_localhost() {
get_pcs_fence_kdump_nodes() {
local nodes
- pcs cluster sync > /dev/null 2>&1 && pcs cluster cib-upgrade > /dev/null 2>&1
+ pcs cluster sync &> /dev/null && pcs cluster cib-upgrade &> /dev/null
# get cluster nodes from cluster cib, get interface and ip address
nodelist=$(pcs cluster cib | xmllint --xpath "/cib/status/node_state/@uname" -)
--
2.46.1