]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/altboot/files/altboot-menu/Advanced/30-bootUSB-Stick
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / altboot / files / altboot-menu / Advanced / 30-bootUSB-Stick
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 USB Storage"
9
10 test "$USB_HOST_AVAILABLE" = "yes" || exit 0
11
12 die() {
13         echo "ERROR: $1" >/dev/tty0
14         exec $SH_SHELL </dev/tty0 >/dev/tty0 2>&1
15 }
16
17 # This function is activated by init.altboot by calling this script with the "run" option
18 run_module() {
19         
20         test -e /etc/altboot.func && . /etc/altboot.func || die "ERROR: /etc/altboot.func not found. Check your installation!"
21         
22         # Mount /proc, etc
23         init_rootfs
24
25         echo "Starting USB..."
26         
27         for module in $USB_STORAGE_MODULES
28         do
29                 echo -en "\t - $module: "
30                 modprobe "$module" >/dev/null 2>&1 && echo ok || die "Failed to modprobe [$module]"
31         done
32                 
33         echo -n "Mounting $USB_STORAGE_PARTITION..."  >/dev/tty0
34         
35         mkdir -p /media/usb-storage >/dev/null 2>&1
36         
37         sleep "$USB_STORAGE_WAIT"
38         
39         /bin/mount -t auto -o defaults,noatime $USB_STORAGE_PARTITION /media/usb-storage >/dev/null 2>&1 && echo ok  >/dev/tty0|| die "/bin/mount -t auto -o defaults,noatime $SD_DEVICE $SD_MOUNTPOINT failed"
40                 
41         echo "" 
42         
43         # Check for a real fs and loop-images.
44         check_target "/media/usb-storage" >/dev/tty0            
45 }
46
47
48 case "$1" in
49 title)  echo "$M_TITLE";;
50 run)    run_module "$2";;
51 esac
52