lvm module will initial lvm volume to support boot from
Logical Volume.

Signed-off-by: Liwei Song <liwei.s...@windriver.com>
---
 meta/recipes-core/initrdscripts/initramfs-framework/lvm    | 13 +++++++++++++
 meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb |  9 +++++++++
 2 files changed, 22 insertions(+)
 create mode 100644 meta/recipes-core/initrdscripts/initramfs-framework/lvm

diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/lvm 
b/meta/recipes-core/initrdscripts/initramfs-framework/lvm
new file mode 100644
index 000000000000..7deeccb9a29e
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-framework/lvm
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+lvm_enabled() {
+       if ! lvscan |grep -i -w "inactive" &>/dev/null;then
+               return 1
+       fi
+       return 0
+}
+
+lvm_run() {
+       lvm pvscan --cache --activate ay
+       udevadm trigger --action=add
+}
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb 
b/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb
index 660343eafa23..c53a0c03ae6c 100644
--- a/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb
+++ b/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb
@@ -17,6 +17,7 @@ SRC_URI = "file://init \
            file://udev \
            file://e2fs \
            file://debug \
+           file://lvm \
           "
 
 S = "${WORKDIR}"
@@ -45,6 +46,9 @@ do_install() {
     # debug
     install -m 0755 ${WORKDIR}/debug ${D}/init.d/00-debug
 
+    # lvm
+    install -m 0755 ${WORKDIR}/lvm ${D}/init.d/09-lvm
+
     # Create device nodes expected by some kernels in initramfs
     # before even executing /init.
     install -d ${D}/dev
@@ -59,6 +63,7 @@ PACKAGES = "${PN}-base \
             initramfs-module-nfsrootfs \
             initramfs-module-rootfs \
             initramfs-module-debug \
+            initramfs-module-lvm \
            "
 
 FILES_${PN}-base = "/init /init.d/99-finish /dev"
@@ -98,3 +103,7 @@ FILES_initramfs-module-rootfs = "/init.d/90-rootfs"
 SUMMARY_initramfs-module-debug = "initramfs dynamic debug support"
 RDEPENDS_initramfs-module-debug = "${PN}-base"
 FILES_initramfs-module-debug = "/init.d/00-debug"
+
+SUMMARY_initramfs-module-lvm = "initramfs lvm rootfs support"
+RDEPENDS_initramfs-module-lvm = "${PN}-base"
+FILES_initramfs-module-lvm = "/init.d/09-lvm"
-- 
2.7.4

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to