Commit Graph

1 Commits

Author SHA1 Message Date
Philipp Rudo
93b0538210 kdumpctl: Simplify fadump handling in reset_crashkernel
Resolves: RHEL-31422
Resolves: RHEL-42413

commit 574f8f588b5257d410c01de076644d398e1fc9e6
Author: Philipp Rudo <prudo@redhat.com>
Date:   Thu Jun 1 17:04:13 2023 +0200

    kdumpctl: Simplify fadump handling in reset_crashkernel

    When handling fadump there are three cases we need to consider

    1) When running on non-ppc64le systems
       In this case _dump_mode=kdump and _new_fadump='' always. In other
       words we don't need to care updating the fadump parameter on the
       kernel command line. We could always remove it like the code did so
       far. But should we remove it when we never set it? In particular as
       that might overwrite a change explicitly made by the user (for
       whatever reason)

    2) When running on ppc64le and the user provided --fadump option
       In this case _new_fadump and _dump_mode are set accordingly to what
       the user provided. Thus we need to update both the crashkernel (in
       case fadump was turned on/off) and the fadump (in case the fadump
       mode changed) parameters.

    3) When running on ppc64le but the user did not provide --fadump option
       In this case both _new_fadump='' and _dump_mode=''. In this case we
       take over the previously set fadump parameter. Which means that we
       don't need to update the fadump parameter at all. We do need to check
       whether the _new_dump_mode is fadump or kdump though so we use the
       correct (new) default crashkernel value.

    In the three cases only the second one needs to update the fadump
    parameter. Reflect this discussion in code.

    This also fixes a bug that always prints

            kdump: Updated fadump= for kernel=$kernel. Please reboot the
            system for the change to take effect.

    when the crashkernel= parameter is unchanged as well as reboots the
    system, if --reboot is provided. Even for non-ppc architectures.

    Fixes: 140da74 ("rewrite reset_crashkernel to support fadump and to used by RPM scriptlet")
    Signed-off-by: Philipp Rudo <prudo@redhat.com>

Signed-off-by: Philipp Rudo <prudo@redhat.com>
2024-07-09 15:31:23 +02:00