Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #
- # This is a recovery procedure
- #
- # (C) 2005 Samsung Electronics
- #
- # $Log: rc-recovery,v $
- # Revision 1.2 2006/01/15 09:41:07 hcyun
- # handle install fail case
- #
- # Revision 1.1 2005/12/22 05:50:18 hcyun
- # Moved from images directory.
- #
- #
- err()
- {
- echo $*
- exit 1
- }
- format_ufda()
- {
- echo "Now format the /dev/ufda"
- ffdisk /dev/ufda -a
- fformat -f12 -c 16 /dev/ufda1 || \
- fformat -f12 -c 32 /dev/ufda1 || \
- fformat -f16 -c 8 /dev/ufda1 || err "Can't format /dev/ufda1"
- }
- format_ufdb()
- {
- echo "Now format the /dev/ufdb"
- ffdisk /dev/ufdb -a
- fformat -f32 -c 32 /dev/ufdb1 || fformat -f16 -c 32 /dev/ufdb1
- }
- format_ufdrawc()
- {
- echo "Now format the /dev/ufdrawc"
- ferasepart /dev/ufdrawc
- }
- # procedure start downloading
- download_fw()
- {
- echo "Download a initial firmware"
- echo ">> Now ready to connect UMS"
- echo "usbcontrol 1" > /proc/gadget_udc
- insmod g_file_storage file=/dev/ufdb
- echo ">> download firmware to the UMS"
- echo "after downlod is finished.. !!reboot the target!!"
- echo "it will install new firmware automatically"
- echo
- echo ">> Start recovery"
- /z-proj/bin/recovery /share/recovery.fb
- echo ">> Unloading UMS driver"
- rmmod g_file_storage
- sync
- echo ">> Reset the system"
- /sbin/reboot
- echo "main 0" > /proc/powerctl
- }
- export PATH=$PATH:/z-proj/bin
- cat /etc/motd
- echo "Recovery mode operation"
- mount -t proc none /proc
- mount -t tmpfs none /mnt/tmp
- format_ufda
- format_ufdb
- format_ufdrawc
- download_fw
- /bin/sh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement