initram: support for booting off a harddisk

This commit is contained in:
Natanael Copa 2009-03-13 13:50:28 +00:00
parent 0ff6c91205
commit 108ef418c3
1 changed files with 14 additions and 1 deletions

View File

@ -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