]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/openslug-init/openslug-init-0.10/boot/ram
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 / ram
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         # prepare the device.  This uses tmpfs to avoid dependency
21         # on non-built-in file systems and because tmpfs can expand
22         # to bigger than the 10MByte ram0 partition used before.
23         # The 'device' is currently unused.
24         if mount -t tmpfs "$@" tmpfs /mnt
25         then
26                 cd /
27                 # filter out boot (with zimage), linuxrc and anything
28                 # below /var, keep dev or the boot will fail (note that
29                 # nothing is mounted this early in the bootstrap).
30                 find . -mount -print |
31                 sed '\@^./boot/@d;\@^./boot$@d;\@^./linuxrc@d;\@^./var/@d' |
32                 cpio -p -d -m -u /mnt
33                 # checkmount checks for sh, init and no .recovery plus
34                 # either mnt or initrd, mnt must exist!
35                 if checkmount /mnt
36                 then
37                         # pivot to /mnt
38                         cd /
39                         swivel mnt mnt
40                         # swivel failed
41                 fi
42                 # Failure: unmount the partition.
43                 umount /mnt
44         fi
45 fi
46 # fallback - use the flash boot
47 exec /boot/flash