Hi Coiby,
On Tue, 22 Feb 2022 14:44:51 +0800
Coiby Xu <coxu(a)redhat.com> wrote:
On Fri, Feb 04, 2022 at 06:34:16PM +0100, Philipp Rudo wrote:
>Allow the use of default values defined in kdump-lib-initramfs.sh and
>kdump-lib.sh for global variables by moving their initialization before
>the definition of the variables.
>
>Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
>---
> kdumpctl | 33 +++++++++++++++++----------------
> 1 file changed, 17 insertions(+), 16 deletions(-)
>
>diff --git a/kdumpctl b/kdumpctl
>index 3ccfa97..ed772a0 100755
>--- a/kdumpctl
>+++ b/kdumpctl
>@@ -1,4 +1,20 @@
> #!/bin/bash
>+
>+if [[ -f /etc/sysconfig/kdump ]]; then
>+ . /etc/sysconfig/kdump
>+fi
>+
>+[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
>+. $dracutbasedir/dracut-functions.sh
>+. /lib/kdump/kdump-lib.sh
>+. /lib/kdump/kdump-logger.sh
>+
>+#initiate the kdump logger
>+if ! dlog_init; then
>+ echo "failed to initiate the kdump logger."
>+ exit 1
>+fi
>+
> KEXEC=/sbin/kexec
>
> KDUMP_KERNELVER=""
>@@ -9,7 +25,7 @@ KDUMP_LOG_PATH="/var/log"
> MKDUMPRD="/sbin/mkdumprd -f"
> MKFADUMPRD="/sbin/mkfadumprd"
> DRACUT_MODULES_FILE="/usr/lib/dracut/modules.txt"
>-SAVE_PATH=/var/crash
>+SAVE_PATH=$DEFAULT_PATH
> SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
> INITRD_CHECKSUM_LOCATION="/boot/.fadump_initrd_checksum"
> DUMP_TARGET=""
>@@ -27,21 +43,6 @@ standard_kexec_args="-d -p"
> # Some default values in case /etc/sysconfig/kdump doesn't include
> KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug"
One issue with sourcing /etc/sysconfig/kdump early is configurations like
KDUMP_KERNELVER, KDUMP_COMMANDLINE_REMOVE and etc. could be overwritten.
Maybe we simply move "SAVE_PATH=$DEFAULT_PATH" instead?
you are right. With this patch the values in /etc/sysconfig/kdump get
overwritten again...
I took an other look and I think I will drop this patch. The only two
variables that benefit from this change are SAVE_PATH and
SSH_KEY_LOCATION (after patch 5). But both are dropped in later
patches. So there is no real benefit in keeping this patch. Especially
when it breaks stuff...
Thanks
Philipp
>
>-if [[ -f /etc/sysconfig/kdump ]]; then
>- . /etc/sysconfig/kdump
>-fi
>-
>-[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
>-. $dracutbasedir/dracut-functions.sh
>-. /lib/kdump/kdump-lib.sh
>-. /lib/kdump/kdump-logger.sh
>-
>-#initiate the kdump logger
>-if ! dlog_init; then
>- echo "failed to initiate the kdump logger."
>- exit 1
>-fi
>-
> single_instance_lock()
> {
> local rc timeout=5
>--
>2.34.1
>_______________________________________________
>kexec mailing list -- kexec(a)lists.fedoraproject.org
>To unsubscribe send an email to kexec-leave(a)lists.fedoraproject.org
>Fedora Code of Conduct:
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
>List Guidelines:
https://fedoraproject.org/wiki/Mailing_list_guidelines
>List Archives:
https://lists.fedoraproject.org/archives/list/kexec@lists.fedoraproject.org
>Do not reply to spam on the list, report it:
https://pagure.io/fedora-infrastructure