Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.85 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. echo "Start usb update!!"
  4. echo -n "USB: enter directory where images for upgrade are placed = "
  5. read directory
  6. if [ -e /dtv/usb/sda1 ]
  7. then
  8. MDIR=/dtv/usb/sda1
  9. fi
  10. if [ -e /dtv/usb/sda ]
  11. then
  12. MDIR=/dtv/usb/sda
  13. fi
  14. if [ -e /dtv/usb/sda0 ]
  15. then
  16. MDIR=/dtv/usb/sda0
  17. fi
  18. if [ -e /dtv/usb/sda2 ]
  19. then
  20. MDIR=/dtv/usb/sda2
  21. fi
  22. if [ -e /dtv/usb/sdb ]
  23. then
  24. MDIR=/dtv/usb/sdb
  25. fi
  26. if [ -e /dtv/usb/sdc ]
  27. then
  28. MDIR=/dtv/usb/sdc
  29. fi
  30. if [ -e /dtv/usb/sdb1 ]
  31. then
  32. MDIR=/dtv/usb/sdb1
  33. fi
  34. if [ -e /dtv/usb/sdc1 ]
  35. then
  36. MDIR=/dtv/usb/sdc1
  37. fi
  38.  
  39. echo "updating $MDIR/$directory/"
  40. if [ -e $MDIR/$directory/u-boot.bin ]
  41. then
  42. echo "START update u-boot.bin"
  43. bml.restore /dev/bml0/2 $MDIR/$directory/u-boot.bin 2> /dev/null
  44. sync
  45. echo "END update u-boot.bin"
  46. fi
  47. if [ -e $MDIR/$directory/uboot_env.bin ]
  48. then
  49. echo "START update uboot_env.bin"
  50. bml.restore /dev/bml0/3 $MDIR/$directory/uboot_env.bin 2> /dev/null
  51. sync
  52. echo "END update uboot_env.bin"
  53. fi
  54. if [ -e $MDIR/$directory/fnw.bin ]
  55. then
  56. echo "START update fnw.bin"
  57. bml.restore /dev/bml0/4 $MDIR/$directory/fnw.bin 2> /dev/null
  58. sync
  59. echo "END update fnw.bin"
  60. fi
  61. if [ -e $MDIR/$directory/Image ]
  62. then
  63. echo "START update Image"
  64. bml.restore /dev/bml0/5 $MDIR/$directory/Image 2> /dev/null
  65. sync
  66. echo "END update Image"
  67. fi
  68. if [ -e $MDIR/$directory/rootfs.img ]
  69. then
  70. echo "START update rootfs.img"
  71. bml.restore /dev/bml0/6 $MDIR/$directory/rootfs.img 2> /dev/null
  72. sync
  73. echo "END update rootfs.img"
  74. fi
  75. if [ -e $MDIR/$directory/boot.img ]
  76. then
  77. echo "START update boot.img"
  78. bml.restore /dev/bml0/7 $MDIR/$directory/boot.img 2> /dev/null
  79. sync
  80. echo "END update boot.img"
  81. fi
  82.  
  83. if [ -e /mtd_rwarea/PartitionSwitch_1_0 ]
  84. then
  85.  
  86. if [ -e $MDIR/$directory/exe.img ]
  87. then
  88. echo "START update exe.img"
  89. umount /mtd_exe
  90. bml.restore /dev/bml0/10 $MDIR/$directory/exe.img 2> /dev/null
  91. sync
  92. echo "END update exe.img"
  93. fi
  94. if [ -e $MDIR/$directory/appdata.img ]
  95. then
  96. echo "START update appdata.img"
  97. bml.restore /dev/bml0/11 $MDIR/$directory/appdata.img 2> /dev/null
  98. sync
  99. echo "END update appdata.img"
  100. fi
  101. else
  102. if [ -e $MDIR/$directory/exe.img ]
  103. then
  104. echo "START update exe.img"
  105. umount /mtd_exe
  106. bml.restore /dev/bml0/8 $MDIR/$directory/exe.img 2> /dev/null
  107. sync
  108. echo "END update exe.img"
  109. fi
  110. if [ -e $MDIR/$directory/appdata.img ]
  111. then
  112. echo "START update appdata.img"
  113. bml.restore /dev/bml0/9 $MDIR/$directory/appdata.img 2> /dev/null
  114. sync
  115. echo "END update appdata.img"
  116. fi
  117. fi
  118.  
  119. if [ -e $MDIR/$directory/tlib.img ]
  120. then
  121. echo "START update tlib.img"
  122. partition.erase /dev/bml0/13
  123. stl.format /dev/bml0/13
  124. dd if=$MDIR/$directory/tlib.img of=/dev/stl0/13 2> /dev/null
  125. sync
  126. echo "END update tlib.img"
  127. fi
  128. echo ""
  129. echo "Ending update"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement