All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dracut:fstab-sys: Wait for devices specified using --mount option
@ 2012-05-15 17:23 Vivek Goyal
       [not found] ` <20120515172301.GB24585-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Vivek Goyal @ 2012-05-15 17:23 UTC (permalink / raw)
  To: Harald Hoyer; +Cc: Dave Young, initramfs-u79uwXL29TY76Z2rM5mHXA

dracut allows passing --mount option which mounts the specified devices.
But it does not wait for these devices to show up and mounting will fail
if devices do not show up by the time "mount" was called.

I am writing some patches to support kdump on iscsi target and I noticed
that one of the initqueue script was not called as we found the root
device and broke out of main loop.

There are two possible enancements to this patch.

- Introduce a time limited wait (rd.timeout something along the lines of
  rd.retry). That will allow kdump to try to dump to a backup target if
  primary targets fails to come up.

- Wait for UUID= and LABEL= to show up too. Right now kdump converts
  UUID= and LABEL= to respective devices and passes /dev/* to dracut
  --mount option. So I am not introducing the wait for UUID= or LABEL=
 in this patch.

Signed-off-by: Vivek Goyal <vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 
---
 lib/dracut/modules.d/95fstab-sys/module-setup.sh   |    1 
 lib/dracut/modules.d/95fstab-sys/wait-mount-dev.sh |   22 +++++++++++++++++++++
 2 files changed, 23 insertions(+)

Index: /lib/dracut/modules.d/95fstab-sys/module-setup.sh
===================================================================
--- .orig/lib/dracut/modules.d/95fstab-sys/module-setup.sh	2012-05-15 13:02:06.342000001 -0400
+++ /lib/dracut/modules.d/95fstab-sys/module-setup.sh	2012-05-15 13:02:42.190000002 -0400
@@ -13,4 +13,5 @@ depends() {
 install() {
     [ -f /etc/fstab.sys ] && inst /etc/fstab.sys
     inst_hook pre-pivot 00 "$moddir/mount-sys.sh"
+    inst_hook cmdline 00 "$moddir/wait-mount-dev.sh"
 }
Index: /lib/dracut/modules.d/95fstab-sys/wait-mount-dev.sh
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ /lib/dracut/modules.d/95fstab-sys/wait-mount-dev.sh	2012-05-15 13:03:27.729000315 -0400
@@ -0,0 +1,22 @@
+#!/bin/sh
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
+
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
+type det_fs >/dev/null 2>&1 || . /lib/fs-lib.sh
+
+fstab_wait_dev() {
+    local _dev _mp _fs _opts _dump _pass _rest
+    test -e "$1" || return 1
+    while read _dev _mp _fs _opts _dump _pass _rest; do
+        [ -z "${_dev%%#*}" ] && continue # Skip comment lines
+        case "$_dev" in
+        /dev/?*)
+            wait_for_dev $_dev;;
+        *) ;;
+        esac
+    done < $1
+    return 0
+}
+
+[ -f /etc/fstab ] && fstab_wait_dev /etc/fstab

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

* Re: [PATCH] dracut:fstab-sys: Wait for devices specified using --mount option
       [not found] ` <20120515172301.GB24585-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2012-05-15 17:36   ` Vivek Goyal
       [not found]     ` <20120515173611.GC24585-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Vivek Goyal @ 2012-05-15 17:36 UTC (permalink / raw)
  To: Harald Hoyer; +Cc: Dave Young, initramfs-u79uwXL29TY76Z2rM5mHXA

On Tue, May 15, 2012 at 01:23:01PM -0400, Vivek Goyal wrote:
> dracut allows passing --mount option which mounts the specified devices.
> But it does not wait for these devices to show up and mounting will fail
> if devices do not show up by the time "mount" was called.
> 
> I am writing some patches to support kdump on iscsi target and I noticed
> that one of the initqueue script was not called as we found the root
> device and broke out of main loop.
> 
> There are two possible enancements to this patch.
> 
> - Introduce a time limited wait (rd.timeout something along the lines of
>   rd.retry). That will allow kdump to try to dump to a backup target if
>   primary targets fails to come up.
> 
> - Wait for UUID= and LABEL= to show up too. Right now kdump converts
>   UUID= and LABEL= to respective devices and passes /dev/* to dracut
>   --mount option. So I am not introducing the wait for UUID= or LABEL=
>  in this patch.
>

[Regenerated the patch on top of git repo. Should be easier to apply now]

dracut allows passing --mount option which mounts the specified devices.
But it does not wait for these devices to show up and mounting will fail
if devices do not show up by the time "mount" was called.

I am writing some patches to support kdump on iscsi target and I noticed
that one of the initqueue script was not called as we found the root
device and broke out of main loop.

There are two possible enancements to this patch.

- Introduce a time limited wait (rd.timeout something along the lines of
  rd.retry). That will allow kdump to try to dump to a backup target if
  primary targets fails to come up.

- Wait for UUID= and LABEL= to show up too. Right now kdump converts
  UUID= and LABEL= to respective devices and passes /dev/* to dracut
  --mount option. So I am not introducing the wait for UUID= or LABEL=
 in this patch.

Signed-off-by: Vivek Goyal <vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 modules.d/95fstab-sys/module-setup.sh   |    1 +
 modules.d/95fstab-sys/wait-mount-dev.sh |   22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+), 0 deletions(-)
 create mode 100644 modules.d/95fstab-sys/wait-mount-dev.sh

diff --git a/modules.d/95fstab-sys/module-setup.sh b/modules.d/95fstab-sys/module-setup.sh
index 7589d74..56dd8fc 100755
--- a/modules.d/95fstab-sys/module-setup.sh
+++ b/modules.d/95fstab-sys/module-setup.sh
@@ -13,4 +13,5 @@ depends() {
 install() {
     [ -f /etc/fstab.sys ] && inst /etc/fstab.sys
     inst_hook pre-pivot 00 "$moddir/mount-sys.sh"
+    inst_hook cmdline 00 "$moddir/wait-mount-dev.sh"
 }
diff --git a/modules.d/95fstab-sys/wait-mount-dev.sh b/modules.d/95fstab-sys/wait-mount-dev.sh
new file mode 100644
index 0000000..99fc16c
--- /dev/null
+++ b/modules.d/95fstab-sys/wait-mount-dev.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
+
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
+type det_fs >/dev/null 2>&1 || . /lib/fs-lib.sh
+
+fstab_wait_dev() {
+    local _dev _mp _fs _opts _dump _pass _rest
+    test -e "$1" || return 1
+    while read _dev _mp _fs _opts _dump _pass _rest; do
+        [ -z "${_dev%%#*}" ] && continue # Skip comment lines
+        case "$_dev" in
+        /dev/?*)
+            wait_for_dev $_dev;;
+        *) ;;
+        esac
+    done < $1
+    return 0
+}
+
+[ -f /etc/fstab ] && fstab_wait_dev /etc/fstab
-- 
1.7.7.6

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

* Re: [PATCH] dracut:fstab-sys: Wait for devices specified using --mount option
       [not found]     ` <20120515173611.GC24585-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2012-05-17 13:23       ` Vivek Goyal
       [not found]         ` <20120517132332.GB16297-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Vivek Goyal @ 2012-05-17 13:23 UTC (permalink / raw)
  To: Harald Hoyer; +Cc: Dave Young, initramfs-u79uwXL29TY76Z2rM5mHXA

On Tue, May 15, 2012 at 01:36:11PM -0400, Vivek Goyal wrote:
> [Regenerated the patch on top of git repo. Should be easier to apply now]
> 
> dracut allows passing --mount option which mounts the specified devices.
> But it does not wait for these devices to show up and mounting will fail
> if devices do not show up by the time "mount" was called.
> 
> I am writing some patches to support kdump on iscsi target and I noticed
> that one of the initqueue script was not called as we found the root
> device and broke out of main loop.
> 
> There are two possible enancements to this patch.
> 
> - Introduce a time limited wait (rd.timeout something along the lines of
>   rd.retry). That will allow kdump to try to dump to a backup target if
>   primary targets fails to come up.
> 
> - Wait for UUID= and LABEL= to show up too. Right now kdump converts
>   UUID= and LABEL= to respective devices and passes /dev/* to dracut
>   --mount option. So I am not introducing the wait for UUID= or LABEL=
>  in this patch.
> 
> Signed-off-by: Vivek Goyal <vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Hi Harald,

Any feedback on the patch? Do let me know if you want some changes.

Thanks
Vivek

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

* Re: [PATCH] dracut:fstab-sys: Wait for devices specified using --mount option
       [not found]         ` <20120517132332.GB16297-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2012-05-21  9:12           ` Harald Hoyer
  0 siblings, 0 replies; 4+ messages in thread
From: Harald Hoyer @ 2012-05-21  9:12 UTC (permalink / raw)
  To: Vivek Goyal; +Cc: Dave Young, initramfs-u79uwXL29TY76Z2rM5mHXA

Am 17.05.2012 15:23, schrieb Vivek Goyal:
> On Tue, May 15, 2012 at 01:36:11PM -0400, Vivek Goyal wrote:
>> [Regenerated the patch on top of git repo. Should be easier to apply now]
>>
>> dracut allows passing --mount option which mounts the specified devices.
>> But it does not wait for these devices to show up and mounting will fail
>> if devices do not show up by the time "mount" was called.
>>
>> I am writing some patches to support kdump on iscsi target and I noticed
>> that one of the initqueue script was not called as we found the root
>> device and broke out of main loop.
>>
>> There are two possible enancements to this patch.
>>
>> - Introduce a time limited wait (rd.timeout something along the lines of
>>   rd.retry). That will allow kdump to try to dump to a backup target if
>>   primary targets fails to come up.
>>
>> - Wait for UUID= and LABEL= to show up too. Right now kdump converts
>>   UUID= and LABEL= to respective devices and passes /dev/* to dracut
>>   --mount option. So I am not introducing the wait for UUID= or LABEL=
>>  in this patch.
>>
>> Signed-off-by: Vivek Goyal <vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> 
> Hi Harald,
> 
> Any feedback on the patch? Do let me know if you want some changes.
> 
> Thanks
> Vivek

pushed! Thanks!

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

end of thread, other threads:[~2012-05-21  9:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-15 17:23 [PATCH] dracut:fstab-sys: Wait for devices specified using --mount option Vivek Goyal
     [not found] ` <20120515172301.GB24585-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-05-15 17:36   ` Vivek Goyal
     [not found]     ` <20120515173611.GC24585-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-05-17 13:23       ` Vivek Goyal
     [not found]         ` <20120517132332.GB16297-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-05-21  9:12           ` Harald Hoyer

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.