All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add option to bring up a device in initramfs
@ 2012-08-09  3:08 Dave Young
       [not found] ` <20120809030848.GA10460-je1gSBvt1Td3da3rpXeqgR/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Young @ 2012-08-09  3:08 UTC (permalink / raw)
  To: vgoyal-H+wXaHxf7aLQT0dZR+AlfA, chaowang-H+wXaHxf7aLQT0dZR+AlfA,
	harald-H+wXaHxf7aLQT0dZR+AlfA, initramfs-u79uwXL29TY76Z2rM5mHXA


Kdump support dump to raw device which could be on top of complex storage
such as multipath and iscsi which are standalone dracut modules.

Add a --device option to dracut which will add the device to host_devs so
dracut can add the dependent modules automaticlly and enable them in initramfs.

Signed-off-by: Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Tested-by: Chao Wang <chaowang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 dracut.8.asc |    3 +++
 dracut.sh    |    3 +++
 2 files changed, 6 insertions(+)

--- dracut.orig/dracut.sh
+++ dracut/dracut.sh
@@ -133,6 +133,7 @@ Creates initial ramdisk images for prelo
   --mount "[DEV] [MP] [FSTYPE] [FSOPTS]"
                         Mount device [DEV] on mountpoint [MP] with filesystem
                         [FSTYPE] and options [FSOPTS] in the initramfs
+  --device "[DEV]"      Bring up [DEV] in initramfs
   -i, --include [SOURCE] [TARGET]
                         Include the files in the SOURCE directory into the
                          Target directory in the final initramfs.
@@ -261,6 +262,7 @@ TEMP=$(unset POSIXLY_CORRECT; getopt \
     --long fscks: \
     --long add-fstab: \
     --long mount: \
+    --long device: \
     --long nofscks: \
     --long ro-mnt \
     --long kmoddir: \
@@ -327,6 +329,7 @@ while :; do
         --fscks)       push fscks_l              "$2"; shift;;
         --add-fstab)   push add_fstab_l          "$2"; shift;;
         --mount)       push fstab_lines          "$2"; shift;;
+        --device)      push host_devs            "$2"; shift;;
         --nofscks)     nofscks_l="yes";;
         --ro-mnt)      ro_mnt_l="yes";;
         -k|--kmoddir)  drivers_dir_l="$2"; shift;;
--- dracut.orig/dracut.8.asc
+++ dracut/dracut.8.asc
@@ -321,6 +321,9 @@ provide a valid _/etc/fstab_.
     Mount _<device>_ on _<mountpoint>_ with _<filesystem type>_ and _<filesystem
     options>_ in the initramfs
 
+**--device** _<device>_ ::
+    Bring up _<device>_ in initramfs
+
 **-i, --include** _<SOURCE>_ _<TARGET>_::
     include the files in the SOURCE directory into the
     TARGET directory in the final initramfs. If SOURCE is a file, it will be

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

* Re: [PATCH] Add option to bring up a device in initramfs
       [not found] ` <20120809030848.GA10460-je1gSBvt1Td3da3rpXeqgR/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
@ 2012-08-13 15:10   ` Vivek Goyal
       [not found]     ` <20120813151029.GE24876-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Vivek Goyal @ 2012-08-13 15:10 UTC (permalink / raw)
  To: Dave Young
  Cc: chaowang-H+wXaHxf7aLQT0dZR+AlfA, harald-H+wXaHxf7aLQT0dZR+AlfA,
	initramfs-u79uwXL29TY76Z2rM5mHXA

On Thu, Aug 09, 2012 at 11:08:48AM +0800, Dave Young wrote:
> 
> Kdump support dump to raw device which could be on top of complex storage
> such as multipath and iscsi which are standalone dracut modules.
> 
> Add a --device option to dracut which will add the device to host_devs so
> dracut can add the dependent modules automaticlly and enable them in initramfs.
> 

You have not specified any format for --device argument? What do you expect
there? Device name, UUID, udev persistent link, or what?

Secondly, do we need some extra code to make sure somebody waits for
this device to come up? Who makes sure that initqueue does not exit
till this device node comes up.

Thanks
Vivek

> Signed-off-by: Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> Tested-by: Chao Wang <chaowang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
>  dracut.8.asc |    3 +++
>  dracut.sh    |    3 +++
>  2 files changed, 6 insertions(+)
> 
> --- dracut.orig/dracut.sh
> +++ dracut/dracut.sh
> @@ -133,6 +133,7 @@ Creates initial ramdisk images for prelo
>    --mount "[DEV] [MP] [FSTYPE] [FSOPTS]"
>                          Mount device [DEV] on mountpoint [MP] with filesystem
>                          [FSTYPE] and options [FSOPTS] in the initramfs
> +  --device "[DEV]"      Bring up [DEV] in initramfs
>    -i, --include [SOURCE] [TARGET]
>                          Include the files in the SOURCE directory into the
>                           Target directory in the final initramfs.
> @@ -261,6 +262,7 @@ TEMP=$(unset POSIXLY_CORRECT; getopt \
>      --long fscks: \
>      --long add-fstab: \
>      --long mount: \
> +    --long device: \
>      --long nofscks: \
>      --long ro-mnt \
>      --long kmoddir: \
> @@ -327,6 +329,7 @@ while :; do
>          --fscks)       push fscks_l              "$2"; shift;;
>          --add-fstab)   push add_fstab_l          "$2"; shift;;
>          --mount)       push fstab_lines          "$2"; shift;;
> +        --device)      push host_devs            "$2"; shift;;
>          --nofscks)     nofscks_l="yes";;
>          --ro-mnt)      ro_mnt_l="yes";;
>          -k|--kmoddir)  drivers_dir_l="$2"; shift;;
> --- dracut.orig/dracut.8.asc
> +++ dracut/dracut.8.asc
> @@ -321,6 +321,9 @@ provide a valid _/etc/fstab_.
>      Mount _<device>_ on _<mountpoint>_ with _<filesystem type>_ and _<filesystem
>      options>_ in the initramfs
>  
> +**--device** _<device>_ ::
> +    Bring up _<device>_ in initramfs
> +
>  **-i, --include** _<SOURCE>_ _<TARGET>_::
>      include the files in the SOURCE directory into the
>      TARGET directory in the final initramfs. If SOURCE is a file, it will be

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

* Re: [PATCH] Add option to bring up a device in initramfs
       [not found]     ` <20120813151029.GE24876-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2012-08-14  6:27       ` Dave Young
       [not found]         ` <5029EFCF.4060005-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Young @ 2012-08-14  6:27 UTC (permalink / raw)
  To: Vivek Goyal
  Cc: chaowang-H+wXaHxf7aLQT0dZR+AlfA, harald-H+wXaHxf7aLQT0dZR+AlfA,
	initramfs-u79uwXL29TY76Z2rM5mHXA

On 08/13/2012 11:10 PM, Vivek Goyal wrote:

> On Thu, Aug 09, 2012 at 11:08:48AM +0800, Dave Young wrote:
>>
>> Kdump support dump to raw device which could be on top of complex storage
>> such as multipath and iscsi which are standalone dracut modules.
>>
>> Add a --device option to dracut which will add the device to host_devs so
>> dracut can add the dependent modules automaticlly and enable them in initramfs.
>>
> 
> You have not specified any format for --device argument? What do you expect
> there? Device name, UUID, udev persistent link, or what?


It's a device name, should metion it in doc as well.

> 
> Secondly, do we need some extra code to make sure somebody waits for
> this device to come up? Who makes sure that initqueue does not exit
> till this device node comes up.


I see there's a wait-mount-dev.sh in 95fstab-sys module which is for
waiting for the mount needed dev.

Currently dracut maintains host_devs and host_fs_types, host_fs_types
are mainly used inst the fs kernel modules. Other than the filesystem
modules we should use host_devs instead, ie. introduce
for_each_host_devs for modules such as multipath and iscsi using.

Another issue is waiting for host_devs should be handled in generic code
instead of 95fstab-sys.

This patch need an update to address these issues IMHO.

> 
> Thanks
> Vivek
> 
>> Signed-off-by: Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
>> Tested-by: Chao Wang <chaowang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
>> ---
>>  dracut.8.asc |    3 +++
>>  dracut.sh    |    3 +++
>>  2 files changed, 6 insertions(+)
>>
>> --- dracut.orig/dracut.sh
>> +++ dracut/dracut.sh
>> @@ -133,6 +133,7 @@ Creates initial ramdisk images for prelo
>>    --mount "[DEV] [MP] [FSTYPE] [FSOPTS]"
>>                          Mount device [DEV] on mountpoint [MP] with filesystem
>>                          [FSTYPE] and options [FSOPTS] in the initramfs
>> +  --device "[DEV]"      Bring up [DEV] in initramfs
>>    -i, --include [SOURCE] [TARGET]
>>                          Include the files in the SOURCE directory into the
>>                           Target directory in the final initramfs.
>> @@ -261,6 +262,7 @@ TEMP=$(unset POSIXLY_CORRECT; getopt \
>>      --long fscks: \
>>      --long add-fstab: \
>>      --long mount: \
>> +    --long device: \
>>      --long nofscks: \
>>      --long ro-mnt \
>>      --long kmoddir: \
>> @@ -327,6 +329,7 @@ while :; do
>>          --fscks)       push fscks_l              "$2"; shift;;
>>          --add-fstab)   push add_fstab_l          "$2"; shift;;
>>          --mount)       push fstab_lines          "$2"; shift;;
>> +        --device)      push host_devs            "$2"; shift;;
>>          --nofscks)     nofscks_l="yes";;
>>          --ro-mnt)      ro_mnt_l="yes";;
>>          -k|--kmoddir)  drivers_dir_l="$2"; shift;;
>> --- dracut.orig/dracut.8.asc
>> +++ dracut/dracut.8.asc
>> @@ -321,6 +321,9 @@ provide a valid _/etc/fstab_.
>>      Mount _<device>_ on _<mountpoint>_ with _<filesystem type>_ and _<filesystem
>>      options>_ in the initramfs
>>  
>> +**--device** _<device>_ ::
>> +    Bring up _<device>_ in initramfs
>> +
>>  **-i, --include** _<SOURCE>_ _<TARGET>_::
>>      include the files in the SOURCE directory into the
>>      TARGET directory in the final initramfs. If SOURCE is a file, it will be



-- 
Thanks
Dave

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

* Re: [PATCH] Add option to bring up a device in initramfs
       [not found]         ` <5029EFCF.4060005-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2012-08-14 19:36           ` Vivek Goyal
  0 siblings, 0 replies; 4+ messages in thread
From: Vivek Goyal @ 2012-08-14 19:36 UTC (permalink / raw)
  To: Dave Young
  Cc: chaowang-H+wXaHxf7aLQT0dZR+AlfA, harald-H+wXaHxf7aLQT0dZR+AlfA,
	initramfs-u79uwXL29TY76Z2rM5mHXA

On Tue, Aug 14, 2012 at 02:27:27PM +0800, Dave Young wrote:
> On 08/13/2012 11:10 PM, Vivek Goyal wrote:
> 
> > On Thu, Aug 09, 2012 at 11:08:48AM +0800, Dave Young wrote:
> >>
> >> Kdump support dump to raw device which could be on top of complex storage
> >> such as multipath and iscsi which are standalone dracut modules.
> >>
> >> Add a --device option to dracut which will add the device to host_devs so
> >> dracut can add the dependent modules automaticlly and enable them in initramfs.
> >>
> > 
> > You have not specified any format for --device argument? What do you expect
> > there? Device name, UUID, udev persistent link, or what?
> 
> 
> It's a device name, should metion it in doc as well.
> 
> > 
> > Secondly, do we need some extra code to make sure somebody waits for
> > this device to come up? Who makes sure that initqueue does not exit
> > till this device node comes up.
> 
> 
> I see there's a wait-mount-dev.sh in 95fstab-sys module which is for
> waiting for the mount needed dev.
> 
> Currently dracut maintains host_devs and host_fs_types, host_fs_types
> are mainly used inst the fs kernel modules. Other than the filesystem
> modules we should use host_devs instead, ie. introduce
> for_each_host_devs for modules such as multipath and iscsi using.

I see that iscsi is using for_each_host_dev_fs, which has both device
and filesystem info. Same is the case with multipath.

May be add raw device in host_dev_fs with filesystem type as "raw" and
special case "raw" whoever relies on this info. There might be other
better ways to handle this though.

Thanks
Vivek

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

end of thread, other threads:[~2012-08-14 19:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-09  3:08 [PATCH] Add option to bring up a device in initramfs Dave Young
     [not found] ` <20120809030848.GA10460-je1gSBvt1Td3da3rpXeqgR/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2012-08-13 15:10   ` Vivek Goyal
     [not found]     ` <20120813151029.GE24876-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-08-14  6:27       ` Dave Young
     [not found]         ` <5029EFCF.4060005-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-08-14 19:36           ` Vivek Goyal

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.