linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: initramfs: udev, hotplug, klibc and modprobe
Date: Fri, 14 Jan 2005 10:04:25 +0000	[thread overview]
Message-ID: <1105697066.7556.80.camel@localhost.localdomain> (raw)
In-Reply-To: <1105307950.9630.49.camel@juerg-p4.bitron.ch>

On Fri, 2005-01-14 at 10:29 +0100, Hannes Reinecke wrote:
> Kay Sievers wrote:
> > How do we handle the events traveling in before we flush the queue to
> > the real udevd? Timeout?
> > 
> No, we should do it with a staged approach:
> 
> - Fire up udevd
> - send USR1 to udevinitd
> - udevinitd sends magic "Hey, this is udevsend talking to you" message
>    to udevd
> - udevd stops executing events in response to that magic message

If udevd already executes events before we get the initrams events
flushed in, we execute them not in the right order. Is this ok? 
Shouldn't we just queue _all_ events until we got the initramfs ones?

> - set /proc/sys/kernel/hotplug to udevsend
> - udevinitd sends events to udevd
> - any events sent by the 'real' udevsend will be queued
> - once udevinitd has sent all events to udevd, it sends a magic
>    "I'm done with" message to udevd
> - udevd starts processing events.
> 
> This way, we won't lose events plus all events will be executed in-order.

Seems possible at least, to collect all events from the very beginning
on and replay them from real userspace without the need for coldplug or
udevstart. Sounds nice! We can even load-limit from udevd here. :)

> > I think initramfs should use the hotplug multiplexer and call the normal
> > udev binary directly to create the nodes along with initudevd to queue
> > the events.
> > 
> Ah well. The old problem.
> In doing this you have to make sure to copy the _entire_ hotplug 
> subsystem plus all called scripts and programs to initramfs.
> Plus any configuration file used by any of those.
> And you have to make sure that any change in those configuration file is 
> being reflected to the initramfs, too.
> 
> Still looking for proper ways of solving this. In the meantime, I opted 
> for using a minimal hotplug version in initramfs: just set 
> /proc/sys/kernel/hotplug to 'udev' to have all device nodes created and 
> load all required modules by hand.

But we need to collect the events here with initudevd now. initudevd can
execute udev just like the real udevd does today, but keep the queue for
a later flush into the real udevd.
 
> >>A problem coming to my mind right now is that udevd doesn't know
> >>anything about the overmount of the rootfs and AFAIK it can't access the
> >>new/real rootfs without chroot/chdir at the right moment (between
> >>mounting the new rootfs to /root and before mount move /root to /) or am
> >>I mistaken here?
> > 
> > Don't know. :) If needed we can do this along with the transition from
> > "queue only" to "normal" behavior, right?
> > 
> That will be quite hard, as udevd in initramfs is started as a child of 
> (Hmm, child of what indeed. One should check.). When doing the chroot() 
> thing to the real rootfs the new namespace is only available to all 
> children of init(), which the udevd in initramfs is certainly not.
> So the udevd would have to know where the rootfs is mounted and do a 
> chroot() itself.
> Can't say I like this, as the mount point of the rootfs is not really 
> defined and can be just anything.
> So having two distinct processes, one for initramfs and another one for 
> the real thing is IMHO a better idea.

Yeah, sounds reasonable to have two version and replace the initudevd
process.

Thanks,
Kay



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

  parent reply	other threads:[~2005-01-14 10:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-09 21:59 initramfs: udev, hotplug, klibc and modprobe Jürg Billeter
2005-01-09 22:25 ` Juerg Billeter
2005-01-12  2:37 ` Kay Sievers
2005-01-12  5:07 ` Alexander E. Patrakov
2005-01-12  7:58 ` Jürg Billeter
2005-01-12  8:24 ` Jürg Billeter
2005-01-12  9:42 ` Harald Hoyer
2005-01-12  9:59 ` Alexander E. Patrakov
2005-01-13  1:08 ` Kay Sievers
2005-01-13  3:50 ` Alexander E. Patrakov
2005-01-13 12:55 ` Kay Sievers
2005-01-13 14:34 ` Juerg Billeter
2005-01-13 15:21 ` Kay Sievers
2005-01-13 16:16 ` Juerg Billeter
2005-01-14  9:29 ` Hannes Reinecke
2005-01-14 10:04 ` Kay Sievers [this message]
2005-01-14 10:27 ` Hannes Reinecke
2005-01-14 10:36 ` Kay Sievers

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=1105697066.7556.80.camel@localhost.localdomain \
    --to=kay.sievers@vrfy.org \
    --cc=linux-hotplug@vger.kernel.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 NNTP newsgroup(s).