SVN: geninitrd/trunk/mod-udev.sh

wiget wiget at pld-linux.org
Sat Dec 3 21:16:33 CET 2011


Author: wiget
Date: Sat Dec  3 21:16:32 2011
New Revision: 12432

Modified:
   geninitrd/trunk/mod-udev.sh
Log:
Use only dmsetup with udev support

Modified: geninitrd/trunk/mod-udev.sh
==============================================================================
--- geninitrd/trunk/mod-udev.sh	(original)
+++ geninitrd/trunk/mod-udev.sh	Sat Dec  3 21:16:32 2011
@@ -53,11 +53,24 @@
 	# initrd dedicated rules
 	inst_rules 01-ignore.rules 59-persistent-storage.rules 61-persistent-storage.rules 11-dm.rules
 
+	local e
 	for e in ata_id cdrom_id collect firmware scsi_id v4l_id; do
 		inst_exec $initrd_dir/udev/$e /lib/udev/$e
 	done
 	inst_exec $initrd_dir/blkid /sbin/blkid
-	inst_exec $initrd_dir/dmsetup /sbin/dmsetup
+
+	local dir dmsetup
+	for dir in $initrd_dir /sbin; do
+		if [ "$($dir/dmsetup udevcookies 2>&1|grep -c 'Command not supported')" -eq 0 ]; then
+			dmsetup=$dir/dmsetup
+			break
+		fi
+	done
+	if [ -z "$dmsetup" ]; then
+		warn "Can't find dmsetup with udev support"
+	else
+		inst_exec $dmsetup /sbin/dmsetup
+	fi
 
 	mount_dev
 	mount_sys


More information about the pld-cvs-commit mailing list