On 03/31/2017 at 12:52 PM, Pratyush Anand wrote:
On Thursday 30 March 2017 01:40 PM, Xunlei Pang wrote:
> Since the current dracut of Fedora already supports not always
> mounting root device, we can remove "root=X" from the command
> line directly, and always get the dump target specified in
> "/etc/kdump.conf" and mount it. If the dump target is located
> at root filesystem, we will add the root mount info explicitly
> from kdump side instead of from dracut side.
>
> For example, in case of nfs/ssh/usb/raw/etc(non-root) dumping,
> kdump will not mount the unnecessary root fs after this change.
>
> This patch removes "root=X" via the "KDUMP_COMMANDLINE_REMOVE"
> (if "default dump_to_rootfs" is specified, don't remove
"root=X"),
> and mounts non-root target under "/kdumproot", the root target
> still under "/sysroot"(to be align with systemd sysroot.mount).
>
> After removing "root=X", we now add root fs mount information
> explicitly from the kdump side.
>
> Changed check_dump_fs_modified() a little to avoid rebuild when
> dump target is root, since we add root fs mount explicitly now.
>
> Signed-off-by: Xunlei Pang <xlpang(a)redhat.com>
> ---
> kdumpctl | 33 ++++++++++++++++++++++++++++-----
> mkdumprd | 29 +++++++++--------------------
> 2 files changed, 37 insertions(+), 25 deletions(-)
>
> diff --git a/kdumpctl b/kdumpctl
> index 01a2ad8..0fb5e7b 100755
> --- a/kdumpctl
> +++ b/kdumpctl
> @@ -171,6 +171,11 @@ check_kdump_cpus()
> echo " try nr_cpus=$nr_min or larger instead"
> }
>
> +is_dump_to_rootfs()
> +{
> + grep "^default[[:space:]]dump_to_rootfs" /etc/kdump.conf
>/dev/null
> +}
> +
> # This function performs a series of edits on the command line.
> # Store the final result in global $KDUMP_COMMANDLINE.
> prepare_cmdline()
> @@ -192,6 +197,19 @@ prepare_cmdline()
> # These params can be removed configurably
> cmdline=`remove_cmdline_param "$cmdline" ${KDUMP_COMMANDLINE_REMOVE}`
>
> + # Always remove "root=X", as we now explicitly generate all kinds
> + # of dump target mount information including root fs. But we keep
> + # it if "default dump_to_rootfs" is specified(non-root dumping).
> + #
> + # We do this before KDUMP_COMMANDLINE_APPEND, if one really care
> + # about it(e.g. for debug purpose), then can pass "root=X" using
> + # KDUMP_COMMANDLINE_APPEND.
> + #
> + # Don't remove "root=X" in case of fadump?
Better to check for != "fadump" then.
Will update, thanks!