SVN: geninitrd/trunk/functions

glen glen at pld-linux.org
Sat Jan 19 20:48:29 CET 2008


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?


More information about the pld-cvs-commit mailing list