]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Add the basics for LVM support
authorJeremy Katz <katzj@redhat.com>
Mon, 15 Dec 2008 19:07:55 +0000 (14:07 -0500)
committerJeremy Katz <katzj@redhat.com>
Mon, 15 Dec 2008 19:07:55 +0000 (14:07 -0500)
For LVM, we need to do activation of the volume group within the initrd.
Stick lvm tools into the initrd as well as a (basic and stupid) udev rule
to run vgchange -ay.  Ultimately we want to get a better rule for this into
udev proper

generate.sh
rules.d/64-lvm.rules [new file with mode: 0644]

index 01ee5c9595f416d86585699bca32a4f03c24ef1c..cd37259bfea94494896a3e693d9c015af9a1f0c3 100755 (executable)
@@ -16,13 +16,14 @@ tmpdir=$(mktemp -d)
 
 # executables that we have to have
 exe="/bin/bash /bin/mount /bin/mknod /bin/mkdir /sbin/modprobe /sbin/udevd /sbin/udevadm /sbin/nash /bin/kill /sbin/pidof /bin/sleep"
+lvmexe="/sbin/lvm"
 # and some things that are nice for debugging
 debugexe="/bin/ls /bin/cat /bin/ln /bin/ps /bin/grep /usr/bin/less"
 # udev things we care about
 udevexe="/lib/udev/vol_id"
 
 # install base files
-for binary in $exe $debugexe $udevexe ; do
+for binary in $exe $debugexe $udevexe $lvmexe ; do
   inst $binary $tmpdir
 done
 
diff --git a/rules.d/64-lvm.rules b/rules.d/64-lvm.rules
new file mode 100644 (file)
index 0000000..0031c08
--- /dev/null
@@ -0,0 +1,13 @@
+# hacky rules to try to activate lvm when we get new block devs...
+#
+# Copyright 2008, Red Hat, Inc.
+# Jeremy Katz <katzj@redhat.com>
+
+
+SUBSYSTEM!="block", GOTO="lvm_end"
+ACTION!="add|change", GOTO="lvm_end"
+
+ENV{ID_FS_TYPE}=="LVM2_member", RUN+="/sbin/lvm vgchange -ay"
+
+
+LABEL="lvm_end"