2006-02-15 12:18:21 +01:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
2008-12-11 15:42:23 +01:00
|
|
|
|
|
|
|
exec >/dev/log
|
|
|
|
exec 2>/dev/log
|
|
|
|
exec </dev/null
|
|
|
|
|
2011-12-22 01:29:27 +01:00
|
|
|
FSCK=/bin/fsck.mfs
|
2012-05-07 13:38:39 +02:00
|
|
|
ACPI=/usr/sbin/acpi
|
2013-03-06 19:27:47 +01:00
|
|
|
|
|
|
|
if [ X`/bin/sysenv arch` = Xi386 ]
|
2013-05-16 15:34:17 +02:00
|
|
|
then if [ -e $ACPI -a -n "`sysenv acpi`" ]
|
2013-03-06 19:27:47 +01:00
|
|
|
then
|
|
|
|
/bin/service -c up $ACPI
|
|
|
|
fi
|
2013-05-16 15:34:17 +02:00
|
|
|
/bin/service -c up /usr/sbin/pci
|
2013-05-15 17:45:33 +02:00
|
|
|
|
|
|
|
# Start procfs so we can access /proc/pci
|
|
|
|
mount -t procfs none /proc >/dev/null
|
|
|
|
|
|
|
|
# Do we want to use the virtio block device?
|
|
|
|
# If not specified, default to yes if the device is found.
|
|
|
|
if /bin/sysenv virtio_blk >/dev/null
|
|
|
|
then virtio_blk="`/bin/sysenv virtio_blk`"
|
|
|
|
elif grep '^[^ ]* [^ ]* 1AF4:1001 ' /proc/pci >/dev/null
|
|
|
|
then echo "virtio_blk not set, defaulting to using found virtio device."
|
|
|
|
virtio_blk=yes
|
|
|
|
fi
|
|
|
|
|
2013-03-06 19:27:47 +01:00
|
|
|
/bin/service -cn up /sbin/floppy -dev /dev/fd0
|
|
|
|
if [ X`/bin/sysenv ahci` = Xyes ]
|
|
|
|
then
|
|
|
|
# this is here temporarily, for testing purposes
|
|
|
|
/bin/service -c up /sbin/ahci -dev /dev/c0d0 -label ahci_0 -args instance=0
|
2013-05-15 17:45:33 +02:00
|
|
|
elif [ X"$virtio_blk" = Xyes ]
|
2013-03-06 19:27:47 +01:00
|
|
|
then
|
|
|
|
/bin/service -c up /sbin/virtio_blk -dev /dev/c0d0 -label virtio_blk_0 -args instance=0
|
|
|
|
else
|
|
|
|
/bin/service -c up /sbin/at_wini -dev /dev/c0d0 -label at_wini_0
|
|
|
|
/bin/service -cr up /sbin/at_wini -dev /dev/c1d0 -label at_wini_1 -args instance=1
|
|
|
|
fi
|
2013-05-15 17:45:33 +02:00
|
|
|
/bin/umount /proc >/dev/null
|
2010-09-02 17:44:36 +02:00
|
|
|
fi
|
2013-03-06 19:27:47 +01:00
|
|
|
|
|
|
|
if [ X`/bin/sysenv arch` = Xearm ]
|
2013-04-08 15:08:15 +02:00
|
|
|
then echo Starting the mmc driver
|
2013-03-06 19:27:47 +01:00
|
|
|
/bin/service -c up /sbin/mmc -dev /dev/c0d0
|
2006-02-15 12:18:21 +01:00
|
|
|
fi
|
2013-03-06 19:27:47 +01:00
|
|
|
|
2011-02-23 14:05:28 +01:00
|
|
|
/bin/service up /sbin/procfs || echo "WARNING: couldn't start procfs"
|
2006-02-15 12:18:21 +01:00
|
|
|
|
2012-01-31 12:48:14 +01:00
|
|
|
if /bin/sysenv rootdevname >/dev/null
|
2012-11-01 19:40:56 +01:00
|
|
|
then rootdevname=/dev/`/bin/sysenv rootdevname`
|
|
|
|
else echo "rootdevname not set"
|
|
|
|
exit 1
|
2012-01-31 12:48:14 +01:00
|
|
|
fi
|
2006-02-15 12:18:21 +01:00
|
|
|
|
2009-08-18 13:36:01 +02:00
|
|
|
if [ "`sysenv bin_img`" = 1 ]
|
|
|
|
then
|
|
|
|
bin_img="-i "
|
|
|
|
fi
|
|
|
|
|
2006-02-15 12:18:21 +01:00
|
|
|
if sysenv cdproberoot >/dev/null
|
|
|
|
then
|
|
|
|
echo
|
|
|
|
echo 'Looking for boot CD. This may take a minute.'
|
|
|
|
echo 'Please ignore any error messages.'
|
|
|
|
echo
|
|
|
|
cddev=`cdprobe` || { echo 'No CD found'; exit 1; }
|
|
|
|
export cddev
|
|
|
|
echo "Loading ramdisk from ${cddev}p1"
|
|
|
|
loadramdisk "$cddev"p1
|
|
|
|
elif [ "$rootdevname" = "/dev/ram" ]
|
|
|
|
then
|
2012-11-01 19:40:56 +01:00
|
|
|
ramimagename=/dev/`/bin/sysenv ramimagename`
|
2006-02-15 12:18:21 +01:00
|
|
|
echo "Loading ramdisk from $ramimagename"
|
2012-01-31 12:48:14 +01:00
|
|
|
loadramdisk "$ramimagename" || echo "WARNING: loadramdisk failed"
|
2006-02-15 12:18:21 +01:00
|
|
|
fi
|
2012-11-01 19:40:56 +01:00
|
|
|
|
2006-02-15 12:18:21 +01:00
|
|
|
echo "Root device name is $rootdevname"
|
2011-12-22 01:29:27 +01:00
|
|
|
if [ -e $FSCK ]
|
|
|
|
then $FSCK -p $rootdevname
|
|
|
|
fi
|
2012-04-10 04:07:51 +02:00
|
|
|
|
|
|
|
# Change root from temporary boot ramdisk to the configure
|
|
|
|
# root device
|
|
|
|
/bin/mount -n $bin_img"$rootdevname" /
|
|
|
|
|
2012-02-14 16:44:21 +01:00
|
|
|
/bin/mount -e -n -t procfs none /proc || echo "WARNING: couldn't mount procfs"
|
2011-12-22 01:29:27 +01:00
|
|
|
|
2006-03-07 15:58:18 +01:00
|
|
|
exec /bin/sh /etc/rc "$@"
|