initramfs: Guard against non-existing block device during kdump

Being extra cautious to prevent hangs.

Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
This commit is contained in:
Guilherme G. Piccoli
2023-01-09 20:04:54 -03:00
parent b834754cf9
commit 32692de010

View File

@ -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