From f92eee306a6e36e4cbf010aee46489c39b476025 Mon Sep 17 00:00:00 2001 From: "Guilherme G. Piccoli" Date: Mon, 1 Aug 2022 14:27:47 -0300 Subject: [PATCH] module-setup.sh: Bail-out if makedumpfile is not available If we don't have makedumpfile, it doesn't make sense to construct the kdump initrd and let it be loaded; it's going to fail in the kdump dmesg collection, during a panic event, with no clear traces for users to diagnose the issue. So, let's bail-out if we don't have makedumpfile, forcing the kdump load to fail instead, which is clearly warned in journalctl. Also, change the approach for the kdump.conf file as well, in order to fail creating the initrd if any of the files are missing. While at it, fix a trailing space in the module-setup.sh file. Signed-off-by: Guilherme G. Piccoli --- module-setup.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/module-setup.sh b/module-setup.sh index 3db7536..68a0fae 100644 --- a/module-setup.sh +++ b/module-setup.sh @@ -14,13 +14,20 @@ check() { } installkernel() { - hostonly='' instmods ext4 + hostonly='' instmods ext4 } install() { # Having a valid /usr/share/kdump/kdump.conf is essential for kdump. if [ ! -s "/usr/share/kdump/kdump.conf" ]; then - return 1 + logger "kdump-steamos: failed to create initrd, kdump.conf is missing" + exit 1 + fi + + # Also true for makedumpfile... + if [ ! -x "$(command -v makedumpfile)" ]; then + logger "kdump-steamos: failed to create initrd, makedumpfile is missing" + exit 1 fi . /usr/share/kdump/kdump.conf