From cd85fe9165623cc83edda36f5107fb4d850211fc Mon Sep 17 00:00:00 2001 From: Lianbo Jiang Date: Thu, 29 Oct 2020 10:21:09 +0800 Subject: [PATCH] Add code comments to help better understanding Let's add some code comments to help better understanding, and no code changes. Signed-off-by: Lianbo Jiang Acked-by: Baoquan He --- dracut-early-kdump.sh | 3 +++ kdumpctl | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/dracut-early-kdump.sh b/dracut-early-kdump.sh index 23bb369..a4e14a4 100755 --- a/dracut-early-kdump.sh +++ b/dracut-early-kdump.sh @@ -53,6 +53,9 @@ early_kdump_load() EARLY_KEXEC_ARGS="$EARLY_KEXEC_ARGS -s" fi + # Here, only output the messages, but do not save these messages + # to a file because the target disk may not be mounted yet, the + # earlykdump is too early. ddebug "earlykdump: $KEXEC ${EARLY_KEXEC_ARGS} $standard_kexec_args \ --command-line=$EARLY_KDUMP_CMDLINE --initrd=$EARLY_KDUMP_INITRD \ $EARLY_KDUMP_KERNEL" diff --git a/kdumpctl b/kdumpctl index e816719..94e4f5a 100755 --- a/kdumpctl +++ b/kdumpctl @@ -719,6 +719,10 @@ load_kdump() ddebug "$KEXEC $KEXEC_ARGS $standard_kexec_args --command-line=$KDUMP_COMMANDLINE --initrd=$TARGET_INITRD $KDUMP_KERNEL" + # The '12' represents an intermediate temporary file descriptor + # to store the standard error file descriptor '2', and later + # restore the error file descriptor with the file descriptor '12' + # and release it. exec 12>&2 exec 2>> $KDUMP_LOG_PATH/kdump.log PS4='+ $(date "+%Y-%m-%d %H:%M:%S") ${BASH_SOURCE}@${LINENO}: '