kdump-utils/0007-99zz-fadumpinit-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

52 lines
1.7 KiB
Diff

From 3cb964855f508e8aabc91c297d9efc0cab766b0c Mon Sep 17 00:00:00 2001
From: Philipp Rudo <prudo@redhat.com>
Date: Tue, 13 Aug 2024 16:23:26 +0200
Subject: [PATCH 07/16] 99zz-fadumpinit: fix shellcheck warnings
Fix the shellcheck warnings for 99zz-fadumpinit. With this
$ shellcheck -x dracut/99zz-fadumpinit/*.sh
now returns without finding.
Signed-off-by: Philipp Rudo <prudo@redhat.com>
---
dracut/99zz-fadumpinit/init-fadump.sh | 6 ++----
dracut/99zz-fadumpinit/module-setup.sh | 2 ++
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/dracut/99zz-fadumpinit/init-fadump.sh b/dracut/99zz-fadumpinit/init-fadump.sh
index 933afc0..911cf9e 100755
--- a/dracut/99zz-fadumpinit/init-fadump.sh
+++ b/dracut/99zz-fadumpinit/init-fadump.sh
@@ -14,10 +14,8 @@ if [ -f /proc/device-tree/rtas/ibm,kernel-dump ] || [ -f /proc/device-tree/ibm,o
mkdir /newroot
mount -t ramfs ramfs /newroot
- if [ $ROOTFS_IS_RAMFS ]; then
- for FILE in $(ls -A /fadumproot/); do
- mv /fadumproot/$FILE /newroot/
- done
+ if [ "$ROOTFS_IS_RAMFS" ]; then
+ mv /fadumproot/* /newroot/
exec switch_root /newroot /init
else
mkdir /newroot/sys /newroot/proc /newroot/dev /newroot/run /newroot/oldroot
diff --git a/dracut/99zz-fadumpinit/module-setup.sh b/dracut/99zz-fadumpinit/module-setup.sh
index f062486..8fa5e16 100755
--- a/dracut/99zz-fadumpinit/module-setup.sh
+++ b/dracut/99zz-fadumpinit/module-setup.sh
@@ -9,7 +9,9 @@ depends() {
}
install() {
+ # shellcheck disable=SC2154
mv -f "$initdir/init" "$initdir/init.dracut"
+ # shellcheck disable=SC2154
inst_script "$moddir/init-fadump.sh" /init
chmod a+x "$initdir/init"
--
2.46.1