summaryrefslogtreecommitdiffstats
path: root/initramfs-init
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-03-13 13:50:28 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-03-13 13:50:28 +0000
commit108ef418c3ae72f876753c62cfb04d6e8e5dd235 (patch)
tree90914950225cfc2d03523850f7eded51d97be951 /initramfs-init
parent0ff6c91205d7b3d56e72683c917e74bd573b6c04 (diff)
downloadabuild-108ef418c3ae72f876753c62cfb04d6e8e5dd235.tar.bz2
abuild-108ef418c3ae72f876753c62cfb04d6e8e5dd235.tar.xz
initram: support for booting off a harddisk
Diffstat (limited to 'initramfs-init')
-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