Commit Graph

9 Commits

Author SHA1 Message Date
Pingfan Liu
44100b9a8a mkdumprd: Fix makedumpfile parameter check
Resolves: https://issues.redhat.com/browse/RHEL-38358
Upstream: kdump-utils

commit 247c7a5f39b305f9a83bad2d936d00237165b7e0
Author: Mamoru Nishibe (Fujitsu) <nishibe.mamoru@fujitsu.com>
Date:   Wed Apr 24 08:11:12 2024 +0000

    mkdumprd: Fix makedumpfile parameter check.

    If only "makedumpfile" is written in "core_collector" of /etc/kdump.conf
    and try to run makedumpfile without options,
    "makedumpfile --check-params" fails and terminates abnormally.

        # grep ^core_collector /etc/kdump.conf
        core_collector makedumpfile
        # /usr/bin/kdumpctl start
        :
        Commandline parameter is invalid.
        Try `makedumpfile --help' for more information.
        kdump: makedumpfile parameter check failed.
        kdump: mkdumprd: failed to make kdump initrd
        kdump: Starting kdump: [FAILED]

    On the other hand, "makedumpfile --check-params" works fine without any options.

        # makedumpfile --check-params vmcore dumpfile
        # echo $?
        0

    In addition, before verify_core_collector() was implemented,
    initial RAM for kdump was successfully created using only "core_collector makedumpfile".
    I consider it a regression.

    This is due to a parameter extraction error in verify_core_collector().
    Fix it to correctly extract only the options as follows.

    Fixes: a1c28126 ("mkdumprd: Use makedumpfile --check-params option")
    Signed-off-by: Mamoru Nishibe <nishibe.mamoru@fujitsu.com>
    Reviewed-by: Coiby Xu <coxu@redhat.com>

Signed-off-by: Pingfan Liu <piliu@redhat.com>
2024-06-18 09:46:19 +08:00
Coiby Xu
2c30dbd5ed mkdumprd: Use the correct syntax to redirect the stderr to null
Resolves: bz2185794
Upstream: Fedora
Conflicts: None

commit e42a823dae
Author: Coiby Xu <coxu@redhat.com>
Date:   Thu Jun 1 16:05:05 2023 +0800

    mkdumprd: Use the correct syntax to redirect the stderr to null

    A space was added by mistake and unfortunately fips-mode-setup refuses
    an extra parameter,

        # fips-mode-setup --is-enabled 2 > /dev/null
        # echo $?
        2
        # fips-mode-setup --is-enabled 2
        Check, enable, or disable the system FIPS mode.
        usage: /usr/bin/fips-mode-setup --enable|--disable [--no-bootcfg]
        usage: /usr/bin/fips-mode-setup --check
        usage: /usr/bin/fips-mode-setup --is-enabled

    So in this case mkdumprd can never detect if FIPS is enabled. Fix this
    mistake.

    Fixes: 443a43e0 ("mkdumprd: call dracut with --add-device to install the drivers needed by /boot partition automatically for FIPS")
    Signed-off-by: Coiby Xu <coxu@redhat.com>
    Reviewed-by: Tao Liu <ltao@redhat.com>

Signed-off-by: Coiby Xu <coxu@redhat.com>
2023-08-10 17:25:44 +08:00
Coiby Xu
9b051369fc mkdumprd: call dracut with --add-device to install the drivers needed by /boot partition automatically for FIPS
Resolves: bz2185794
Upstream: Fedora
Conflicts: small change

commit 443a43e075
Author: Coiby Xu <coxu@redhat.com>
Date:   Wed May 24 12:01:45 2023 +0800

    mkdumprd: call dracut with --add-device to install the drivers needed by /boot partition automatically for FIPS

    Currently, kdump doesn't work on many FIPS-enabled systems including
    Azure, ESXI, Hyper, POWER and etc. When FIPS is enabled, it needs to
    access /boot//.vmlinuz-xxx.hmac to verify the integrity of the kernel.
    However, on those systems, /boot fails to be mounted due to a lack of
    fs and block device drivers and the system just halted after failing to
    verify the integrity of the kernel. For example, on Hyper-V, sd_mod, sg,
    scsi_transport_fc, hv_storvsc and hv_vmbus need to be installed in order
    for /boot to be mounted.

    mkdumprd calls dracut with the --no-hostonly-default-device. Following
    the documentation (man dracut),
        --no-hostonly-default-device
          Do not generate implicit host devices like root, swap, fstab, etc.
          Use "--mount" or "--add-device" to explicitly add devices as needed

    this patch uses "--add-device" to explicitly add the device of /boot.

    Note there is already an attempt to fix it in dracut's 01fips module
    i.e. via the commit 83651776 ("fips: ensure fs module for /boot is
    installed"). Unfortunately it only installs the file system driver e.g.
    xfs.

    Reviewed-by: Philipp Rudo <prudo@redhat.com>
    Signed-off-by: Coiby Xu <coxu@redhat.com>

Signed-off-by: Coiby Xu <coxu@redhat.com>
2023-08-10 17:25:44 +08:00
Lichen Liu
54cf7f8b00 Revert "Revert "Append both nofail and x-systemd.before to kdump mount target""
Resolves: bz2219378
Upstream: RHEL-ONLY
Conflict: None

The commit 68d02c2a casused a regression that mount sysroot will fail in
the kdump kernel. Since that commit only fixed a print issue, revert it.

This issue is related to a systemd bug which has been fixed by this PR:
https://github.com/systemd/systemd/pull/23893, before these patches are
backported to RHEL-8, we should keep the nofail and x-systemd.before
options.

Fixes: 68d02c2a
(Revert "Append both nofail and x-systemd.before to kdump mount target")

Signed-off-by: Lichen Liu <lichliu@redhat.com>
2023-07-12 11:16:35 +08:00
Coiby Xu
e67e4bd3b3 Reduce kdump memory consumption by only installing needed NIC drivers
Resolves: bz1958587
Upstream: Fedora
Conflict: 1. RHEL8's mkdumprd has different dracut_args from upstream's.
          2. RHEL8's kdump_install_net is different from upstream's and
             we should install needed NIC drivers in the end.

commit a65dde2d10
Author: Coiby Xu <coxu@redhat.com>
Date:   Thu May 19 11:39:25 2022 +0800

    Reduce kdump memory consumption by only installing needed NIC drivers

    Even after having asked NM to stop managing a unneeded NIC, a NIC driver
    may still waste memory. For example, mlx5_core uses a substantial amount
    of memory during driver initialization,

    ======== Report format module_summary: ========
    Module mlx5_core using 350.2MB (89650 pages), peak allocation 367.4MB (94056 pages)
    Module squashfs using 13.1MB (3360 pages), peak allocation 13.1MB (3360 pages)
    Module overlay using 2.1MB (550 pages), peak allocation 2.2MB (555 pages)
    Module dns_resolver using 0.9MB (219 pages), peak allocation 5.2MB (1338 pages)
    Module mlxfw using 0.7MB (172 pages), peak allocation 5.3MB (1349 pages)
    ======== Report format module_summary END ========

    ======== Report format module_top: ========
    Top stack usage of module mlx5_core:
      (null) Pages: 89650 (peak: 94056)
        ret_from_fork (0xffffda088b4165f8) Pages: 60007 (peak: 60007)
          kthread (0xffffda088b4bd7e4) Pages: 60007 (peak: 60007)
            worker_thread (0xffffda088b4b48d0) Pages: 60007 (peak: 60007)
              process_one_work (0xffffda088b4b3f40) Pages: 60007 (peak: 60007)
                work_for_cpu_fn (0xffffda088b4aef00) Pages: 53906 (peak: 53906)
                  local_pci_probe (0xffffda088b9e1e44) Pages: 53906 (peak: 53906)
                    probe_one mlx5_core (0xffffda084f899cc8) Pages: 53518 (peak: 53518)
                      mlx5_init_one mlx5_core (0xffffda084f8994ac) Pages: 49756 (peak: 49756)
                        mlx5_function_setup.constprop.0 mlx5_core (0xffffda084f899100) Pages: 44434 (eak: 44434)
                          mlx5_satisfy_startup_pages mlx5_core (0xffffda084f8a4f24) Pages: 44434 (peak: 44434)
                        mlx5_function_setup.constprop.0 mlx5_core (0xffffda084f899078) Pages: 5285 (peak: 5285)
                          mlx5_cmd_init mlx5_core (0xffffda084f89e414) Pages: 4818 (peak: 4818)
                            mlx5_alloc_cmd_msg mlx5_core (0xffffda084f89aaa0) Pages: 4403 (peak: 4403)

    This memory consumption is completely unnecessary when kdump doesn't need
    this NIC. Only install needed NIC drivers to prevent this kind of waste.

    Note
    1. this patch depends on [1] to ask dracut to not install NIC drivers.
    2. "ethtool -i" somehow fails to get the vlan driver
    3. team.ko doesn't depend on the team mode drivers so we need to install
       the team mode drivers manually.

    [1] https://github.com/dracutdevs/dracut/pull/1789

    Signed-off-by: Coiby Xu <coxu@redhat.com>
    Reviewed-by: Thomas Haller <thaller@redhat.com>
    Reviewed-by: Philipp Rudo <prudo@redhat.com>

Signed-off-by: Coiby Xu <coxu@redhat.com>
2023-06-14 17:14:50 +08:00
Lichen Liu
68d02c2a53 Revert "Append both nofail and x-systemd.before to kdump mount target"
Resolves: bz2164929
Upstream: Fedora
Conflict: Missing upstream commit
94a7b4("Always drop nofail or nobootwait options")

commit 0843c70672
Author: Kairui Song <kasong@redhat.com>
Date:   Wed Jan 13 17:12:18 2021 +0800

    Revert "Append both nofail and x-systemd.before to kdump mount target"

    That commit is trying to workaround a kernel VFS bug. Now,
    the VFS issue should have been fixed in all recent releases, so
    remove this workaround.

    This reverts commit 539bff4083.

    Signed-off-by: Kairui Song <kasong@redhat.com>
    Acked-by: Pingfan Liu <piliu@redhat.com>

Signed-off-by: Lichen Liu <lichliu@redhat.com>
2023-06-09 10:36:07 +08:00
CentOS Sources
ce91099be0 Auto sync2gitlab import of kexec-tools-2.0.25-2.el8.src.rpm 2022-10-23 06:11:17 +00:00
James Antill
b6940b3cfc Auto sync2gitlab import of kexec-tools-2.0.24-1.el8.src.rpm 2022-05-31 14:44:30 -04:00
James Antill
d28435b620 Auto sync2gitlab import of kexec-tools-2.0.20-68.el8.src.rpm 2022-05-26 10:04:08 -04:00