]> git.pld-linux.org Git - projects/geninitrd.git/blobdiff - mod-multipath.sh
Version 12531.
[projects/geninitrd.git] / mod-multipath.sh
index 65935e8137ffaceac337cb91e5d0cdfb2a583af9..2a6121b9acac8f3462b6451ed5d6cb9b340d5c57 100644 (file)
@@ -1,5 +1,6 @@
 #!/bin/sh
-#
+MULTIPATH_RCSID='$Revision$ $Date::                            $'
+
 # geninitrd mod: dm-multipath
 USE_MULTIPATH=${USE_MULTIPATH:-yes}
 
@@ -104,17 +105,21 @@ find_modules_multipath() {
 # generate initrd fragment
 # @access      public
 initrd_gen_multipath() {
+       if ! is_yes "$have_multipath"; then
+               return
+       fi
+
        inst_d /sbin /lib/udev /etc/multipath
        inst_exec /sbin/kpartx /sbin
        inst_exec /sbin/multipath /sbin
 
        # for udev callouts
-       local scsi_id=$(find_tool /lib/udev/scsi_id /sbin/scsi_id)
+       local scsi_id=$(find_tool /$_lib/udev/scsi_id /lib/udev/scsi_id /sbin/scsi_id)
        inst_exec $scsi_id /lib/udev
 
-       if [ -d /lib/multipath ]; then
-               inst_d /lib/multipath
-               inst_exec /lib/multipath/* /lib/multipath
+       if [ -d /$_lib/multipath ]; then
+               inst_d /$_lib/multipath
+               inst_exec /$_lib/multipath/* /$_lib/multipath
        else
                inst_exec /sbin/mpath* /sbin
        fi
@@ -276,15 +281,15 @@ mp_parse_hwhandler() {
        # size=7.0G features='0' hwhandler='0' wp=rw
        # size=2.0G features='1 queue_if_no_path' hwhandler='1 emc' wp=rw
        echo "$info" | sed -ne "
-        # multipath-tools-0.4.8-0.12.amd64
-        /\[hwhandler=1/{
-            s,^.*\[hwhandler=1 \([^]]*\)\].*$,dm-\1,
-            p
-        }
+               # multipath-tools-0.4.8-0.12.amd64
+               /\[hwhandler=1/{
+                       s,^.*\[hwhandler=1 \([^]]*\)\].*$,dm-\1,
+                       p
+               }
                # multipath-tools-0.4.8-11.x86_64
-        /hwhandler='1/{
-            s,^.*hwhandler='1 \([^']*\)'.*$,scsi-dh-\1,
-            p
-        }
-    " | sort -u
+               /hwhandler='1/{
+                       s,^.*hwhandler='1 \([^']*\)'.*$,scsi-dh-\1,
+                       p
+               }
+       " | sort -u
 }
This page took 0.030738 seconds and 4 git commands to generate.