All of lore.kernel.org
 help / color / mirror / Atom feed
* dracut options for installing files and drivers
@ 2012-05-09  7:35 Dave Young
       [not found] ` <4FAA1E44.2090006-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Dave Young @ 2012-05-09  7:35 UTC (permalink / raw)
  To: Harald Hoyer; +Cc: Vivek Goyal, initramfs-u79uwXL29TY76Z2rM5mHXA

Hi, harald

Dracut options '-I' and '-a' both mean optionally install file/ko

I wonder if dracut intend to do this for some reason. In kdump module
user probably need install extra files or kernel modules to kdump
initrd, we need to bail out if the files do not exist.

If there's no special reason, how about change it to fail by default for
non-exist files? Or need add other options?

-- 
Thanks
Dave

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

* Re: dracut options for installing files and drivers
       [not found] ` <4FAA1E44.2090006-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2012-05-09 12:40   ` Harald Hoyer
       [not found]     ` <4FAA65B7.9040209-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Harald Hoyer @ 2012-05-09 12:40 UTC (permalink / raw)
  To: Dave Young; +Cc: Vivek Goyal, initramfs-u79uwXL29TY76Z2rM5mHXA

Am 09.05.2012 09:35, schrieb Dave Young:
> Hi, harald
> 
> Dracut options '-I' and '-a' both mean optionally install file/ko

this is wrong

$ man dracut

"-a" means

       -a, --add <list of dracut modules>
           add a space-separated list of dracut modules to the default set of
modules. This parameter
           can be specified multiple times.

               Note
               If [LIST] has multiple arguments, then you have to put these in
quotes. For example:

                   # dracut --add "module1 module2"  ...

"-I" means

       -I, --install <file list>
           install the space separated list of files into the initramfs.

               Note
               If [LIST] has multiple arguments, then you have to put these in
quotes. For example:

               +

                   # dracut --install "/bin/foo /sbin/bar"  ...

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

* Re: dracut options for installing files and drivers
       [not found]     ` <4FAA65B7.9040209-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2012-05-10  2:10       ` Dave Young
       [not found]         ` <4FAB2379.2050504-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Dave Young @ 2012-05-10  2:10 UTC (permalink / raw)
  To: Harald Hoyer; +Cc: Vivek Goyal, initramfs-u79uwXL29TY76Z2rM5mHXA

On 05/09/2012 08:40 PM, Harald Hoyer wrote:

> Am 09.05.2012 09:35, schrieb Dave Young:
>> Hi, harald
>>
>> Dracut options '-I' and '-a' both mean optionally install file/ko
> 
> this is wrong
> 
> $ man dracut
> 
> "-a" means
> 
>        -a, --add <list of dracut modules>


modules install happens in modules.d/90kernel-modules/module-setup.sh
but module-setup.sh does not check the return value of instmods, so it
will not fail and exit if no such modules.

Also another problem is there's no check of module install() return status..

>            add a space-separated list of dracut modules to the default set of
> modules. This parameter
>            can be specified multiple times.
> 
>                Note
>                If [LIST] has multiple arguments, then you have to put these in
> quotes. For example:
> 
>                    # dracut --add "module1 module2"  ...
> 
> "-I" means
> 
>        -I, --install <file list>


See below code, dracut_install -o means "optional install", isn't it?
    for item in $install_items; do
        dracut_install -o "$item"
    done


>            install the space separated list of files into the initramfs.
> 
>                Note
>                If [LIST] has multiple arguments, then you have to put these in
> quotes. For example:
> 
>                +
> 
>                    # dracut --install "/bin/foo /sbin/bar"  ...
> --
> 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



-- 
Thanks
Dave

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

* Re: dracut options for installing files and drivers
       [not found]         ` <4FAB2379.2050504-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2012-05-10  8:19           ` Dave Young
  2012-05-14  6:01             ` Cong Wang
  0 siblings, 1 reply; 8+ messages in thread
From: Dave Young @ 2012-05-10  8:19 UTC (permalink / raw)
  To: Harald Hoyer; +Cc: Vivek Goyal, initramfs-u79uwXL29TY76Z2rM5mHXA

On 05/10/2012 10:10 AM, Dave Young wrote:

> On 05/09/2012 08:40 PM, Harald Hoyer wrote:
> 
>> Am 09.05.2012 09:35, schrieb Dave Young:
>>> Hi, harald
>>>
>>> Dracut options '-I' and '-a' both mean optionally install file/ko
>>
>> this is wrong
>>
>> $ man dracut
>>
>> "-a" means
>>
>>        -a, --add <list of dracut modules>
> 
> 
> modules install happens in modules.d/90kernel-modules/module-setup.sh
> but module-setup.sh does not check the return value of instmods, so it
> will not fail and exit if no such modules.


Oops, I actually means --add-drivers instead of -a

> 
> Also another problem is there's no check of module install() return status..
> 
>>            add a space-separated list of dracut modules to the default set of
>> modules. This parameter
>>            can be specified multiple times.
>>
>>                Note
>>                If [LIST] has multiple arguments, then you have to put these in
>> quotes. For example:
>>
>>                    # dracut --add "module1 module2"  ...
>>
>> "-I" means
>>
>>        -I, --install <file list>
> 
> 
> See below code, dracut_install -o means "optional install", isn't it?
>     for item in $install_items; do
>         dracut_install -o "$item"
>     done
> 
> 
>>            install the space separated list of files into the initramfs.
>>
>>                Note
>>                If [LIST] has multiple arguments, then you have to put these in
>> quotes. For example:
>>
>>                +
>>
>>                    # dracut --install "/bin/foo /sbin/bar"  ...
>> --
>> 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
> 
> 
> 



-- 
Thanks
Dave

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

* Re: dracut options for installing files and drivers
  2012-05-10  8:19           ` Dave Young
@ 2012-05-14  6:01             ` Cong Wang
  2012-05-14  6:10               ` Cong Wang
  0 siblings, 1 reply; 8+ messages in thread
From: Cong Wang @ 2012-05-14  6:01 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA

On Thu, 10 May 2012 at 08:19 GMT, Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
> On 05/10/2012 10:10 AM, Dave Young wrote:
>
>> On 05/09/2012 08:40 PM, Harald Hoyer wrote:
>> 
>>> Am 09.05.2012 09:35, schrieb Dave Young:
>>>> Hi, harald
>>>>
>>>> Dracut options '-I' and '-a' both mean optionally install file/ko
>>>
>>> this is wrong
>>>
>>> $ man dracut
>>>
>>> "-a" means
>>>
>>>        -a, --add <list of dracut modules>
>> 
>> 
>> modules install happens in modules.d/90kernel-modules/module-setup.sh
>> but module-setup.sh does not check the return value of instmods, so it
>> will not fail and exit if no such modules.
>
>
> Oops, I actually means --add-drivers instead of -a
>

Yeah...

% sudo dracut --add-drivers "no-such-module" -I "/no/such/file" -f test.img
E: ssh interactive mode need option --ctty!
F: Failed to install /no/such/file
% echo $?
1

Maybe the following untested patch could fix this??

---
diff --git a/modules.d/90kernel-modules/module-setup.sh
b/modules.d/90kernel-modules/module-setup.sh
index 26f4784..838088a 100755
--- a/modules.d/90kernel-modules/module-setup.sh
+++ b/modules.d/90kernel-modules/module-setup.sh
@@ -58,8 +58,18 @@ installkernel() {
         hostonly='' instmods $drivers
      fi
	       
       -    [[ $add_drivers ]] && hostonly='' instmods $add_drivers
       -    [[ $filesystems ]] && hostonly='' instmods $filesystems
       +    if [[ $add_drivers ]]; then
       +        hostonly='' instmods $add_drivers || {
       +            dfatal "Failed to install $add_drivers"
       +            return 1
       +       }
       +    fi
       +    if [[ $filesystems ]]; then
       +        hostonly='' instmods $filesystems || {
       +            dfatal "Failed to install $filesystems"
       +            return 1
       +       }
       +    fi
        
	     # force install of scsi_wait_scan
          hostonly='' instmods scsi_wait_scan
			  

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

* Re: dracut options for installing files and drivers
  2012-05-14  6:01             ` Cong Wang
@ 2012-05-14  6:10               ` Cong Wang
  2012-05-14  9:39                 ` Dave Young
  0 siblings, 1 reply; 8+ messages in thread
From: Cong Wang @ 2012-05-14  6:10 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA

On Mon, 14 May 2012 at 06:01 GMT, Cong Wang <xiyou.wangcong-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On Thu, 10 May 2012 at 08:19 GMT, Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
>> On 05/10/2012 10:10 AM, Dave Young wrote:
>>
>>> On 05/09/2012 08:40 PM, Harald Hoyer wrote:
>>> 
>>>> Am 09.05.2012 09:35, schrieb Dave Young:
>>>>> Hi, harald
>>>>>
>>>>> Dracut options '-I' and '-a' both mean optionally install file/ko
>>>>
>>>> this is wrong
>>>>
>>>> $ man dracut
>>>>
>>>> "-a" means
>>>>
>>>>        -a, --add <list of dracut modules>
>>> 
>>> 
>>> modules install happens in modules.d/90kernel-modules/module-setup.sh
>>> but module-setup.sh does not check the return value of instmods, so it
>>> will not fail and exit if no such modules.
>>
>>
>> Oops, I actually means --add-drivers instead of -a
>>
>
> Yeah...
>
> % sudo dracut --add-drivers "no-such-module" -I "/no/such/file" -f test.img
> E: ssh interactive mode need option --ctty!
> F: Failed to install /no/such/file
> % echo $?
> 1
>
> Maybe the following untested patch could fix this??
>

A better version:

---->

diff --git a/dracut-functions.sh b/dracut-functions.sh
index 8256e02..148dd19 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -1168,11 +1168,17 @@ instmods() {
         local _ret=0 _mod _mpargs
         if (($# == 0)); then  # filenames from stdin
             while read _mod; do
-                inst1mod "${_mod%.ko*}"
+                inst1mod "${_mod%.ko*}" || {
+                    dfatal "Failed to install ${_mod%.ko*}"
+                    return 1
+                }
             done
         fi
         while (($# > 0)); do  # filenames as arguments
-            inst1mod ${1%.ko*}
+            inst1mod ${1%.ko*} || {
+                dfatal "Failed to install ${1%.ko*}"
+                return 1
+            }
             shift
         done
         return $_ret

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

* Re: dracut options for installing files and drivers
  2012-05-14  6:10               ` Cong Wang
@ 2012-05-14  9:39                 ` Dave Young
  2012-05-15  3:00                   ` Cong Wang
  0 siblings, 1 reply; 8+ messages in thread
From: Dave Young @ 2012-05-14  9:39 UTC (permalink / raw)
  To: Cong Wang; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA

On 05/14/2012 02:10 PM, Cong Wang wrote:

>> Yeah...
>>
>> % sudo dracut --add-drivers "no-such-module" -I "/no/such/file" -f test.img
>> E: ssh interactive mode need option --ctty!
>> F: Failed to install /no/such/file
>> % echo $?
>> 1
>>
>> Maybe the following untested patch could fix this??


Hi, what version of dracut did you use? master branch '-I no/such/file'
will not fail... Seems there it is changed to 'dracut -o' in some commit.

Also `./dracut.sh -l --add-drivers "no-such-module" -f test.img` return
0 during my test.

>>
> 
> A better version:
> 
> ---->
> 
> diff --git a/dracut-functions.sh b/dracut-functions.sh
> index 8256e02..148dd19 100755
> --- a/dracut-functions.sh
> +++ b/dracut-functions.sh
> @@ -1168,11 +1168,17 @@ instmods() {
>          local _ret=0 _mod _mpargs
>          if (($# == 0)); then  # filenames from stdin
>              while read _mod; do
> -                inst1mod "${_mod%.ko*}"
> +                inst1mod "${_mod%.ko*}" || {
> +                    dfatal "Failed to install ${_mod%.ko*}"
> +                    return 1
> +                }
>              done
>          fi
>          while (($# > 0)); do  # filenames as arguments
> -            inst1mod ${1%.ko*}
> +            inst1mod ${1%.ko*} || {
> +                dfatal "Failed to install ${1%.ko*}"
> +                return 1
> +            }
>              shift
>          done
>          return $_ret
> 
> --
> 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



-- 
Thanks
Dave

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

* Re: dracut options for installing files and drivers
  2012-05-14  9:39                 ` Dave Young
@ 2012-05-15  3:00                   ` Cong Wang
  0 siblings, 0 replies; 8+ messages in thread
From: Cong Wang @ 2012-05-15  3:00 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA

On Mon, 14 May 2012 at 09:39 GMT, Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
> On 05/14/2012 02:10 PM, Cong Wang wrote:
>
>>> Yeah...
>>>
>>> % sudo dracut --add-drivers "no-such-module" -I "/no/such/file" -f test.img
>>> E: ssh interactive mode need option --ctty!
>>> F: Failed to install /no/such/file
>>> % echo $?
>>> 1
>>>
>>> Maybe the following untested patch could fix this??
>
>
> Hi, what version of dracut did you use? master branch '-I no/such/file'
> will not fail... Seems there it is changed to 'dracut -o' in some commit.
>
> Also `./dracut.sh -l --add-drivers "no-such-module" -f test.img` return
> 0 during my test.
>

Yeah, I used an old version of dracut, the following commit changed
that without a reason:

commit c6c6a08850c7e4ee211696895f7ca3864be85052
Author: Harald Hoyer <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Date:   Tue Feb 7 18:26:30 2012 +0100

    add "install_items" to dracut.conf
    

I will send a patch to fix this too.

Thanks!

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

end of thread, other threads:[~2012-05-15  3:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-09  7:35 dracut options for installing files and drivers Dave Young
     [not found] ` <4FAA1E44.2090006-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-05-09 12:40   ` Harald Hoyer
     [not found]     ` <4FAA65B7.9040209-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-05-10  2:10       ` Dave Young
     [not found]         ` <4FAB2379.2050504-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-05-10  8:19           ` Dave Young
2012-05-14  6:01             ` Cong Wang
2012-05-14  6:10               ` Cong Wang
2012-05-14  9:39                 ` Dave Young
2012-05-15  3:00                   ` Cong Wang

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.