SVN: geninitrd/trunk/functions

glen glen at pld-linux.org
Mon Oct 22 19:24:37 CEST 2007


Author: glen
Date: Mon Oct 22 19:24:37 2007
New Revision: 8837

Modified:
   geninitrd/trunk/functions
Log:
- more consistent lookup of long device-mapper name

Modified: geninitrd/trunk/functions
==============================================================================
--- geninitrd/trunk/functions	(original)
+++ geninitrd/trunk/functions	Mon Oct 22 19:24:37 2007
@@ -102,10 +102,9 @@
 dm_longname() {
 	local node="$1"
 	local ret
+	local dm_major=$(awk '$2 == "device-mapper" {print $1}' /proc/devices)
+	local dm_minor=${node#/dev/dm-}
 
-	ret=$(find /dev -type b | xargs ls -l | LC_ALL=C sort -k5,6 | grep -B1 $node | awk '{print $NF; exit}')
-	if [ -z "$ret" ]; then
-		ret=$node
-	fi
-	echo "$ret"
+	local dm_name=$(devmap_name $dm_major:$dm_minor)
+	echo "/dev/mapper/$dm_name"
 }


More information about the pld-cvs-commit mailing list