RS: invoke a shell explicitly for scripts
[minix.git] / drivers / ramdisk / rc
blob8cc64e14db01eac916ef68b8e4a4fd42027b288b
1 #!/bin/sh
2 set -e
4 exec >/dev/log
5 exec 2>/dev/log
6 exec </dev/null
8 FSCK=/bin/fsck.mfs
9 ACPI=/usr/sbin/acpi
10 if [ -e $ACPI -a -n "`sysenv acpi`" ]
11 then
12 /bin/service -c up $ACPI
14 /bin/service -c up /usr/sbin/pci
15 /bin/service -cn up /sbin/floppy -dev /dev/fd0
16 if [ X`/bin/sysenv ahci` = Xyes ]
17 then
18 # this is here temporarily, for testing purposes
19 /bin/service -c up /sbin/ahci -dev /dev/c0d0 -label ahci_0 -args instance=0
20 else
21 /bin/service -c up /sbin/at_wini -dev /dev/c0d0 -label at_wini_0
22 /bin/service -cr up /sbin/at_wini -dev /dev/c1d0 -label at_wini_1 -args instance=1
24 /bin/service up /sbin/procfs || echo "WARNING: couldn't start procfs"
26 if /bin/sysenv rootdevname >/dev/null
27 then rootdevname=/dev/`/bin/sysenv rootdevname`
28 else echo "rootdevname not set"
29 exit 1
32 if [ "`sysenv bin_img`" = 1 ]
33 then
34 bin_img="-i "
37 if sysenv cdproberoot >/dev/null
38 then
39 echo
40 echo 'Looking for boot CD. This may take a minute.'
41 echo 'Please ignore any error messages.'
42 echo
43 cddev=`cdprobe` || { echo 'No CD found'; exit 1; }
44 export cddev
45 echo "Loading ramdisk from ${cddev}p1"
46 loadramdisk "$cddev"p1
47 elif [ "$rootdevname" = "/dev/ram" ]
48 then
49 ramimagename=/dev/`/bin/sysenv ramimagename`
50 echo "Loading ramdisk from $ramimagename"
51 loadramdisk "$ramimagename" || echo "WARNING: loadramdisk failed"
54 echo "Root device name is $rootdevname"
55 if [ -e $FSCK ]
56 then $FSCK -p $rootdevname
59 # Change root from temporary boot ramdisk to the configure
60 # root device
61 /bin/mount -n $bin_img"$rootdevname" /
63 /bin/mount -e -n -t procfs none /proc || echo "WARNING: couldn't mount procfs"
65 exec /bin/sh /etc/rc "$@"