From 43c26b7312f7678722dedd32ee3c9e4085818b17 Mon Sep 17 00:00:00 2001 From: Kairui Song Date: Thu, 23 May 2019 17:34:05 +0800 Subject: [PATCH] kdumpctl: Check kdump.conf for error when rebuild is called Although "kdumpctl rebuild" is introduced to help user rebuild the initramfs without modifying the kdump.conf, if the kdump.conf is modified and "kdumpctl rebuild" is called, a initramfs with a faulty kdump.conf will be built. Kdump will refuse to load the initramfs when restarted, but kdumpctl reload may load the faulty initramfs. So need to make sure the faulty build won't be generate in the first place. Check for kdump.conf error before building the initramfs to ensure such failure won't happen. Signed-off-by: Kairui Song Acked-by: Dave Young --- kdumpctl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kdumpctl b/kdumpctl index 20afb30..bb61415 100755 --- a/kdumpctl +++ b/kdumpctl @@ -1169,6 +1169,11 @@ stop() } rebuild() { + check_config + if [ $? -ne 0 ]; then + return 1 + fi + setup_initrd if [ $? -ne 0 ]; then return 1