If it turns out that it's not possible to put symlinks into the initrd
for some reason, another alternative would be to just pack /sbin/lvm,
and to invoke it with the subcommand syntax.  This is less convenient
for a paniced admin than having all the symlinks available, but it's
still a step up from the current situation with only /sbin/vgchange
available.

The attached patch (not fully-tested) should implement this proposal.

    --dkg

diff -ruN lvm2-2.02.39.base/debian/initramfs-tools/hooks/lvm2 lvm2-2.02.39/debian/initramfs-tools/hooks/lvm2
--- lvm2-2.02.39.base/debian/initramfs-tools/hooks/lvm2	2008-10-27 10:33:39.000000000 -0400
+++ lvm2-2.02.39/debian/initramfs-tools/hooks/lvm2	2008-10-27 11:45:18.000000000 -0400
@@ -14,13 +14,13 @@
 	;;
 esac
 
-if [ ! -x /sbin/vgchange ]; then
+if [ ! -x /sbin/lvm ]; then
 	exit 0
 fi
 
 . /usr/share/initramfs-tools/hook-functions
 
-copy_exec /sbin/vgchange /sbin
+copy_exec /sbin/lvm /sbin
 
 for x in dm_mod dm_snapshot dm_mirror; do
 	manual_add_modules ${x}
diff -ruN lvm2-2.02.39.base/debian/initramfs-tools/scripts/local-top/lvm2 lvm2-2.02.39/debian/initramfs-tools/scripts/local-top/lvm2
--- lvm2-2.02.39.base/debian/initramfs-tools/scripts/local-top/lvm2	2008-10-27 10:33:39.000000000 -0400
+++ lvm2-2.02.39/debian/initramfs-tools/scripts/local-top/lvm2	2008-10-27 11:45:46.000000000 -0400
@@ -27,12 +27,12 @@
 	# Take care of lilo boot arg, risky activating of all vg
 	case $vg in
 	fe[0-9]*)
-		vgchange -ay
+		lvm vgchange -ay
 		exit 0
 		;;
 	# FIXME: check major
 	/dev/root)
-		vgchange -ay
+		lvm vgchange -ay
 		exit 0
 		;;
 	esac
@@ -53,7 +53,7 @@
 	# Reduce padded --'s to -'s
 	vg=$(echo ${vg} | sed -e 's#--#-#g')
 
-	vgchange -ay ${vg}
+	lvm vgchange -ay ${vg}
 }
 
 if [ ! -e /sbin/vgchange ]; then

Attachment: pgpWJZyT99v0r.pgp
Description: PGP signature

Reply via email to