kdumpctl: update check_dump_fs_modified() to use "lsinitrd -f"

We use faster "lsinitrd XXX -f usr/lib/dracut/build-parameter.txt"
instead of "lsinitrd XXX | grep "^Arguments:" | head -1", this can
save us around one second.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
Acked-by: Pratyush Anand <panand@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
This commit is contained in:
Xunlei Pang 2017-05-04 14:56:56 +08:00 committed by Dave Young
parent 2a5f362521
commit 88a3385e96

View File

@ -539,7 +539,7 @@ check_dump_fs_modified()
_new_mntpoint="/kdumproot/$(get_mntpoint_from_target $_target)"
fi
_dracut_args=$(lsinitrd $TARGET_INITRD | grep "^Arguments:" | head -1)
_dracut_args=$(lsinitrd $TARGET_INITRD -f usr/lib/dracut/build-parameter.txt)
if [[ -z "$_dracut_args" ]];then
echo "Warning: No dracut arguments found in initrd"
return 0