[readonly/geninitrd: 546/1068] - fix flow

draenog draenog at pld-linux.org
Sat Nov 2 19:58:18 CET 2013


commit e211ded9b7bdb12265bb3ddaffbba6d76b5b0d9a
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Sat Jan 19 19:48:29 2008 +0000

    - fix flow
    
    svn-id: @9185

 functions | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/functions b/functions
index 14ccefc..55a0ef8 100644
--- a/functions
+++ b/functions
@@ -91,6 +91,12 @@ find_root() {
 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 @@ dm_lvm2_name() {
 	;;
 	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?
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/readonly/geninitrd.git/commitdiff/147754ca159d40ca5eb541074dc043d8cbd92090



More information about the pld-cvs-commit mailing list