3 # Copyright Matthias Hentges (c) 2005
5 # License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the GPL)
8 M_TITLE="Boot USB Storage"
10 test "$USB_HOST_AVAILABLE" = "yes" || exit 0
13 echo "ERROR: $1" >/dev/tty0
14 exec $SH_SHELL </dev/tty0 >/dev/tty0 2>&1
17 # This function is activated by init.altboot by calling this script with the "run" option
20 test -e /etc/altboot.func && . /etc/altboot.func || die "ERROR: /etc/altboot.func not found. Check your installation!"
25 echo "Starting USB..."
27 for module in $USB_STORAGE_MODULES
29 echo -en "\t - $module: "
30 modprobe "$module" >/dev/null 2>&1 && echo ok || die "Failed to modprobe [$module]"
33 echo -n "Mounting $USB_STORAGE_PARTITION..." >/dev/tty0
35 mkdir -p /media/usb-storage >/dev/null 2>&1
37 sleep "$USB_STORAGE_WAIT"
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"
43 # Check for a real fs and loop-images.
44 check_target "/media/usb-storage" >/dev/tty0
49 title) echo "$M_TITLE";;
50 run) run_module "$2";;