summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xinitramfs-init15
1 files changed, 14 insertions, 1 deletions
diff --git a/initramfs-init b/initramfs-init
index 9603c4c..f43d8d1 100755
--- a/initramfs-init
+++ b/initramfs-init
@@ -103,7 +103,7 @@ eend $RC
# load available drivers to get access to modloop media
ebegin "Loading boot drivers"
-[ "$MODULES" ] && modprobe $MODULES 2> /dev/null
+[ "$MODULES" ] && modprobe -a $MODULES 2> /dev/null
if [ -f /etc/modules ] ; then
sed 's/\#.*//g' < /etc/modules |
while read module args; do
@@ -114,6 +114,19 @@ scan_drivers
scan_drivers
eend 0
+# check if root=... was set
+if [ -n "$KOPT_root" ]; then
+ mount $KOPT_root $NEWROOT
+ cat /proc/mounts | while read DEV DIR TYPE OPTS ; do
+ if [ "$DIR" != "/" -a "$DIR" != "$NEWROOT" -a -d "$DIR" ]; then
+ mkdir -p $NEWROOT/$DIR
+ mount -o move $DIR $NEWROOT/$DIR
+ fi
+ done
+ sync
+ exec /bin/busybox switch_root $NEWROOT $chart_init /sbin/init $KOPT_init_args
+fi
+
# locate boot media and mount it
ebegin "Mounting boot media"
mkdir -p $ALPINE_MNT