SVN: geninitrd/trunk/geninitrd

glen glen at pld-linux.org
Wed Oct 24 21:13:57 CEST 2007


Author: glen
Date: Wed Oct 24 21:13:56 2007
New Revision: 8860

Modified:
   geninitrd/trunk/geninitrd
Log:
- add dm-multipath component devices to lvm2 ignore list

Modified: geninitrd/trunk/geninitrd
==============================================================================
--- geninitrd/trunk/geninitrd	(original)
+++ geninitrd/trunk/geninitrd	Wed Oct 24 21:13:56 2007
@@ -57,8 +57,9 @@
 tmpfs_dev=no
 # is /proc/devices entries already created
 proc_partitions=no
-# dmraid component devices of rootfs is on dmraid
-dmraid_devices=''
+
+# LVM devices that should not be included in vgscan on initrd
+lvm_ignore_devieces=''
 
 # if we should init NFS at boot
 have_nfs=no
@@ -540,6 +541,7 @@
 	local dev phydevs=$(echo "$info" | awk '$2 ~ /^[0-9]+:[0-9]+:[0-9]+:[0-9]+$/{printf("/dev/%s\n", $3)}')
 	for dev in $phydevs; do
 		find_modules_for_device $dev
+		lvm_ignore_devices="$lvm_ignore_devices $dev"
 	done
 
 	local hw hwhandlers=$(echo "$info" | awk '/hwhandler=1/{sub(/.*hwhandler=1 /, ""); sub(/\]$/, ""); print}')
@@ -570,7 +572,7 @@
 	local dev phydevs=$(dmraid -r -cdevpath,raidname | awk -F, -vv="$raidname" '{if ($2 == v) print $1}')
 	for dev in $phydevs; do
 		find_modules_for_device $dev
-		dmraid_devices="$dmraid_devices $dev"
+		lvm_ignore_devices="$lvm_ignore_devices $dev"
 		found=1
 	done
 
@@ -1334,8 +1336,6 @@
 		[ $a = /dev/mapper/control ] && continue
 		kpartx -a $a
 	done
-	rm -f /dev/sd?* # XXX adjust lvm.conf instead. however at initrd creation time
-	sh
 
 	umount /sys
 	umount /proc
@@ -1344,7 +1344,7 @@
 
 initrd_gen_dmraid() {
 	if [ ! -x /sbin/dmraid-initrd ] ; then
-		die "/sbin/dmraid-initrd is missing missing!"
+		die "/sbin/dmraid-initrd is missing!"
 	fi
 
 	# always make /dev on tmpfs
@@ -1527,15 +1527,17 @@
 		if is_yes "$have_dmraid" || is_yes "$have_multipath"; then
 			echo '	types = [ "device-mapper", 254 ]' >> "$MNTIMAGE/etc/lvm.conf"
 		fi
-		if [ "$dmraid_devices" ]; then
-			# ignore /dev/sd* devices that dmraid consists
+		if [ "$lvm_ignore_devices" ]; then
+			# TODO: think of merging with lvm dumpconfig output
 			echo '	filter = [' >> "$MNTIMAGE/etc/lvm.conf"
-			for dev in $dmraid_devices; do
-				debug "dmraid: ignoring $dev from LVM"
+			local dev
+			for dev in $lvm_ignore_devices; do
+				debug "LVM2: ignore device $dev"
 				printf '  "r|^%s.*|",\n' $dev
 			done >> "$MNTIMAGE/etc/lvm.conf"
 			echo ']' >> "$MNTIMAGE/etc/lvm.conf"
 		fi
+		# XXX filter= must be on one line!
 		lvm dumpconfig | awk '/filter=/' >> "$MNTIMAGE/etc/lvm.conf"
 		echo "}" >> "$MNTIMAGE/etc/lvm.conf"
 


More information about the pld-cvs-commit mailing list