SVN: geninitrd/trunk/functions

glen glen at pld-linux.org
Tue Oct 23 21:39:59 CEST 2007


Author: glen
Date: Tue Oct 23 21:39:59 2007
New Revision: 8844

Modified:
   geninitrd/trunk/functions
Log:
- handle /dev/mapper/* also properly

Modified: geninitrd/trunk/functions
==============================================================================
--- geninitrd/trunk/functions	(original)
+++ geninitrd/trunk/functions	Tue Oct 23 21:39:59 2007
@@ -77,7 +77,16 @@
 # 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
 }


More information about the pld-cvs-commit mailing list