ref: d869559037802dcef6e2cd8551ab3ac0ececf690
parent: a6c6527bf3baff18b7134f6c68304033cdff1904
author: Natanael Copa <ncopa@alpinelinux.org>
date: Fri Dec 24 09:31:54 CST 2010
init: support lvm ontop of raid devices
--- a/initramfs-init.in
+++ b/initramfs-init.in
@@ -173,6 +173,14 @@
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
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 @@
raidautorun "$KOPT_root"
;;
esac
+ start_lvm
ebegin "Mounting root"
retry_mount -o ro $KOPT_root $sysroot 2>/dev/null
eend $?
@@ -296,6 +298,9 @@
echo "initramfs emergency recovery shell launched"
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