Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- echo "Start usb update!!"
- echo -n "USB: enter directory where images for upgrade are placed = "
- read directory
- if [ -e /dtv/usb/sda1 ]
- then
- MDIR=/dtv/usb/sda1
- fi
- if [ -e /dtv/usb/sda ]
- then
- MDIR=/dtv/usb/sda
- fi
- if [ -e /dtv/usb/sda0 ]
- then
- MDIR=/dtv/usb/sda0
- fi
- if [ -e /dtv/usb/sda2 ]
- then
- MDIR=/dtv/usb/sda2
- fi
- if [ -e /dtv/usb/sdb ]
- then
- MDIR=/dtv/usb/sdb
- fi
- if [ -e /dtv/usb/sdc ]
- then
- MDIR=/dtv/usb/sdc
- fi
- if [ -e /dtv/usb/sdb1 ]
- then
- MDIR=/dtv/usb/sdb1
- fi
- if [ -e /dtv/usb/sdc1 ]
- then
- MDIR=/dtv/usb/sdc1
- fi
- echo "updating $MDIR/$directory/"
- if [ -e $MDIR/$directory/u-boot.bin ]
- then
- echo "START update u-boot.bin"
- bml.restore /dev/bml0/2 $MDIR/$directory/u-boot.bin 2> /dev/null
- sync
- echo "END update u-boot.bin"
- fi
- if [ -e $MDIR/$directory/uboot_env.bin ]
- then
- echo "START update uboot_env.bin"
- bml.restore /dev/bml0/3 $MDIR/$directory/uboot_env.bin 2> /dev/null
- sync
- echo "END update uboot_env.bin"
- fi
- if [ -e $MDIR/$directory/fnw.bin ]
- then
- echo "START update fnw.bin"
- bml.restore /dev/bml0/4 $MDIR/$directory/fnw.bin 2> /dev/null
- sync
- echo "END update fnw.bin"
- fi
- if [ -e $MDIR/$directory/Image ]
- then
- echo "START update Image"
- bml.restore /dev/bml0/5 $MDIR/$directory/Image 2> /dev/null
- sync
- echo "END update Image"
- fi
- if [ -e $MDIR/$directory/rootfs.img ]
- then
- echo "START update rootfs.img"
- bml.restore /dev/bml0/6 $MDIR/$directory/rootfs.img 2> /dev/null
- sync
- echo "END update rootfs.img"
- fi
- if [ -e $MDIR/$directory/boot.img ]
- then
- echo "START update boot.img"
- bml.restore /dev/bml0/7 $MDIR/$directory/boot.img 2> /dev/null
- sync
- echo "END update boot.img"
- fi
- if [ -e /mtd_rwarea/PartitionSwitch_1_0 ]
- then
- if [ -e $MDIR/$directory/exe.img ]
- then
- echo "START update exe.img"
- umount /mtd_exe
- bml.restore /dev/bml0/10 $MDIR/$directory/exe.img 2> /dev/null
- sync
- echo "END update exe.img"
- fi
- if [ -e $MDIR/$directory/appdata.img ]
- then
- echo "START update appdata.img"
- bml.restore /dev/bml0/11 $MDIR/$directory/appdata.img 2> /dev/null
- sync
- echo "END update appdata.img"
- fi
- else
- if [ -e $MDIR/$directory/exe.img ]
- then
- echo "START update exe.img"
- umount /mtd_exe
- bml.restore /dev/bml0/8 $MDIR/$directory/exe.img 2> /dev/null
- sync
- echo "END update exe.img"
- fi
- if [ -e $MDIR/$directory/appdata.img ]
- then
- echo "START update appdata.img"
- bml.restore /dev/bml0/9 $MDIR/$directory/appdata.img 2> /dev/null
- sync
- echo "END update appdata.img"
- fi
- fi
- if [ -e $MDIR/$directory/tlib.img ]
- then
- echo "START update tlib.img"
- partition.erase /dev/bml0/13
- stl.format /dev/bml0/13
- dd if=$MDIR/$directory/tlib.img of=/dev/stl0/13 2> /dev/null
- sync
- echo "END update tlib.img"
- fi
- echo ""
- echo "Ending update"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement