All of lore.kernel.org
 help / color / mirror / Atom feed
* initqueue
@ 2009-07-02 10:11 Harald Hoyer
       [not found] ` <4A4C87DF.10904-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Harald Hoyer @ 2009-07-02 10:11 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA

To move all "big" jobs out of the udev event handling, I introduce the 
"initqueue". This prevents the job from being killed by udev timeouts.

See
http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut;a=commit;h=eab677a2164bccb3990487dc5ef4549b30cb1055

for the patch.

Basically inside a udev event, you don't do

RUN+="/sbin/ifup $env{INTERFACE}"

you now queue this in the initqueue with:

RUN+="/sbin/initqueue /sbin/ifup $env{INTERFACE}"

Inside init all jobs are worked on in serial order by the do_initqueue() function.

Now we have no more side effects due to the parallel nature of udev and still be 
fast, in case udev supports "udevadm settle --exit-if-exists="
--
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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: initqueue
       [not found] ` <4A4C87DF.10904-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2009-07-02 12:39   ` Seewer Philippe
       [not found]     ` <4A4CAA92.9000401-omB+W0Dpw2o@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Seewer Philippe @ 2009-07-02 12:39 UTC (permalink / raw)
  To: Harald Hoyer; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA

Harald Hoyer wrote:
> To move all "big" jobs out of the udev event handling, I introduce the 
> "initqueue". This prevents the job from being killed by udev timeouts.
> 
> See
> http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut;a=commit;h=eab677a2164bccb3990487dc5ef4549b30cb1055 
> 
> 
> for the patch.
> 
> Basically inside a udev event, you don't do
> 
> RUN+="/sbin/ifup $env{INTERFACE}"
> 
> you now queue this in the initqueue with:
> 
> RUN+="/sbin/initqueue /sbin/ifup $env{INTERFACE}"
> 
> Inside init all jobs are worked on in serial order by the do_initqueue() 
> function.
> 
> Now we have no more side effects due to the parallel nature of udev and 
> still be fast, in case udev supports "udevadm settle --exit-if-exists="

Please don't do that. That way we actually loose the benefit of doing as
much in parallel as possible. Instead please consider the patch below.
I've been fiddling with this for a few weeks now. It basically replaces
the current "wait-for-root" loop with a loop that queries the udev-queue
and only exits if either root is available or all udev events have been
processed.

It works, except if a udev event takes longer than the default 180s as is
the case with an unpatches cryptsetup and/or if we do user-interaction
from within udev which we shouldn't do anyway.

Thank you,
Philippe

diff --git a/modules.d/99base/init b/modules.d/99base/init
index 27c4dad..e14dc20 100755
--- a/modules.d/99base/init
+++ b/modules.d/99base/init
@@ -46,6 +46,11 @@ mkdir /dev/shm
 mkdir /dev/pts
 mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts >/dev/null 2>&1
 
+# Set version specific udevadm options
+UDEVVERSION=$(udevadm --version)
+UDEVADMOPTS=""
+[ $UDEVVERSION -ge 143 ] && UDEVADMOPTS="--exit-if-exists=$NEWROOT/proc"
+
 # run scriptlets to parse the command line
 getarg 'rdbreak=cmdline' && emergency_shell
 source_all cmdline
@@ -76,7 +81,7 @@ source_all pre-trigger
 
 # then the rest
 udevadm trigger $udevtriggeropts  >/dev/null 2>&1
-udevadm settle --timeout=30 >/dev/null 2>&1
+udevadm settle --timeout=30 $UDEVADMOPTS >/dev/null 2>&1
 
 # pre-mount happens before we try to mount the root filesystem,
 # and happens once.
@@ -86,18 +91,23 @@ getarg 'rdbreak=mount' && emergency_shell
 
 # mount scripts actually try to mount the root filesystem, and may
 # be sourced any number of times. As soon as one suceeds, no more are sourced.
-i=0
-while :; do
-    [ -d "$NEWROOT/proc" ] && break;
-
+while [ ! -d "$NEWROOT/proc" ] ; do
     for f in /mount/*.sh; do
        [ -x "$f" ] && . "$f";
        [ "$ROOTFS_MOUNTED" ] && break;
     done
 
-    sleep 0.5
-    i=$(($i+1))
-    { flock -s 9 ; [ $i -gt 20 ] && emergency_shell; } 9>/.console_lock
+    # If the queue was empty and mount scripts failed as well, bail out
+    [ -n "$EMPTYQUEUE" ] && break;
+
+    # Give udev events some time before we try anything. If the queue
+    # is empty, give mount-scripts another chance to get the root
+    udevadm settle --timeout 5 $UDEVADMOPTS && EMPTYQUEUE="1"
+done
+
+# udev queue is empty, no root? Let the user figure this out
+while [ ! -d "$NEWROOT/proc" ] ; do
+    { flock -s 9 ; emergency_shell; } 9>/.console_lock
 done
 
 # pre pivot scripts are sourced just before we switch over to the new root.

--
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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: initqueue
       [not found]     ` <4A4CAA92.9000401-omB+W0Dpw2o@public.gmane.org>
@ 2009-07-02 12:51       ` Hannes Reinecke
       [not found]         ` <4A4CAD6F.6080201-l3A5Bk7waGM@public.gmane.org>
  2009-07-02 12:52       ` initqueue Harald Hoyer
  1 sibling, 1 reply; 12+ messages in thread
From: Hannes Reinecke @ 2009-07-02 12:51 UTC (permalink / raw)
  To: Seewer Philippe; +Cc: Harald Hoyer, initramfs-u79uwXL29TY76Z2rM5mHXA

Hi all,

Seewer Philippe wrote:
> Harald Hoyer wrote:
[ .. ]
> 
> Please don't do that. That way we actually loose the benefit of doing as
> much in parallel as possible. Instead please consider the patch below.
> I've been fiddling with this for a few weeks now. It basically replaces
> the current "wait-for-root" loop with a loop that queries the udev-queue
> and only exits if either root is available or all udev events have been
> processed.
> 
D'accord.

> It works, except if a udev event takes longer than the default 180s as is
> the case with an unpatches cryptsetup and/or if we do user-interaction
> from within udev which we shouldn't do anyway.
> 
> Thank you,
> Philippe
> 
> diff --git a/modules.d/99base/init b/modules.d/99base/init
> index 27c4dad..e14dc20 100755
> --- a/modules.d/99base/init
> +++ b/modules.d/99base/init
> @@ -46,6 +46,11 @@ mkdir /dev/shm
> mkdir /dev/pts
> mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts >/dev/null 2>&1
> 
> +# Set version specific udevadm options
> +UDEVVERSION=$(udevadm --version)
> +UDEVADMOPTS=""
> +[ $UDEVVERSION -ge 143 ] && UDEVADMOPTS="--exit-if-exists=$NEWROOT/proc"
> +
> # run scriptlets to parse the command line
> getarg 'rdbreak=cmdline' && emergency_shell
> source_all cmdline
> @@ -76,7 +81,7 @@ source_all pre-trigger
> 
> # then the rest
> udevadm trigger $udevtriggeropts  >/dev/null 2>&1
> -udevadm settle --timeout=30 >/dev/null 2>&1
> +udevadm settle --timeout=30 $UDEVADMOPTS >/dev/null 2>&1
> 
> # pre-mount happens before we try to mount the root filesystem,
> # and happens once.
> @@ -86,18 +91,23 @@ getarg 'rdbreak=mount' && emergency_shell
> 
> # mount scripts actually try to mount the root filesystem, and may
> # be sourced any number of times. As soon as one suceeds, no more are
> sourced.
> -i=0
> -while :; do
> -    [ -d "$NEWROOT/proc" ] && break;
> -
> +while [ ! -d "$NEWROOT/proc" ] ; do
>     for f in /mount/*.sh; do
>        [ -x "$f" ] && . "$f";
>        [ "$ROOTFS_MOUNTED" ] && break;
>     done
> 
> -    sleep 0.5
> -    i=$(($i+1))
> -    { flock -s 9 ; [ $i -gt 20 ] && emergency_shell; } 9>/.console_lock
> +    # If the queue was empty and mount scripts failed as well, bail out
> +    [ -n "$EMPTYQUEUE" ] && break;
> +
> +    # Give udev events some time before we try anything. If the queue
> +    # is empty, give mount-scripts another chance to get the root
> +    udevadm settle --timeout 5 $UDEVADMOPTS && EMPTYQUEUE="1"
> +done
> +
> +# udev queue is empty, no root? Let the user figure this out
> +while [ ! -d "$NEWROOT/proc" ] ; do
> +    { flock -s 9 ; emergency_shell; } 9>/.console_lock
> done
> 
> # pre pivot scripts are sourced just before we switch over to the new root.
> 
Ah, if it were so easy.

This approach work perfectly for any device which does synchronous scanning.

For a device doing asynchronous scan you're out of luck here as the device
might start spitting out udev events at any time, even after the udev
queue is empty.

EG usb or qla2xxx have a habit of doing so. So either you implement
checks for each device (-type) which detects if the device is still
scanning or you indeed just wait until the device appears.

There actually is no problem with the latter, as all the design
goal here is to have _every_ device initialization in the background
/ asynchronously by udev.
So in foreground we indeed just have to wait for the device node
to appear. Even the udev queue check is pointless here; either
we have a device node, in which case we can continue regardless
of how many events are still in the udev queue;
or we don't have one, in which case it quite irrelevant if
udev has still events to process or not.
Think of multipath taking it's time to setup the multipath
environment; it's being notified by udev via a socket, so
udev is done with the event. But the device node is still
not present or not useable as multipath is still setting
up the topology.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare-l3A5Bk7waGM@public.gmane.org			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)
--
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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: initqueue
       [not found]     ` <4A4CAA92.9000401-omB+W0Dpw2o@public.gmane.org>
  2009-07-02 12:51       ` initqueue Hannes Reinecke
@ 2009-07-02 12:52       ` Harald Hoyer
       [not found]         ` <4A4CAD9B.10503-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  1 sibling, 1 reply; 12+ messages in thread
From: Harald Hoyer @ 2009-07-02 12:52 UTC (permalink / raw)
  To: Seewer Philippe; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA

On 07/02/2009 02:39 PM, Seewer Philippe wrote:
> Harald Hoyer wrote:
>> To move all "big" jobs out of the udev event handling, I introduce the
>> "initqueue". This prevents the job from being killed by udev timeouts.
>>
>> See
>> http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut;a=commit;h=eab677a2164bccb3990487dc5ef4549b30cb1055
>>
>>
>> for the patch.
>>
>> Basically inside a udev event, you don't do
>>
>> RUN+="/sbin/ifup $env{INTERFACE}"
>>
>> you now queue this in the initqueue with:
>>
>> RUN+="/sbin/initqueue /sbin/ifup $env{INTERFACE}"
>>
>> Inside init all jobs are worked on in serial order by the
>> do_initqueue() function.
>>
>> Now we have no more side effects due to the parallel nature of udev
>> and still be fast, in case udev supports "udevadm settle
>> --exit-if-exists="
>
> Please don't do that. That way we actually loose the benefit of doing as
> much in parallel as possible. Instead please consider the patch below.
> I've been fiddling with this for a few weeks now. It basically replaces
> the current "wait-for-root" loop with a loop that queries the udev-queue
> and only exits if either root is available or all udev events have been
> processed.
>
> It works, except if a udev event takes longer than the default 180s as is
> the case with an unpatches cryptsetup and/or if we do user-interaction
> from within udev which we shouldn't do anyway.
>
> Thank you,
> Philippe
>

Well, you could remove the initqueue for ifup events, but I would like to keep 
it at least for cryptsetup.

--
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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: initqueue
       [not found]         ` <4A4CAD9B.10503-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2009-07-02 13:08           ` Seewer Philippe
       [not found]             ` <4A4CB136.6000109-omB+W0Dpw2o@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Seewer Philippe @ 2009-07-02 13:08 UTC (permalink / raw)
  To: Harald Hoyer; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA

Harald Hoyer wrote:
> On 07/02/2009 02:39 PM, Seewer Philippe wrote:
>> Harald Hoyer wrote:
>>> To move all "big" jobs out of the udev event handling, I introduce the
>>> "initqueue". This prevents the job from being killed by udev timeouts.
>>>
>>> See
>>> http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut;a=commit;h=eab677a2164bccb3990487dc5ef4549b30cb1055 
>>>
>>>
>>>
>>> for the patch.
>>>
>>> Basically inside a udev event, you don't do
>>>
>>> RUN+="/sbin/ifup $env{INTERFACE}"
>>>
>>> you now queue this in the initqueue with:
>>>
>>> RUN+="/sbin/initqueue /sbin/ifup $env{INTERFACE}"
>>>
>>> Inside init all jobs are worked on in serial order by the
>>> do_initqueue() function.
>>>
>>> Now we have no more side effects due to the parallel nature of udev
>>> and still be fast, in case udev supports "udevadm settle
>>> --exit-if-exists="
>>
>> Please don't do that. That way we actually loose the benefit of doing as
>> much in parallel as possible. Instead please consider the patch below.
>> I've been fiddling with this for a few weeks now. It basically replaces
>> the current "wait-for-root" loop with a loop that queries the udev-queue
>> and only exits if either root is available or all udev events have been
>> processed.
>>
>> It works, except if a udev event takes longer than the default 180s as is
>> the case with an unpatches cryptsetup and/or if we do user-interaction
>> from within udev which we shouldn't do anyway.
>>
>> Thank you,
>> Philippe
>>
> 
> Well, you could remove the initqueue for ifup events, but I would like 
> to keep it at least for cryptsetup.

Why not just put cryptsetup back into mountscripts as I've suggested before?

--
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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: initqueue
       [not found]             ` <4A4CB136.6000109-omB+W0Dpw2o@public.gmane.org>
@ 2009-07-02 13:12               ` Harald Hoyer
       [not found]                 ` <4A4CB241.8080406-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Harald Hoyer @ 2009-07-02 13:12 UTC (permalink / raw)
  To: Seewer Philippe; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA

On 07/02/2009 03:08 PM, Seewer Philippe wrote:
> Harald Hoyer wrote:
>> On 07/02/2009 02:39 PM, Seewer Philippe wrote:
>>> Harald Hoyer wrote:
>>>> To move all "big" jobs out of the udev event handling, I introduce the
>>>> "initqueue". This prevents the job from being killed by udev timeouts.
>>>>
>>>> See
>>>> http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut;a=commit;h=eab677a2164bccb3990487dc5ef4549b30cb1055
>>>>
>>>>
>>>>
>>>> for the patch.
>>>>
>>>> Basically inside a udev event, you don't do
>>>>
>>>> RUN+="/sbin/ifup $env{INTERFACE}"
>>>>
>>>> you now queue this in the initqueue with:
>>>>
>>>> RUN+="/sbin/initqueue /sbin/ifup $env{INTERFACE}"
>>>>
>>>> Inside init all jobs are worked on in serial order by the
>>>> do_initqueue() function.
>>>>
>>>> Now we have no more side effects due to the parallel nature of udev
>>>> and still be fast, in case udev supports "udevadm settle
>>>> --exit-if-exists="
>>>
>>> Please don't do that. That way we actually loose the benefit of doing as
>>> much in parallel as possible. Instead please consider the patch below.
>>> I've been fiddling with this for a few weeks now. It basically replaces
>>> the current "wait-for-root" loop with a loop that queries the udev-queue
>>> and only exits if either root is available or all udev events have been
>>> processed.
>>>
>>> It works, except if a udev event takes longer than the default 180s
>>> as is
>>> the case with an unpatches cryptsetup and/or if we do user-interaction
>>> from within udev which we shouldn't do anyway.
>>>
>>> Thank you,
>>> Philippe
>>>
>>
>> Well, you could remove the initqueue for ifup events, but I would like
>> to keep it at least for cryptsetup.
>
> Why not just put cryptsetup back into mountscripts as I've suggested
> before?
>

Because so much more can be inside the crypto partition, which might need 
further processing.
--
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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: initqueue
       [not found]                 ` <4A4CB241.8080406-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2009-07-02 13:20                   ` Seewer Philippe
       [not found]                     ` <4A4CB434.1010001-omB+W0Dpw2o@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Seewer Philippe @ 2009-07-02 13:20 UTC (permalink / raw)
  To: Harald Hoyer; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA



Harald Hoyer wrote:
> On 07/02/2009 03:08 PM, Seewer Philippe wrote:
>> Harald Hoyer wrote:
>>> On 07/02/2009 02:39 PM, Seewer Philippe wrote:
>>>> Harald Hoyer wrote:
>>>>> To move all "big" jobs out of the udev event handling, I introduce the
>>>>> "initqueue". This prevents the job from being killed by udev timeouts.
>>>>>
>>>>> See
>>>>> http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut;a=commit;h=eab677a2164bccb3990487dc5ef4549b30cb1055 
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> for the patch.
>>>>>
>>>>> Basically inside a udev event, you don't do
>>>>>
>>>>> RUN+="/sbin/ifup $env{INTERFACE}"
>>>>>
>>>>> you now queue this in the initqueue with:
>>>>>
>>>>> RUN+="/sbin/initqueue /sbin/ifup $env{INTERFACE}"
>>>>>
>>>>> Inside init all jobs are worked on in serial order by the
>>>>> do_initqueue() function.
>>>>>
>>>>> Now we have no more side effects due to the parallel nature of udev
>>>>> and still be fast, in case udev supports "udevadm settle
>>>>> --exit-if-exists="
>>>>
>>>> Please don't do that. That way we actually loose the benefit of 
>>>> doing as
>>>> much in parallel as possible. Instead please consider the patch below.
>>>> I've been fiddling with this for a few weeks now. It basically replaces
>>>> the current "wait-for-root" loop with a loop that queries the 
>>>> udev-queue
>>>> and only exits if either root is available or all udev events have been
>>>> processed.
>>>>
>>>> It works, except if a udev event takes longer than the default 180s
>>>> as is
>>>> the case with an unpatches cryptsetup and/or if we do user-interaction
>>>> from within udev which we shouldn't do anyway.
>>>>
>>>> Thank you,
>>>> Philippe
>>>>
>>>
>>> Well, you could remove the initqueue for ifup events, but I would like
>>> to keep it at least for cryptsetup.
>>
>> Why not just put cryptsetup back into mountscripts as I've suggested
>> before?
>>
> 
> Because so much more can be inside the crypto partition, which might 
> need further processing.

That is correct. But if it's in mountscripts, it would fire more
udev-events which are caught again by udevadm settle. I don't see
a problem there.
--
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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: initqueue
       [not found]         ` <4A4CAD6F.6080201-l3A5Bk7waGM@public.gmane.org>
@ 2009-07-02 13:45           ` Seewer Philippe
  0 siblings, 0 replies; 12+ messages in thread
From: Seewer Philippe @ 2009-07-02 13:45 UTC (permalink / raw)
  To: Hannes Reinecke; +Cc: Harald Hoyer, initramfs-u79uwXL29TY76Z2rM5mHXA

Hannes Reinecke wrote:
> Hi all,
> 
> Seewer Philippe wrote:
>> Harald Hoyer wrote:
> [ .. ]
>> Please don't do that. That way we actually loose the benefit of doing as
>> much in parallel as possible. Instead please consider the patch below.
>> I've been fiddling with this for a few weeks now. It basically replaces
>> the current "wait-for-root" loop with a loop that queries the udev-queue
>> and only exits if either root is available or all udev events have been
>> processed.
>>
> D'accord.
> 
[snip]
> Ah, if it were so easy.
> 
> This approach work perfectly for any device which does synchronous scanning.
> 
> For a device doing asynchronous scan you're out of luck here as the device
> might start spitting out udev events at any time, even after the udev
> queue is empty.

Damned. I didn't think about that. Any hints how I could simulate that with kvm/qemu?

> EG usb or qla2xxx have a habit of doing so. So either you implement
> checks for each device (-type) which detects if the device is still
> scanning or you indeed just wait until the device appears.
> 
> There actually is no problem with the latter, as all the design
> goal here is to have _every_ device initialization in the background
> / asynchronously by udev.
> So in foreground we indeed just have to wait for the device node
> to appear. Even the udev queue check is pointless here; either
> we have a device node, in which case we can continue regardless
> of how many events are still in the udev queue;
> or we don't have one, in which case it quite irrelevant if
> udev has still events to process or not.

Just blindly waiting for the node to appear is dangerous. We might not
know which node to wait for or we might not have one at all (like
nfsroot for example). And in cases where the node never appears due to
lack of drivers,hardware,cmdline,... we'd never bail out without a timeout.

Suggestion: What about a solution like this?

while [ ! -d $NEWROOT/proc ] ; do
 while [ ! -d $NEWROOT/proc ] ; do
   #...current code as in my patch 
 done

 if [ ! -d $NEWROOT/proc ] ; do
    # No root around, give devices some time to do things asynchronous
    # and settle
    sleep 5
    # If the queue is still empty, bail
    udevadm settle --timeout 1 && break
 fi
done

Sleeping is not a real solution, as is just simply fiddling with timeouts.
Same goes for counting, that's why I tried to implement the udev-queue
approach after all. But I can't think of any other solution that does
not poll a devicenode.

--
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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: initqueue
       [not found]                     ` <4A4CB434.1010001-omB+W0Dpw2o@public.gmane.org>
@ 2009-07-02 14:10                       ` Harald Hoyer
       [not found]                         ` <4A4CBFEE.2020500-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Harald Hoyer @ 2009-07-02 14:10 UTC (permalink / raw)
  To: Seewer Philippe; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA

On 07/02/2009 03:20 PM, Seewer Philippe wrote:
>>> Why not just put cryptsetup back into mountscripts as I've suggested
>>> before?
>>>
>>
>> Because so much more can be inside the crypto partition, which might
>> need further processing.
>
> That is correct. But if it's in mountscripts, it would fire more
> udev-events which are caught again by udevadm settle. I don't see
> a problem there.

Hmm, we maybe should think of merging pre-mount and mount.
pre-mount makes no sense, if mounting is done inside udev rules.
--
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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: initqueue
       [not found]                         ` <4A4CBFEE.2020500-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2009-07-03  0:04                           ` Victor Lowther
       [not found]                             ` <1246579473.3339.96.camel-76q0VzFBGGr21HsLBtNmTckMGDeJXHgy@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Victor Lowther @ 2009-07-03  0:04 UTC (permalink / raw)
  To: Harald Hoyer; +Cc: Seewer Philippe, initramfs-u79uwXL29TY76Z2rM5mHXA

On Thu, 2009-07-02 at 16:10 +0200, Harald Hoyer wrote:
> On 07/02/2009 03:20 PM, Seewer Philippe wrote:
> >>> Why not just put cryptsetup back into mountscripts as I've suggested
> >>> before?
> >>>
> >>
> >> Because so much more can be inside the crypto partition, which might
> >> need further processing.
> >
> > That is correct. But if it's in mountscripts, it would fire more
> > udev-events which are caught again by udevadm settle. I don't see
> > a problem there.
> 
> Hmm, we maybe should think of merging pre-mount and mount.
> pre-mount makes no sense, if mounting is done inside udev rules.

I would like to chime in again with the longstanding race condition
inherent in having resume from hibernate and root fs mounting as udev
rules.

> --
> 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
-- 
Victor Lowther
RHCE# 805008539634727
LPIC-2# LPI000140019

--
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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: initqueue
       [not found]                             ` <1246579473.3339.96.camel-76q0VzFBGGr21HsLBtNmTckMGDeJXHgy@public.gmane.org>
@ 2009-07-03  8:06                               ` Harald Hoyer
       [not found]                                 ` <4A4DBBF7.8010501-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Harald Hoyer @ 2009-07-03  8:06 UTC (permalink / raw)
  To: Victor Lowther; +Cc: Seewer Philippe, initramfs-u79uwXL29TY76Z2rM5mHXA

On 07/03/2009 02:04 AM, Victor Lowther wrote:
> On Thu, 2009-07-02 at 16:10 +0200, Harald Hoyer wrote:
>> On 07/02/2009 03:20 PM, Seewer Philippe wrote:
>>>>> Why not just put cryptsetup back into mountscripts as I've suggested
>>>>> before?
>>>>>
>>>> Because so much more can be inside the crypto partition, which might
>>>> need further processing.
>>> That is correct. But if it's in mountscripts, it would fire more
>>> udev-events which are caught again by udevadm settle. I don't see
>>> a problem there.
>> Hmm, we maybe should think of merging pre-mount and mount.
>> pre-mount makes no sense, if mounting is done inside udev rules.
>
> I would like to chime in again with the longstanding race condition
> inherent in having resume from hibernate and root fs mounting as udev
> rules.

Right. Maybe we really should not mount from udev rules, and only generate a 
/mount script or set a symlink to /dev/root.
--
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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: initqueue
       [not found]                                 ` <4A4DBBF7.8010501-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2009-07-03  9:10                                   ` Daniel Drake
  0 siblings, 0 replies; 12+ messages in thread
From: Daniel Drake @ 2009-07-03  9:10 UTC (permalink / raw)
  To: Harald Hoyer
  Cc: Victor Lowther, Seewer Philippe, initramfs-u79uwXL29TY76Z2rM5mHXA

On Fri, 2009-07-03 at 10:06 +0200, Harald Hoyer wrote:
> Right. Maybe we really should not mount from udev rules, and only generate a 
> /mount script or set a symlink to /dev/root.

This would also suit OLPC... We have a premount script in our own module
which we would like to have run *before* the root fs is available (for
the purposes of maximum security). Right now the root fs gets mounted by
udev while that premount script is running.

Daniel


--
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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2009-07-03  9:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-02 10:11 initqueue Harald Hoyer
     [not found] ` <4A4C87DF.10904-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-07-02 12:39   ` initqueue Seewer Philippe
     [not found]     ` <4A4CAA92.9000401-omB+W0Dpw2o@public.gmane.org>
2009-07-02 12:51       ` initqueue Hannes Reinecke
     [not found]         ` <4A4CAD6F.6080201-l3A5Bk7waGM@public.gmane.org>
2009-07-02 13:45           ` initqueue Seewer Philippe
2009-07-02 12:52       ` initqueue Harald Hoyer
     [not found]         ` <4A4CAD9B.10503-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-07-02 13:08           ` initqueue Seewer Philippe
     [not found]             ` <4A4CB136.6000109-omB+W0Dpw2o@public.gmane.org>
2009-07-02 13:12               ` initqueue Harald Hoyer
     [not found]                 ` <4A4CB241.8080406-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-07-02 13:20                   ` initqueue Seewer Philippe
     [not found]                     ` <4A4CB434.1010001-omB+W0Dpw2o@public.gmane.org>
2009-07-02 14:10                       ` initqueue Harald Hoyer
     [not found]                         ` <4A4CBFEE.2020500-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-07-03  0:04                           ` initqueue Victor Lowther
     [not found]                             ` <1246579473.3339.96.camel-76q0VzFBGGr21HsLBtNmTckMGDeJXHgy@public.gmane.org>
2009-07-03  8:06                               ` initqueue Harald Hoyer
     [not found]                                 ` <4A4DBBF7.8010501-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-07-03  9:10                                   ` initqueue Daniel Drake

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.