Unnamed repository
Go to file
Tao Liu 1bcff505ed Use "grep -q <<< $(cmd)" instead of "cmd | grep -q"
Resolves: RHEL-40948
Conflict: Yes, commented the diff code within the patch's commit log,
          otherwise the patch command will regard the diff code as regular
          patch hunk and fail.
Upstream: fedora

commit 98087d78eda2ca58a3b55ee5dd9e0e7bad8467ef
Author: Tao Liu <ltao@redhat.com>
Date:   Tue Jun 25 16:35:16 2024 +1200

    Use "grep -q <<< $(cmd)" instead of "cmd | grep -q"

    The following line of code's exit value should be the exit value of
    grep by default:

        cmd | grep -q

    However it will not always work as expected, a 141 exit code may be
    returned, see the following debug info:

    --- a/usr/lib/dracut/modules.d/99kdumpbase/module-setup.sh
    +++ b/usr/lib/dracut/modules.d/99kdumpbase/module-setup.sh
    @@ -55,6 +55,11 @@ depends() {
             _dep="$_dep ssh-client"
         fi

    +    dracut --list-modules 1>&2
    +    echo $? 1>&2
    +    dracut --list-modules | grep -q lvmthinpool-monitor
    +    echo $? ${PIPESTATUS[0]} ${PIPESTATUS[1]} 1>&2
    +
         if is_lvm2_thinp_dump_target; then
             if dracut --list-modules | grep -q lvmthinpool-monitor; then
                 add_opt_module lvmthinpool-monitor

    $ kdumpctl rebuild
    kdump: Rebuilding /boot/initramfs-6.10.0-0.rc4.11.el10.x86_64kdump.img
    ...snip...
    lvmmerge
    lvmthinpool-monitor
    ..snip...
    uefi-lib
    0
    141 141 0

    The reason is, grep exits immediately when there is a match but the
    first cmd still keep writing to the pipe. Since there is no reader,
    a SIGPIPE signal is generated. As a result, a 141 exit code will be
    returned.

    Let's use the following line of code instead, which have the same effect
    but works as expected:

        grep -q <<< $(cmd)

    Signed-off-by: Tao Liu <ltao@redhat.com>

Signed-off-by: Tao Liu <ltao@redhat.com>
2024-06-28 15:15:14 +12:00
spec Get rid of "grep: warning: stray \ before /" 2024-01-31 14:38:49 +08:00
tests tests: use the default crashkernel value 2023-06-20 10:24:25 +08:00
.editorconfig dracut-early-kdump: explicitly use bash 2023-01-30 17:37:23 +08:00
.gitignore unit tests: prepare for kdumpctl and kdump-lib.sh to be unit-tested 2022-04-14 11:44:12 +08:00
.packit.yaml [packit] 2.0.27 upstream release 2023-08-31 11:29:43 +08:00
.shellspec unit tests: add tests for get_grub_kernel_boot_parameter 2022-04-14 11:44:27 +08:00
0001-dracut-module-setup-Fix-missing-systemd-system.conf-.patch Re apply upstream patches 2024-06-11 11:05:24 +08:00
0001-Use-grep-q-cmd-instead-of-cmd-grep-q.patch Use "grep -q <<< $(cmd)" instead of "cmd | grep -q" 2024-06-28 15:15:14 +12:00
0002-mkdumprd-Fix-makedumpfile-parameter-check.patch Re apply upstream patches 2024-06-11 11:05:24 +08:00
0003-Try-to-install-PHY-and-MDIO-bus-drivers-explicitly.patch Re apply upstream patches 2024-06-11 11:05:24 +08:00
0004-Install-the-driver-of-physical-device-for-a-SR-IOV-v.patch Re apply upstream patches 2024-06-11 11:05:24 +08:00
0005-update-98-kexec-rules-for-crash-hotplug.patch Re apply upstream patches 2024-06-11 11:05:24 +08:00
0006-sysconfig-add-pcie_ports-compat-to-KDUMP_COMMANDLINE.patch Re apply upstream patches 2024-06-11 11:05:24 +08:00
0007-fadump-udev-do-not-re-register-fadump-if-kernel-hotp.patch Re apply upstream patches 2024-06-11 11:05:24 +08:00
gating.yaml Add gating.yaml to RHEL-10 kexec-tools 2024-04-22 17:12:25 +08:00
kexec-tools-2.0.28-Fix-building-on-x86_64-with-binutils-2.41.patch 2.0.28 upstream release 2024-02-02 20:13:00 +08:00
kexec-tools-2.0.28-kexec-don-t-use-kexec_file_load-on-XEN.patch 2.0.28 upstream release 2024-02-02 20:13:00 +08:00
kexec-tools-2.0.28-makedumfpile-0001-PATCH-ppc64-get-vmalloc-start-address-from-vmcoreinf.patch Release 2.0.26-7 2024-04-29 10:04:27 +08:00
kexec-tools-2.0.28-makedumpfile-0002-PATCH-Fix-failure-of-hugetlb-pages-exclusion-on-Linu.patch Release 2.0.28-12 2024-06-19 09:11:53 +08:00
kexec-tools-2.0.28-makedumpfile-0003-PATCH-Fix-wrong-exclusion-of-Slab-pages-on-Linux-6.1.patch Release 2.0.28-12 2024-06-19 09:11:53 +08:00
kexec-tools.spec Use "grep -q <<< $(cmd)" instead of "cmd | grep -q" 2024-06-28 15:15:14 +12:00
README README: Add a README file 2014-04-02 10:45:36 +08:00
README.packit 2.0.28 upstream release 2024-02-02 20:13:00 +08:00
sources makedumpfile: remove explicit-lib-dependency zlib 2024-04-29 10:35:57 +08:00

Adding a patch to kexec-tools
=============================
There is a mailing list kexec@lists.fedoraproject.org where all the dicussion
related to fedora kexec-tools happen. All the patches are posted there for
inclusion and committed to kexec-tools after review.

So if you want your patches to be included in fedora kexec-tools package,
post these to kexec@lists.fedoraproject.org.

One can subscribe to list and browse through archives here.

https://admin.fedoraproject.org/mailman/listinfo/kexec