All of lore.kernel.org
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: Will Drewry <wad@chromium.org>
Cc: dm-devel@redhat.com, linux-kernel@vger.kernel.org,
	agk@redhat.com, snitzer@redhat.com
Subject: Re: [RFC PATCH v2 2/2] init: boot to device-mapper targets without an  initr*
Date: Mon, 17 May 2010 11:21:51 -0700	[thread overview]
Message-ID: <20100517112151.b1a56a4f.randy.dunlap@oracle.com> (raw)
In-Reply-To: <AANLkTimRJAOO6frxyr3M-cL8UCxYZfU4FN1TBJn3sd4c@mail.gmail.com>

On Mon, 17 May 2010 13:13:48 -0500 Will Drewry wrote:

> On Mon, May 17, 2010 at 11:47 AM, Randy Dunlap <randy.dunlap@oracle.com> wrote:
> > On Fri, 14 May 2010 20:41:41 -0500 Will Drewry wrote:
> >
> >> Add a dm= kernel parameter modeled after the md= parameter from
> >> do_mounts_md.  It allows for device-mapper targets to be configured at
> >> boot time for use early in the boot process (as the root device or
> >> otherwise).
> >
> > dm=<blah>
> > documentation needs to be added to Documentation/kernel-parameters.txt and/or
> > Documentation/md.txt.
> 
> Absolutely -- I've appended a proposed version below which I'll include in the
> next round.  I'm not a lkml veteran, so if it makes sense to resend
> the full patchset
> again with it, I can.  Otherwise, I'll wait for comments on the code too.

OK, thanks for the doc update.  One typo noted below.


> >> The format is dm="name uuid ro,table line 1,table line 2,...".  The
> >> parser expects the comma to be safe to use as a newline substitute but,
> >> otherwise, uses the normal separator of space.  Some attempt has been
> >> made to make it forgiving of additional spaces (using skip_spaces()).
> >
> > This "space in the arg string" has been tested, right?
> 
> Works for me so far.  I've tested this on a user mode linux instance and
> a real x86 machine with the dm-linear target and a custom dm target
> (which I'll be
> mailing to dm-devel@ for feedback later this week).
> 
> > It seems a bit odd to me.  Most kernel parameter strings that I am familiar with
> > use punctuation for separating parameter parts.
> 
> Yup - I agree. My first cut I used commas with an empty ,, delimiter as a new
> line.  Then I ran across this in the source:
> 
> kernel/params.c
> 76 /* You can use " around spaces, but can't escape ". */
> 77 /* Hyphens and underscores equivalent in parameter names. */
> 78 static char *next_arg(char *args, char **param, char **val)
> 
> I will need to cross-check all the known dm targets to make sure that
> they don't expect quoted internal strings.  In my first look, I didn't see any.
> 
> However, I'm perfectly content with either approach so if there's a preference,
> I'll rework it to make it happen.  This approach just maps more cleanly to the
> existing experience of configuring a mapped device.
> 
> thanks!
> will
> 
> 
> documentation: dm= parameter documentation
> 
> Add documentation for early mapped device creation without an initial rd.
> 
> Signed-off-by: Will Drewry <wad@chromium.org>
> ---
>  Documentation/device-mapper/boot.txt |   36 ++++++++++++++++++++++++++++++++++
>  Documentation/kernel-parameters.txt  |    4 +++
>  2 files changed, 40 insertions(+), 0 deletions(-)
>  create mode 100644 Documentation/device-mapper/boot.txt
> 
> diff --git a/Documentation/device-mapper/boot.txt
> b/Documentation/device-mapper/boot.txt
> new file mode 100644
> index 0000000..00fb557
> --- /dev/null
> +++ b/Documentation/device-mapper/boot.txt
> @@ -0,0 +1,36 @@
> +Boot time creation of mapped devices
> +===================================
> +
> +You can boot directly to a dm device using the following kernel command
> +line:
> +
> +dm="<name> <uuid> <ro>,table line 1,...,table line n"
> +
> +name = the name to associated with the device

                      associate

> +	 after boot, udev, if used, will use that name to label
> +	 the device node.
> +uuid = may be 'none' or the UUID desired for the device.
> +ro = may be 0 or 1.  If non-zero, the device and device table will be
> +	marked read-only.
> +
> +Each table line may be as normal when using the dmsetup tool except for
> +two variations:
> +1. Any use of commas will be interpreted as a newline
> +2. Quotation marks cannot be escaped and cannot be used without
> +   terminating the dm= argument.
> +
> +Unless renamed by udev, the device node created will be dm-0 as the
> +first minor number for the device-mapper is used during early creation.
> +
> +Example
> +=======
> +
> +- Booting to a linear array made up of user-mode linux block devices:
> +
> +  dm="lroot none 0, 0 4096 linear 98:16 0, 4096 4096 linear 98:32 0" \
> +  root=/dev/dm-0
> +
> +Will boot to a rw dm-linear target of 8192 sectors split across two
> +block devices identified by their major:minor numbers.  After boot, udev
> +will rename this target to /dev/mapper/lroot (depending on the rules).
> +No uuid was assigned.


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

      reply	other threads:[~2010-05-17 18:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-14  1:39 [RFC PATCH] dm: allow a dm-fs-style device to be shared via dm-ioctl Will Drewry
2010-05-14  3:53 ` Mike Snitzer
2010-05-14 14:32   ` Will Drewry
2010-05-15  1:41   ` [RFC PATCH v2 1/2] " Will Drewry
2010-05-18  2:36     ` [dm-devel] " Kiyoshi Ueda
2010-05-18  3:11       ` Will Drewry
2010-05-18  3:11         ` Will Drewry
2010-05-15  1:41   ` [RFC PATCH v2 2/2] init: boot to device-mapper targets without an initr* Will Drewry
2010-05-17 16:47     ` Randy Dunlap
2010-05-17 18:13       ` Will Drewry
2010-05-17 18:13         ` Will Drewry
2010-05-17 18:21         ` Randy Dunlap [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=20100517112151.b1a56a4f.randy.dunlap@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=snitzer@redhat.com \
    --cc=wad@chromium.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.