[readonly/geninitrd/devel: 213/334] Working rootfs on LVM2 support (tested).
draenog
draenog at pld-linux.org
Sat Nov 2 19:29:26 CET 2013
commit 4e1e40bd512536eee2b237cca09be1d93cc845bf
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Thu Jun 24 13:09:12 2004 +0000
Working rootfs on LVM2 support (tested).
svn-id: @4237
geninitrd | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/geninitrd b/geninitrd
index a6de578..34ce9a2 100755
--- a/geninitrd
+++ b/geninitrd
@@ -862,6 +862,8 @@ fi
find_root
+org_rootdev="$rootdev1"
+
find_modules_for "$rootdev1"
findmodule "-$rootFs"
@@ -1075,12 +1077,17 @@ if is_yes "$uselvm" ; then
mkdir -p $MNTIMAGE/etc
mkdir -p $MNTIMAGE/tmp
mkdir -p $MNTIMAGE/proc
+ mkdir -p $MNTIMAGE/newroot
echo "mount -t proc none /proc" >> "$s"
echo "mount -t devfs none /dev" >> "$s"
echo "mount -t tmpfs none /tmp" >> "$s"
if [ "$LVMTOOLSVERSION" = "1" ] ; then
echo "lvm vgscan -T" >> "$s"
echo "lvm vgchange -T -a y $VGVOLUME" >> "$s"
+ echo "umount /tmp" >> "$s"
+ # fail to umount
+ echo "umount /dev" >> "$s"
+ echo "umount /proc" >> "$s"
else
echo "cat /etc/lvm.conf > /tmp/lvm.conf" >> "$s"
echo "global {" > "$MNTIMAGE/etc/lvm.conf"
@@ -1094,13 +1101,17 @@ if is_yes "$uselvm" ; then
fi
lvm dumpconfig | awk '/filter=/' >> "$MNTIMAGE/etc/lvm.conf"
echo "}" >> "$MNTIMAGE/etc/lvm.conf"
- echo "LVM_SYSTEM_DIR=/tmp lvm vgscan --mknodes --ignorelockingfailure" >> "$s"
+ echo "LVM_SYSTEM_DIR=/tmp lvm vgscan --ignorelockingfailure" >> "$s"
echo "LVM_SYSTEM_DIR=/tmp lvm vgchange --ignorelockingfailure -a y $VGVOLUME" >> "$s"
+ echo "mount $org_rootdev /newroot" >> "$s"
+ echo "umount /tmp" >> "$s"
+ # fail to umount
+ echo "umount /dev" >> "$s"
+ echo "umount /proc" >> "$s"
+ echo "cd /newroot" >> "$s"
+ echo "pivot_root . initrd" >> "$s"
+ echo "exec /usr/sbin/chroot . /sbin/init -i < dev/console > dev/console 2>&1" >> "$s"
fi
- echo "umount /tmp" >> "$s"
- # fail to umount
- echo "umount /dev" >> "$s"
- echo "umount /proc" >> "$s"
fi
chmod +x "$RCFILE"
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/readonly/geninitrd.git/commitdiff/398807324938659207036e520c0950a61ef50c11
More information about the pld-cvs-commit
mailing list