summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
diff options
context:
space:
mode:
authorLiwei Song <liwei.song@windriver.com>2019-03-20 23:19:13 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-03-25 23:13:48 +0000
commitba771bf192ec489e5b6b6c6c0a6f5e0d9763f1a7 (patch)
tree6758be617e9154cce8f801f0042777df67ecf4c0 /meta/recipes-core
parent2d15516d403cffaefc2f6c006b95fcd48e2a2ae4 (diff)
downloadpoky-ba771bf192ec489e5b6b6c6c0a6f5e0d9763f1a7.tar.gz
initramfs-framework: add lvm module
lvm module will initial lvm volume to support boot from Logical Volume. (From OE-Core rev: 3a4213f014fc4aa5be05dfc0722d87e01e5ff10c) Signed-off-by: Liwei Song <liwei.song@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r--meta/recipes-core/initrdscripts/initramfs-framework/lvm13
-rw-r--r--meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb9
2 files changed, 22 insertions, 0 deletions
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/lvm b/meta/recipes-core/initrdscripts/initramfs-framework/lvm
new file mode 100644
index 0000000000..7deeccb9a2
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-framework/lvm
@@ -0,0 +1,13 @@
1#!/bin/sh
2
3lvm_enabled() {
4 if ! lvscan |grep -i -w "inactive" &>/dev/null;then
5 return 1
6 fi
7 return 0
8}
9
10lvm_run() {
11 lvm pvscan --cache --activate ay
12 udevadm trigger --action=add
13}
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb
index 660343eafa..c53a0c03ae 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 \
17 file://udev \ 17 file://udev \
18 file://e2fs \ 18 file://e2fs \
19 file://debug \ 19 file://debug \
20 file://lvm \
20 " 21 "
21 22
22S = "${WORKDIR}" 23S = "${WORKDIR}"
@@ -45,6 +46,9 @@ do_install() {
45 # debug 46 # debug
46 install -m 0755 ${WORKDIR}/debug ${D}/init.d/00-debug 47 install -m 0755 ${WORKDIR}/debug ${D}/init.d/00-debug
47 48
49 # lvm
50 install -m 0755 ${WORKDIR}/lvm ${D}/init.d/09-lvm
51
48 # Create device nodes expected by some kernels in initramfs 52 # Create device nodes expected by some kernels in initramfs
49 # before even executing /init. 53 # before even executing /init.
50 install -d ${D}/dev 54 install -d ${D}/dev
@@ -59,6 +63,7 @@ PACKAGES = "${PN}-base \
59 initramfs-module-nfsrootfs \ 63 initramfs-module-nfsrootfs \
60 initramfs-module-rootfs \ 64 initramfs-module-rootfs \
61 initramfs-module-debug \ 65 initramfs-module-debug \
66 initramfs-module-lvm \
62 " 67 "
63 68
64FILES_${PN}-base = "/init /init.d/99-finish /dev" 69FILES_${PN}-base = "/init /init.d/99-finish /dev"
@@ -98,3 +103,7 @@ FILES_initramfs-module-rootfs = "/init.d/90-rootfs"
98SUMMARY_initramfs-module-debug = "initramfs dynamic debug support" 103SUMMARY_initramfs-module-debug = "initramfs dynamic debug support"
99RDEPENDS_initramfs-module-debug = "${PN}-base" 104RDEPENDS_initramfs-module-debug = "${PN}-base"
100FILES_initramfs-module-debug = "/init.d/00-debug" 105FILES_initramfs-module-debug = "/init.d/00-debug"
106
107SUMMARY_initramfs-module-lvm = "initramfs lvm rootfs support"
108RDEPENDS_initramfs-module-lvm = "${PN}-base"
109FILES_initramfs-module-lvm = "/init.d/09-lvm"