Bug#775583: [PATCH] Add initramfs-tools boot script for preparing additional block devices (Closes: #775583)

Ben Hutchings ben at decadent.org.uk
Sat Jan 17 23:18:44 UTC 2015


Control: tag -1 patch

Here is a new script cribbed from the existing scripts/local-top/lvm2.
Tested in conjunction with the patch I'm about to send to #762984.

--- /dev/null
+++ b/debian/initramfs-tools/lvm2/scripts/local-extra/lvm2
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+PREREQ="mdadm mdrun multipath"
+
+prereqs()
+{
+	echo "$PREREQ"
+}
+
+case $1 in
+# get pre-requisites
+prereqs)
+	prereqs
+	exit 0
+	;;
+esac
+
+if [ ! -e /sbin/lvm ]; then
+	exit 0
+fi
+
+dev="$1"
+
+# Make sure that we have a d-m path
+dev="${dev#/dev/mapper/}"
+if [ "$dev" = "$1" ]; then
+	exit 0
+fi
+
+eval $(dmsetup splitname --nameprefixes --noheadings --rows "$dev")
+
+if [ "$DM_VG_NAME" ] && [ "$DM_LV_NAME" ]; then
+	lvm lvchange -aly --ignorelockingfailure "$DM_VG_NAME/$DM_LV_NAME"
+	rc=$?
+	if [ $rc = 5 ]; then
+		echo "Unable to find LVM volume $DM_VG_NAME/$DM_LV_NAME"
+	fi
+fi
+
+exit 0

-- 
Ben Hutchings
The first rule of tautology club is the first rule of tautology club.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 811 bytes
Desc: This is a digitally signed message part
URL: <http://lists.alioth.debian.org/pipermail/pkg-lvm-maintainers/attachments/20150117/44eccdd1/attachment.sig>


More information about the pkg-lvm-maintainers mailing list