]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/altboot/files/spitz/altboot-menu/15-bootSD
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / altboot / files / spitz / altboot-menu / 15-bootSD
1 # !/bin/sh
2 #
3 # Copyright Matthias Hentges (c) 2005
4 #
5 # License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the GPL)
6
7
8 M_TITLE="Boot SD card"
9
10 die() {
11         echo "ERROR: $1" >/dev/tty0
12         exec $SH_SHELL </dev/tty0 >/dev/tty0 2>&1
13 }
14
15 # This function is activated by init.altboot by calling this script with the "run" option
16 run_module() {
17         
18         test -e /etc/altboot.func && . /etc/altboot.func || die "ERROR: /etc/altboot.func not found. Check your installation!"
19         
20         echo -n "Mounting rootfs rw..." >/dev/tty0
21         mount -o remount,rw / >/dev/tty0 2>&1 && echo ok  >/dev/tty0|| die "mount -o remount,rw / failed"
22
23         test -z "$SPITZ_HDD_PART" && SPITZ_HDD_PART="/dev/hda1" 
24         mount -t proc proc /proc || echo "Mounting /proc failed!"
25
26         # Note: Redirecting STDIN & STDOUT is required, cardmg will die otherwise
27         cardmgr -o < /dev/tty0 > /dev/tty0 2>&1 || echo "cardmgr -o failed!"
28         
29         # I've seen busybox die a horrible death on "!"...
30         if (mount -t auto $SPITZ_HDD_PART /media/hdd)
31         then
32                 a=a
33         else
34                 echo "ERROR: mount -t auto $SPITZ_HDD_PART /media/hdd failed!"
35                 exec $SH_SHELL </dev/tty0 >/dev/tty0 2>&1
36         fi
37
38 #       echo -n "Generating device files..." >/dev/tty0
39 #       /etc/init.d/devices start && echo ok  >/dev/tty0|| die "FAILED"
40
41 # FIXME: generate device-files  
42
43         echo -n "Loading SD kernel module..."
44         /sbin/insmod $SD_KERNEL_MODULE >/dev/null 2>&1 && echo ok || die "insmod failed"
45
46         echo -n "Mounting $SD_MOUNTPOINT..."  >/dev/tty0
47         /bin/mount -t auto -o defaults,noatime $SD_DEVICE $SD_MOUNTPOINT >/dev/null 2>&1 && echo ok  >/dev/tty0|| die "/bin/mount -t auto -o defaults,noatime $SD_DEVICE $SD_MOUNTPOINT failed"
48                 
49         echo ""
50
51         # Give the SD and CF mounting some time. This is a must for SD                  
52         sleep 2
53         
54         # Check for a real fs and loop-images.
55         check_target "$SD_MOUNTPOINT" >/dev/tty0
56                 
57 }
58
59
60 case "$1" in
61 title)  echo "$M_TITLE";;
62 run)    run_module "$2";;
63 esac
64