initramfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Wilck <mwilck-IBi9RG/b67k@public.gmane.org>
To: "Milan P. Gandhi"
	<mgandhi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Subject: Re: [PATCH v3] dracut: Verify multipath config_dir option
Date: Tue, 04 Feb 2020 08:51:19 +0100	[thread overview]
Message-ID: <133bdc2cab95f128d673d22f7aff53dc1cb03dec.camel@suse.com> (raw)
In-Reply-To: <20200204051243.GA7871@machine1>

On Tue, 2020-02-04 at 10:42 +0530, Milan P. Gandhi wrote:
> The 90multipath/module-setup.sh file currently does not check the
> dm-multipath config_dir option. This option in multipath.conf file is
> used to specify a custom directory/path that contains the multipath
> configuration files. It's default value is /etc/multipath/conf.d
> 
> Currently install function of module-setup.sh has hardcoded the above
> path, but users could change it with config_dir option. So, adding
> steps to read the path specified with config_dir option and add
> these configuration files to the initial ram disk image.
> 
> Signed-off-by: Milan P. Gandhi <mgandhi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
> 
> changes v3:
>  - Removed awk/sed usage to get config_dir path
>  - Added a check to verify if path specifed with
>    config_dir is actual directory
>  - Used derror to report invalid config_dir path
> 
>  modules.d/90multipath/module-setup.sh | 16 +++++++++++++++-
>  1 file changed, 15 insertions(+), 1 deletion(-)

Reviewed-by: Martin Wilck <mwilck-IBi9RG/b67k@public.gmane.org>

> 
> diff --git a/modules.d/90multipath/module-setup.sh
> b/modules.d/90multipath/module-setup.sh
> index 48a9d09a..2f6d1f7a 100755
> --- a/modules.d/90multipath/module-setup.sh
> +++ b/modules.d/90multipath/module-setup.sh
> @@ -79,6 +79,20 @@ install() {
>          }
>      }
>  
> +    # Include multipath configuration files from path specified with
> config_dir
> +    while read _k _v; do
> +        if [[ "$_k" = config_dir ]]; then
> +            _v=${_v#\"}
> +            config_dir=${_v%\"}
> +        fi
> +    done < <(/sbin/multipath -t)
> +
> +    if [ -d "$config_dir" ]; then
> +        config_dir+="/*"
> +    else
> +        derror "multipath.conf: config_dir - No such directory
> $config_dir"
> +    fi
> +
>      inst_multiple -o  \
>          dmsetup \
>          kpartx \
> @@ -91,7 +105,7 @@ install() {
>          /etc/xdrdevices.conf \
>          /etc/multipath.conf \
>          /etc/multipath/* \
> -        /etc/multipath/conf.d/*
> +        $config_dir
>  
>      [[ $hostonly ]] && [[ $hostonly_mode = "strict" ]] && {
>          for_each_host_dev_and_slaves_all add_hostonly_mpath_conf



      parent reply	other threads:[~2020-02-04  7:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-04  5:12 [PATCH v3] dracut: Verify multipath config_dir option Milan P. Gandhi
2020-02-04  6:06 ` Dracut GitHub Import Bot
2020-02-04  7:51 ` Martin Wilck [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=133bdc2cab95f128d673d22f7aff53dc1cb03dec.camel@suse.com \
    --to=mwilck-ibi9rg/b67k@public.gmane.org \
    --cc=harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mgandhi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).