3.1.7 branch.
[minix.git] / drivers / ramdisk / rc
blob94ac386ac45243155233854752b8902e72b6ba8a
1 #!/bin/sh
2 set -e
4 exec >/dev/log
5 exec 2>/dev/log
6 exec </dev/null
8 /bin/service -c up /bin/pci -config /etc/system.conf
9 /bin/service -cn up /bin/floppy -config /etc/system.conf -dev /dev/fd0
10 if [ X`/bin/sysenv bios_wini` = Xyes ]
11 then
12 echo Using bios_wini.
13 /bin/service -cn up /bin/bios_wini -dev /dev/c0d0
14 else
15 /bin/service -cn up /bin/at_wini -dev /dev/c0d0 -config /etc/system.conf -label at_wini_0
16 /bin/service -cnr up /bin/at_wini -dev /dev/c1d0 -config /etc/system.conf -label at_wini_1 -args ata_instance=1
19 rootdev=`sysenv rootdev` || echo 'No rootdev?'
20 rootdevname=`/bin/dev2name "$rootdev"` ||
21 { echo 'No device name for root device'; exit 1; }
23 if [ "`sysenv bin_img`" = 1 ]
24 then
25 bin_img="-i "
28 if sysenv cdproberoot >/dev/null
29 then
30 echo
31 echo 'Looking for boot CD. This may take a minute.'
32 echo 'Please ignore any error messages.'
33 echo
34 cddev=`cdprobe` || { echo 'No CD found'; exit 1; }
35 export cddev
36 echo "Loading ramdisk from ${cddev}p1"
37 loadramdisk "$cddev"p1
38 elif [ "$rootdevname" = "/dev/ram" ]
39 then
40 ramimagedev=`sysenv ramimagedev` ||
41 { echo 'ramimagedev not found'; exit 1; }
42 ramimagename=`/bin/dev2name "$ramimagedev"` ||
43 { echo 'No device name for ramimagedev'; exit 1; }
44 echo "Loading ramdisk from $ramimagename"
45 loadramdisk "$ramimagename"
47 echo "Root device name is $rootdevname"
48 /bin/newroot $bin_img"$rootdevname"
49 exec /bin/sh /etc/rc "$@"