[Dmraid-debian-commits] [SCM] Maintenance of the dmraid package branch, master, updated. debian/1.0.0.rc15-9-1-g1a1b752
Giuseppe Iuculano
giuseppe at iuculano.it
Wed Jul 15 12:49:35 UTC 2009
The following commit has been merged in the master branch:
commit 1a1b752e13238dcb6ab570b5c2567d3aef4090de
Author: Giuseppe Iuculano <giuseppe at iuculano.it>
Date: Wed Jul 15 14:49:08 2009 +0200
debian/dmraid-activate: Use the -Z flag only if root partition is mountd in a dmraid array. (Closes: #533848) (LP: #392510)
diff --git a/debian/dmraid-activate b/debian/dmraid-activate
index dc5cecd..f2d510e 100644
--- a/debian/dmraid-activate
+++ b/debian/dmraid-activate
@@ -67,7 +67,34 @@ activate_array ()
# At this point we have the required number of devs, or the user wants the
# array brought up in degraded mode, except in the case of striped arrays.
- dmraid -i -ay -Z "$1"
+ # We need to know the root device for determining if the -Z flag can be used
+ # (see #533848 and LP: 392510)
+ if [ -z "$ROOT" ]; then
+ for x in $(cat /proc/cmdline); do
+ case $x in
+ root=*)
+ ROOT=${x#root=}
+ ;;
+ esac
+ done
+ case "$ROOT" in
+ LABEL=*)
+ ROOT=$(readlink -f /dev/disk/by-uuid/${ROOT#LABEL=})
+ ;;
+ UUID=*)
+ ROOT=$(readlink -f /dev/disk/by-uuid/${ROOT#UUID=})
+ ;;
+ esac
+ else
+ ROOT=$(readlink -f $ROOT)
+ fi
+
+ if (echo $ROOT | grep -q $1) ; then
+ dmraid -i -ay -Z "$1"
+ else
+ dmraid -i -ay "$1"
+ fi
+
return $Return_Val
}
--
Maintenance of the dmraid package
More information about the Dmraid-debian-commits
mailing list