kdumpctl: filter 'root' kernel parameter when running in live images

Kernels of live images are booted with a kernel parameter which looks
like "root=live:CDLABEL=Fedora-WS-Live-25_A-2". This argument can't be
recognized by dracut during kdump process and will cause failure
of kdump if users didn't set KUDMP_COMMANDLINE in /etc/sysconfig/kdump.
So we should filter out 'root' when we find such a parameter in
/proc/cmdline to make kdump work correctly in live images.

Signed-off-by: Tong Li <tonli@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
This commit is contained in:
Tong Li 2016-10-14 15:54:55 +08:00 committed by Dave Young
parent 7e53e9fe38
commit 892bea7aae

View File

@ -106,6 +106,10 @@ prepare_cmdline()
local cmdline;
if [ -z "$KDUMP_COMMANDLINE" ]; then
cmdline=`cat /proc/cmdline`
# 'root' parameter will cause kdump failure in live images
if [[ ${cmdline} == *"root=live:"* ]]; then
KDUMP_COMMANDLINE_REMOVE="${KDUMP_COMMANDLINE_REMOVE} root"
fi
else
cmdline=${KDUMP_COMMANDLINE}
fi