arm: protect state after signal handler
[minix.git] / drivers / ramdisk / rc
blob895f80d1b5ed1c2d5d06eb034b91eeb200f570e2
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 elif [ X`/bin/sysenv virtio_blk` = Xyes ]
21 then
22 /bin/service -c up /sbin/virtio_blk -dev /dev/c0d0 -label virtio_blk_0 -args instance=0
23 else
24 /bin/service -c up /sbin/at_wini -dev /dev/c0d0 -label at_wini_0
25 /bin/service -cr up /sbin/at_wini -dev /dev/c1d0 -label at_wini_1 -args instance=1
27 /bin/service up /sbin/procfs || echo "WARNING: couldn't start procfs"
29 if /bin/sysenv rootdevname >/dev/null
30 then rootdevname=/dev/`/bin/sysenv rootdevname`
31 else echo "rootdevname not set"
32 exit 1
35 if [ "`sysenv bin_img`" = 1 ]
36 then
37 bin_img="-i "
40 if sysenv cdproberoot >/dev/null
41 then
42 echo
43 echo 'Looking for boot CD. This may take a minute.'
44 echo 'Please ignore any error messages.'
45 echo
46 cddev=`cdprobe` || { echo 'No CD found'; exit 1; }
47 export cddev
48 echo "Loading ramdisk from ${cddev}p1"
49 loadramdisk "$cddev"p1
50 elif [ "$rootdevname" = "/dev/ram" ]
51 then
52 ramimagename=/dev/`/bin/sysenv ramimagename`
53 echo "Loading ramdisk from $ramimagename"
54 loadramdisk "$ramimagename" || echo "WARNING: loadramdisk failed"
57 echo "Root device name is $rootdevname"
58 if [ -e $FSCK ]
59 then $FSCK -p $rootdevname
62 # Change root from temporary boot ramdisk to the configure
63 # root device
64 /bin/mount -n $bin_img"$rootdevname" /
66 /bin/mount -e -n -t procfs none /proc || echo "WARNING: couldn't mount procfs"
68 exec /bin/sh /etc/rc "$@"