Author: glen
Date: Sat Jan 19 20:48:29 2008
New Revision: 9185

Modified:
   geninitrd/trunk/functions
Log:
- fix flow

Modified: geninitrd/trunk/functions
==============================================================================
--- geninitrd/trunk/functions   (original)
+++ geninitrd/trunk/functions   Sat Jan 19 20:48:29 2008
@@ -91,6 +91,12 @@
 dm_lvm2_name() {
        local node="$1"
        local dm_minor
+
+       if [ ! -b "$node" ]; then
+               echo >&2 "dm_lvm2_name: $node is not a block device"
+               return 1
+       fi
+
        case $node in
        /dev/dm-*)
                dm_minor=${node#/dev/dm-}
@@ -100,11 +106,6 @@
        ;;
        esac
 
-       if [ ! -b "$node" ]; then
-               echo >&2 "dm_lvm2_name: $node is not a block device"
-               return 1
-       fi
-
        local lvm_path=$(/sbin/lvdisplay -c 2>/dev/null | awk -F: -vn=$dm_minor 
'{node=$1; major=$12; minor=$13; if (n == minor) print node}' | xargs)
        if [ -z "$lvm_path" ]; then
                # XXX: this could happen also for non-lvm nodes?
_______________________________________________
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to