In second kernel, kdump always prints redundant '/':
kdump: saving to /sysroot//var/crash/127.0.0.1-2020-03-12-21:32:54/
Just trim it.
Signed-off-by: Kairui Song kasong@redhat.com --- kdump-lib-initramfs.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh index 7b314a7..49b12dc 100755 --- a/kdump-lib-initramfs.sh +++ b/kdump-lib-initramfs.sh @@ -125,7 +125,9 @@ dump_fs() # Remove -F in makedumpfile case. We don't want a flat format dump here. [[ $CORE_COLLECTOR = *makedumpfile* ]] && CORE_COLLECTOR=`echo $CORE_COLLECTOR | sed -e "s/-F//g"`
- echo "kdump: saving to $_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/" + local _dump_path=$(echo "$_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/" | tr -s /) + + echo "kdump: saving to $_dump_path"
# Only remount to read-write mode if the dump target is mounted read-only. if [[ "$_op" = "ro"* ]]; then @@ -133,14 +135,14 @@ dump_fs() mount -o remount,rw $_dev $_mp || return 1 fi
- mkdir -p $_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR || return 1 + mkdir -p $_dump_path || return 1
- save_vmcore_dmesg_fs ${DMESG_COLLECTOR} "$_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/" - save_opalcore_fs "$_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/" + save_vmcore_dmesg_fs ${DMESG_COLLECTOR} "$_dump_path" + save_opalcore_fs "$_dump_path"
echo "kdump: saving vmcore" - $CORE_COLLECTOR /proc/vmcore $_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/vmcore-incomplete || return 1 - mv $_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/vmcore-incomplete $_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/vmcore + $CORE_COLLECTOR /proc/vmcore $_dump_path/vmcore-incomplete || return 1 + mv $_dump_path/vmcore-incomplete $_dump_path/vmcore sync
echo "kdump: saving vmcore complete"
On 04/28/20 at 01:16pm, Kairui Song wrote:
In second kernel, kdump always prints redundant '/':
kdump: saving to /sysroot//var/crash/127.0.0.1-2020-03-12-21:32:54/
Just trim it.
Signed-off-by: Kairui Song kasong@redhat.com
kdump-lib-initramfs.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh index 7b314a7..49b12dc 100755 --- a/kdump-lib-initramfs.sh +++ b/kdump-lib-initramfs.sh @@ -125,7 +125,9 @@ dump_fs() # Remove -F in makedumpfile case. We don't want a flat format dump here. [[ $CORE_COLLECTOR = *makedumpfile* ]] && CORE_COLLECTOR=`echo $CORE_COLLECTOR | sed -e "s/-F//g"`
- echo "kdump: saving to $_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/"
local _dump_path=$(echo "$_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/" | tr -s /)
echo "kdump: saving to $_dump_path"
# Only remount to read-write mode if the dump target is mounted read-only. if [[ "$_op" = "ro"* ]]; then
@@ -133,14 +135,14 @@ dump_fs() mount -o remount,rw $_dev $_mp || return 1 fi
- mkdir -p $_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR || return 1
- mkdir -p $_dump_path || return 1
- save_vmcore_dmesg_fs ${DMESG_COLLECTOR} "$_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/"
- save_opalcore_fs "$_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/"
save_vmcore_dmesg_fs ${DMESG_COLLECTOR} "$_dump_path"
save_opalcore_fs "$_dump_path"
echo "kdump: saving vmcore"
- $CORE_COLLECTOR /proc/vmcore $_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/vmcore-incomplete || return 1
- mv $_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/vmcore-incomplete $_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/vmcore
$CORE_COLLECTOR /proc/vmcore $_dump_path/vmcore-incomplete || return 1
mv $_dump_path/vmcore-incomplete $_dump_path/vmcore sync
echo "kdump: saving vmcore complete"
-- 2.25.3 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@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
Acked-by: Dave Young dyoung@redhat.com
Thanks Dave