]> git.pld-linux.org Git - projects/geninitrd.git/blobdiff - mod-dmraid.sh
Timeout here is not a good idea. rootfs cannot be mounted and kernel oopses due to...
[projects/geninitrd.git] / mod-dmraid.sh
index 6db1024f881ab46bba771237f07a4f00ebb56773..2663a5b2683c1d62a16c7de3a9d34a8e29a7b892 100644 (file)
@@ -1,15 +1,22 @@
 #!/bin/sh
-#
 # geninitrd mod: dmraid
+USE_DMRAID=${USE_DMRAID:-yes}
 
 # if we should init dmraid at boot
 have_dmraid=no
 
-if [ -x /sbin/dmraid-initrd ]; then
-       USE_DMRAID=yes
-else
-       USE_DMRAID=no
-fi
+# setup geninitrd module
+# @access      public
+setup_mod_dmraid() {
+       dmraid=$(find_tool $initrd_dir/dmraid /sbin/dmraid-initrd)
+       if [ ! -x /sbin/dmraid ] || [ ! -x "$dmraid" ]; then
+               USE_DMRAID=no
+       fi
+
+       if [ "$kernel_version" -lt "002006" ]; then
+               USE_DMRAID=no
+       fi
+}
 
 # return true if dmraid is set on $devpath
 # @param       string $devpath device node to be examined
@@ -59,12 +66,12 @@ find_modules_dmraid() {
 # generate initrd fragment for dmraid
 # @access      public
 initrd_gen_dmraid() {
-       if [ ! -x /sbin/dmraid-initrd ]; then
-               die "/sbin/dmraid-initrd is missing!"
+       if ! is_yes "$have_dmraid"; then
+               return
        fi
 
        inst_d /sbin
-       inst_exec /sbin/dmraid-initrd /sbin/dmraid
+       inst_exec $dmraid /sbin/dmraid
 
        mount_dev
        mount_sys
This page took 0.071197 seconds and 4 git commands to generate.