aboutsummaryrefslogtreecommitdiffstats
path: root/main/mkinitfs/0001-init-support-lvm-ontop-of-raid-devices.patch
blob: fe28fdfa6facb8b2f54e015ca99bc9fac67b92c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
From d869559037802dcef6e2cd8551ab3ac0ececf690 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Fri, 24 Dec 2010 15:31:54 +0000
Subject: [PATCH] init: support lvm ontop of raid devices

---
 initramfs-init.in |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/initramfs-init.in b/initramfs-init.in
index 81b7150..d140d75 100755
--- a/initramfs-init.in
+++ b/initramfs-init.in
@@ -173,6 +173,14 @@ setup_inittab_console(){
 	done
 }
 
+# start lvm if exists
+start_lvm() {
+	[ -x /sbin/lvm ] || return
+	modprobe dm-mod
+	lvm vgscan --mknodes --ignorelockingfailure >/dev/null 2>&1 &&\
+		lvm vgchange --ignorelockingfailure -a y >/dev/null 2>&1
+}
+
 # gotta start from somewhere :)
 echo "Alpine Init $VERSION"
 
@@ -260,13 +268,6 @@ scan_drivers
 scan_drivers
 eend 0
 
-# start lvm if exists
-if [ -x /sbin/lvm ]; then
-	modprobe dm-mod
-	lvm vgscan --mknodes --ignorelockingfailure >/dev/null 2>&1 &&\
-		lvm vgchange --ignorelockingfailure -a y >/dev/null 2>&1
-fi
-
 # check if root=... was set
 if [ -n "$KOPT_root" ]; then
 	if [ "$SINGLEMODE" = "yes" ]; then
@@ -282,6 +283,7 @@ if [ -n "$KOPT_root" ]; then
 			raidautorun "$KOPT_root"
 			;;
 	esac
+	start_lvm
 	ebegin "Mounting root"
 	retry_mount -o ro $KOPT_root $sysroot 2>/dev/null
 	eend $?
@@ -297,6 +299,9 @@ if [ -n "$KOPT_root" ]; then
 	exec /bin/busybox sh
 fi
 
+# incase we have alpine_dev on raid device...
+start_lvm
+
 # we only want to wait for usb if really needed at this point
 if [ -z "${ALPINE_DEV##*usb*}" ]; then
 	wait_usb
-- 
1.7.3.4