robertd

Update Script

Aug 2nd, 2016
115
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2. ##################################
  3. echo "------ INIT SEQUENCE ------"
  4. FU_ROOTFS_VERSION=`cat /version`
  5. ROOTFS_TMP_DIR=/tmp/rootfs
  6. . /install_script/constant.txt
  7. _UPDATE_FN_=`nvpstr ufn`
  8. if [ "$?" != 0 ]; then
  9. echo "nvpstr(ufn) error"
  10. fwfb /root/fwup_err.rgb
  11. exit 1
  12. if [ "$FU_ROOTFS_VERSION" \< "20110328A" ]; then
  13. lcdmsg -c -f /usr/local/bin/font_08x12.bmp -l 0,0 \
  14. "please update\n\n XX version\n\nbefore this verison."
  15. sleep 10
  16. exit 0
  17. ####################################################
  18. echo "------ FORMAT AND MOUNT ROOT PARTITION ------"
  19. mkfs.ext2 -b 4096 $COMMON_ROOTFS_PARTITION
  20. if [ "$?" != 0 ]; then
  21. echo "mkfs(root) error"
  22. fwfb /root/fwup_err.rgb
  23. exit 1
  24. mkdir $ROOTFS_TMP_DIR
  25. if [ "$?" != 0 ]; then
  26. echo "mkdir(tmp) error"
  27. fwfb /root/fwup_err.rgb
  28. exit 1
  29. mount -t ext2 $COMMON_ROOTFS_PARTITION $ROOTFS_TMP_DIR
  30. if [ "$?" != 0 ]; then
  31. echo "mount(root) error"
  32. fwfb /root/fwup_err.rgb
  33. exit 1
  34. #################################################
  35. echo "------ WRITE COMMON KERNEL & ROOTFS ------"
  36. fwpup -f /contents/$_UPDATE_FN_.UPG -k 1 -r 2 | tar -C $ROOTFS_TMP_DIR -xvzf -
  37. if [ "$?" != 0 ]; then
  38. echo "fwpup error"
  39. fwfb /root/fwup_err.rgb
  40. exit 1
  41. echo "ldconfig..."
  42. ldconfig -r $ROOTFS_TMP_DIR
  43. if [ "$?" != 0 ]; then
  44. echo "fwpup error"
  45. fwfb /root/fwup_err.rgb
  46. exit 1
  47. echo "mkdevs..."
  48. $ROOTFS_TMP_DIR/dev/mkdevs
  49. if [ "$?" != 0 ]; then
  50. echo "mkdevs error"
  51. fwfb /root/fwup_err.rgb
  52. exit 1
  53. ###########################################
  54. echo "------ UNMOUNT ROOT PARTITION ------"
  55. sync
  56. if [ "$?" != 0 ]; then
  57. echo "sync error"
  58. fwfb /root/fwup_err.rgb
  59. exit 1
  60. umount $ROOTFS_TMP_DIR
  61. if [ "$?" != 0 ]; then
  62. echo "umount(mnt) error"
  63. fwfb /root/fwup_err.rgb
  64. exit 1
  65. ###########################################
  66. echo "------ UPDATED!! ------"
  67. exit 0
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×