All of lore.kernel.org
 help / color / mirror / Atom feed
From: Seewer Philippe <philippe.seewer-omB+W0Dpw2o@public.gmane.org>
To: Victor Lowther <victor.lowther-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>,
	initramfs <initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: Thoughts on mounting the rootfs from a udev rule
Date: Fri, 20 Mar 2009 10:24:03 +0100	[thread overview]
Message-ID: <49C360B3.9020107@bfh.ch> (raw)
In-Reply-To: <1237540487.5070.54.camel-76q0VzFBGGr21HsLBtNmTckMGDeJXHgy@public.gmane.org>

Victor Lowther wrote:
[snip]
>> Hmm. There is no strict _need_ for a backing device for udev to work
>> properly, we just need an event here.
>> So for the nfsroot case it would be totally sufficient to have an event
>> like 'network is up'. This could then trigger a nfsmount
> 
> In simple cases, maybe.  In the sort of cases Seewer has to deal with,
> it gets a great deal more complicated.

Yes and no. The current implementation is sort of event-based. "Network 
is up, please test" means theres something in the fifo and we can go and 
try. The same could be done via udev, if we could tell it do so 
something. Only problem I see would be synchronizing asynchronous events.

> 
> Driving network configuration from udev is easy and usually the right
> thing to do, but doesn't really help when you don't know beforehand
> which interface will actually be able to talk to the nfs server.

Or even worse, if you receive mount-data through dhcp options. But even 
that could be handled somehow if we had to.

>>> The second is when we are asked to resume from hibernate.  In this case,
>>> we must not attempt to mount the root filesystem (or any other
>>> filesystem, for that matter) until we have either attempted to resume
>>> (and failed) or we have determined that resuming is impossible.  Udev
>>> does not make any guarantees about the order in which devices are
>>> discovered, which leads to all sorts of interesting potential failure
>>> modes when you have either or both of resume handling and rootfs
>>> handling in a udev rule.
>>>
>> Ah, that's ok. In these cases you'll have a 'resume=' argument in
>> the kernel commandline, so you just need to write a rule using an
>> event serializer/capture like 'collect':
>> - Use three arguments to collect, root device, resume device, and
>>   another one signifying 'resume_done'.
>> - Add another rule which triggers resume on the resume device, sets
>>   'resume_done' if resume returns, and triggers the collect rule again.
>> - Then collect will return 1 and start the mount process.
> 
> How does that handle the case where we asked to resume but the resume
> device is not found?

Question: If we know which device to resume from, why not have a 
pre-udev rule specifying _if_ that device shows up try to thaw?

> Will it be easier to maintain than just waiting for all the devices to
> be found and configured before trying to resume or mount anything?

I guess that depends on personal taste (and documentation)

>> No problem there. However, you're still facing the problem that you'd
>> might want to run 'fsck' on the root device. And you might want to
>> know when 'mount' has actually finished, as only then you can execute
>> 'init'. Sadly the 'mount' events are gone from the kernel, otherwise
>> it would've been quite handy here.

Again, is it possible to send events to udev from Userspace?

Regards,
Philippe
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2009-03-20  9:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-19 21:06 Thoughts on mounting the rootfs from a udev rule Victor Lowther
     [not found] ` <1237496785.5070.28.camel-76q0VzFBGGr21HsLBtNmTckMGDeJXHgy@public.gmane.org>
2009-03-20  8:07   ` Harald Hoyer
2009-03-20  8:31   ` Hannes Reinecke
     [not found]     ` <49C3546C.8050505-l3A5Bk7waGM@public.gmane.org>
2009-03-20  9:14       ` Victor Lowther
     [not found]         ` <1237540487.5070.54.camel-76q0VzFBGGr21HsLBtNmTckMGDeJXHgy@public.gmane.org>
2009-03-20  9:24           ` Seewer Philippe [this message]
     [not found]             ` <49C360B3.9020107-omB+W0Dpw2o@public.gmane.org>
2009-03-20  9:51               ` Victor Lowther
2009-03-20 12:30               ` Karel Zak
     [not found]                 ` <20090320123018.GB3363-sHeGUpI7y9L/9pzu0YdTqQ@public.gmane.org>
2009-03-20 13:07                   ` Seewer Philippe
     [not found]                     ` <49C39509.2020205-omB+W0Dpw2o@public.gmane.org>
2009-03-20 13:13                       ` Kay Sievers
     [not found]                         ` <ac3eb2510903200613k6826172cl4766b48edea92228-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-03-20 13:22                           ` Seewer Philippe
     [not found]                             ` <49C3987F.8010804-omB+W0Dpw2o@public.gmane.org>
2009-03-20 13:40                               ` Kay Sievers
     [not found]                                 ` <ac3eb2510903200640w1cfab1d4sbadc3db7b2f11e06-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-03-20 13:47                                   ` Seewer Philippe
     [not found]                                     ` <49C39E8C.50908-omB+W0Dpw2o@public.gmane.org>
2009-03-20 13:54                                       ` Kay Sievers
     [not found]                                         ` <ac3eb2510903200654x9fda56cm504007cb516a7fc4-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-03-20 13:56                                           ` Seewer Philippe
2009-03-20  9:18       ` Seewer Philippe
2009-03-20  9:15   ` Seewer Philippe
     [not found]     ` <49C35EC6.2050405-omB+W0Dpw2o@public.gmane.org>
2009-03-20  9:29       ` Victor Lowther
     [not found]         ` <1237541365.5070.64.camel-76q0VzFBGGr21HsLBtNmTckMGDeJXHgy@public.gmane.org>
2009-03-22 19:46           ` Adam Spragg

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=49C360B3.9020107@bfh.ch \
    --to=philippe.seewer-omb+w0dpw2o@public.gmane.org \
    --cc=hare-l3A5Bk7waGM@public.gmane.org \
    --cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=victor.lowther-Re5JQEeQqe8AvxtiuMwx3w@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 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.