]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/openslug-init/openslug-init-0.10/boot/disk
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / openslug-init / openslug-init-0.10 / boot / disk
1 #!/bin/sh
2 # boot from the hard disk partition "$1" (which
3 # must be given) using options from the rest of
4 # the command line.
5 #
6 /sbin/leds -A '!gr'
7 #
8 # Use the standard init path (see /etc/init.d/rcS)
9 export PATH=/sbin:/bin:/usr/sbin:/usr/bin
10 #
11 # Load the helper functions
12 . /etc/default/functions
13 #
14 if test -n "$1"
15 then
16         device="$1"
17         shift
18         echo "boot: rootfs: mount $* $device"
19         #
20         # wait if required
21         test "$sleep" -gt 0 && sleep "$sleep"
22         #
23         # Mount read-write because before exec'ing init
24         # this script creates the '.recovery' link to
25         # detect failed boot.  No file type is given to
26         if mount "$@" "$device" /mnt
27         then
28                 # checkmount checks for sh, init and no
29                 # .recovery plus either mnt or initrd
30                 if checkmount /mnt && :>/mnt/.recovery
31                 then
32                         # sync to ensure .recovery is written
33                         sync
34                         # pivot to /initrd if available, else /mnt
35                         cd /
36                         if test -d /mnt/initrd
37                         then
38                                 swivel mnt initrd
39                         else
40                                 swivel mnt mnt
41                         fi
42                         # swivel failed
43                 fi
44                 # Failure: unmount the partition
45                 umount /mnt
46         fi
47 fi
48 # fallback - use the flash boot
49 exec /boot/flash