[readonly/geninitrd: 453/1068] - handle /dev/mapper/* also properly

draenog draenog at pld-linux.org
Sat Nov 2 19:50:27 CET 2013


commit edecd1e260c278408cfd1e11f7edf521789c3f52
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Tue Oct 23 19:39:59 2007 +0000

    - handle /dev/mapper/* also properly
    
    svn-id: @8844

 functions | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/functions b/functions
index 6217fb8..1c1dfdf 100644
--- a/functions
+++ b/functions
@@ -77,7 +77,16 @@ find_root() {
 # which they got from blkid program fs was specifed as UUID= in fstab
 dm_lvm2_name() {
 	local node="$1"
-	local dm_minor=${node#/dev/dm-}
+	local dm_minor
+	case $node in
+	/dev/dm-*)
+		dm_minor=${node#/dev/dm-}
+		;;
+	/dev/mapper/*)
+		dm_minor=$(ls -l $node | awk '{print $6}')
+	;;
+	esac
+
 	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}')
 	echo $lvm_path
 }
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list