]> git.pld-linux.org Git - projects/geninitrd.git/commitdiff
- add --with-multipath=DEVPATH support
authorElan Ruusamäe <glen@pld-linux.org>
Wed, 1 Jul 2009 11:47:01 +0000 (11:47 +0000)
committerElan Ruusamäe <glen@pld-linux.org>
Wed, 1 Jul 2009 11:47:01 +0000 (11:47 +0000)
svn-id: @10412

geninitrd
mod-multipath.sh

index 5ed90124e6e8139cfa267ca77d5f76b56e619dbc..15879b857ebc4ab2a63a8c7bcb8e1dad32d1d111 100755 (executable)
--- a/geninitrd
+++ b/geninitrd
@@ -55,7 +55,8 @@ usage() {
        echo "       [--lvmtoolsversion=1|2] [--with-udev] [--without-udev]"
        echo "       [--with-suspend] [--without-suspend]"
        echo "       [--with-tuxonice] [--without-tuxonice]"
-       echo "       [--without-dmraid] [--without-multipath]"
+       echo "       [--without-dmraid]"
+       echo "       [--with-multipath=DEVPATH] [--without-multipath]"
        echo "       [--without-blkid] [--without-luks]"
        echo "       <initrd-image> <kernel-version>"
        echo ""
@@ -471,6 +472,7 @@ find_modules_for_devpath() {
                if find_modules_multipath "$devpath"; then
                        return
                fi
+
                # fallback
        fi
 
@@ -891,7 +893,10 @@ while [ $# -gt 0 ]; do
                USE_DMRAID=no
                ;;
        --without-multipath)
-               USE_MULTPATH=no
+               USE_MULTIPATH=no
+               ;;
+       --with-multipath=*)
+               USE_MULTIPATH=${1#--with-multipath=}
                ;;
        --without-blkid)
                USE_BLKID=no
@@ -1086,6 +1091,12 @@ debug "Using $rootdev as device for rootfs"
 
 find_modules_for_devpath "$rootdev"
 
+# if USE_MULTIPATH is path to device, scan that too
+# this is to bootstrap multipath setup into initrd.
+if ! is_no "$USE_MULTIPATH" && ! is_yes "$USE_MULTIPATH"; then
+       find_modules_multipath $USE_MULTIPATH
+fi
+
 find_module "-$rootFs"
 
 for n in $BASICMODULES; do
index 933b327df7a7fa29d2fcfb4349b4412959593847..d85dcbbf9ba2870ee08224372464b95a0bed09ab 100644 (file)
@@ -24,7 +24,7 @@ is_multipath() {
        local devpath="$1"
 
        # multipath disabled
-       if ! is_yes "$USE_MULTIPATH"; then
+       if is_no "$USE_MULTIPATH"; then
                return 1
        fi
 
@@ -61,7 +61,7 @@ find_modules_multipath() {
        DM_NAME=
        eval $(dm_export "$devpath")
        if [ -z "$DM_NAME" ]; then
-               die "dm_export failed unexpectedly"
+               die "Couldn't extract DM_NAME from $devpath"
        fi
 
        # Partition:
This page took 0.053764 seconds and 4 git commands to generate.