From 32692de010a6c74e8922403c50c0ada0170a2c7b Mon Sep 17 00:00:00 2001 From: "Guilherme G. Piccoli" Date: Mon, 9 Jan 2023 20:04:54 -0300 Subject: [PATCH] initramfs: Guard against non-existing block device during kdump Being extra cautious to prevent hangs. Signed-off-by: Guilherme G. Piccoli --- initramfs/kdump-collect.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/initramfs/kdump-collect.sh b/initramfs/kdump-collect.sh index dfaf0a6..8e45fdc 100644 --- a/initramfs/kdump-collect.sh +++ b/initramfs/kdump-collect.sh @@ -35,6 +35,11 @@ BASE_FOLDER="$(cat /usr/lib/kdump/kdump.dir)" KDUMP_FOLDER="/kdump_path/${BASE_FOLDER}/crash/${KDUMP_TIMESTAMP}" + # Check if the device node exists - or else, just bails-out. + if [ ! -e "${MOUNT_POINT}" ]; then + reboot -f + fi + mkdir -p "/kdump_path" if ! mount "${MOUNT_POINT}" /kdump_path; then reboot -f