linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Dave Reisner <d@falconindy.com>
Cc: Dave Reisner <dreisner@archlinux.org>,
	linux-raid@vger.kernel.org, teg@jklm.no
Subject: Re: [PATCH] mdadm: autodetect being run in an initramfs
Date: Fri, 28 Sep 2012 09:18:11 +1000	[thread overview]
Message-ID: <20120928091811.7b7871e6@notabene.brown> (raw)
In-Reply-To: <20120927225302.GY474@rampage>

[-- Attachment #1: Type: text/plain, Size: 1759 bytes --]

On Thu, 27 Sep 2012 18:53:02 -0400 Dave Reisner <d@falconindy.com> wrote:

> On Fri, Sep 28, 2012 at 08:35:18AM +1000, NeilBrown wrote:
> > On Thu, 27 Sep 2012 10:41:03 -0400 Dave Reisner <dreisner@archlinux.org>
> > wrote:
> > 
> > > Key off of the existance of /etc/initrd-release as an indicator that
> > > mdadm is running in early userspace and set the __offroot flag. This
> > > allows the same udev-based assembly rules to be valid both off and on
> > > root and, moreover, will propagate to mdmon, should it need to be
> > > started.
> > > 
> > > Signed-off-by: Dave Reisner <dreisner@archlinux.org>
> > > ---
> > >  mdadm.c | 5 +++++
> > >  1 file changed, 5 insertions(+)
> > > 
> > > diff --git a/mdadm.c b/mdadm.c
> > > index 4c7c5ea..557e00b 100644
> > > --- a/mdadm.c
> > > +++ b/mdadm.c
> > > @@ -1106,6 +1106,11 @@ int main(int argc, char *argv[])
> > >  		exit(0);
> > >  	}
> > >  
> > > +	/* auto-detect being on an initramfs
> > > +	 * http://www.freedesktop.org/wiki/Software/systemd/InitrdInterface */
> > > +	if (access("/etc/initrd-release", F_OK) == 0)
> > > +		__offroot = 1;
> > > +
> > >  	if (!mode && devs_found) {
> > >  		mode = MISC;
> > >  		devmode = 'Q';
> > 
> > What is the problem with adding the --offroot flag to every place in the
> > initrd that starts mdadm?
> 
> The assumption is that mdadm is being called via udev for assembly, so
> we'd need to maintain a separate udev rule explicitly for the initramfs.
> I'd rather not do that.

Then use --offroot for the 'standard' udev rules too.

> 
> > (Actually I'm contemplating making --offroot the default so this might become
> > a non-issue)
> 
> That'd be great!

Your support is noted - thanks :-)

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

      reply	other threads:[~2012-09-27 23:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-27 14:41 [PATCH] mdadm: autodetect being run in an initramfs Dave Reisner
2012-09-27 22:07 ` Dmitrijs Ledkovs
     [not found]   ` <CA+mSPTgDnq8Xi+xCZte1WtORZhnV8S0=FXsm=wM0N1LfLpgtfQ@mail.gmail.com>
2012-09-27 22:29     ` Dmitrijs Ledkovs
2012-09-27 22:50       ` Dave Reisner
2012-09-27 22:35 ` NeilBrown
2012-09-27 22:53   ` Dave Reisner
2012-09-27 23:18     ` NeilBrown [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=20120928091811.7b7871e6@notabene.brown \
    --to=neilb@suse.de \
    --cc=d@falconindy.com \
    --cc=dreisner@archlinux.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=teg@jklm.no \
    /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 NNTP newsgroup(s).