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

View File

@ -103,7 +103,7 @@ eend $RC
# load available drivers to get access to modloop media # load available drivers to get access to modloop media
ebegin "Loading boot drivers" ebegin "Loading boot drivers"
[ "$MODULES" ] && modprobe $MODULES 2> /dev/null [ "$MODULES" ] && modprobe -a $MODULES 2> /dev/null
if [ -f /etc/modules ] ; then if [ -f /etc/modules ] ; then
sed 's/\#.*//g' < /etc/modules | sed 's/\#.*//g' < /etc/modules |
while read module args; do while read module args; do
@ -114,6 +114,19 @@ scan_drivers
scan_drivers scan_drivers
eend 0 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 # locate boot media and mount it
ebegin "Mounting boot media" ebegin "Mounting boot media"
mkdir -p $ALPINE_MNT mkdir -p $ALPINE_MNT