rcS.swupdate 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #!/bin/sh
  2. PATH=/sbin:/bin:/usr/sbin:/usr/bin
  3. USB=/mnt
  4. umask 022
  5. mount -t proc proc /proc
  6. mount sysfs /sys -t sysfs
  7. if [ -e /proc/cpu/alignment ]; then
  8. echo "3" > /proc/cpu/alignment
  9. fi
  10. echo 0 > /proc/sys/kernel/printk
  11. echo 100 > /sys/class/backlight/pwm-backlight/brightness
  12. mount_usb() {
  13. found=0
  14. for i in /dev/sda?;do
  15. if [ $i == "/dev/sda?" ];then
  16. break
  17. fi
  18. mount $i ${USB} 2>/dev/null
  19. if [ $? != 0 ];then
  20. continue
  21. fi
  22. return 0
  23. done
  24. # Try to mount a USB without partition table
  25. mount /dev/sda ${USB} 2>/dev/null
  26. return $?
  27. }
  28. rotation=0
  29. if [ -e /etc/rotation ]; then
  30. read rotation < /etc/rotation
  31. fi
  32. # wait until the device node is created
  33. echo "Checking for application software"
  34. echo "---------------------------------"
  35. echo " "
  36. cp /etc/fw_env.config /tmp/.
  37. while [ 1 ];do
  38. echo "Waiting for USB Pen..."
  39. sleep 3
  40. mount_usb
  41. if [ $? == 0 ];then
  42. break
  43. fi
  44. done
  45. echo " "
  46. echo "Starting Software Update"
  47. echo "------------------------"
  48. swupdate -i "${USB}/*.swu" -v
  49. if [ $? == 0 ];then
  50. echo "SUCCESS !"
  51. else
  52. echo "FAILURE !"
  53. fi
  54. while [ 1 ]; do
  55. echo "Please reboot the system !"
  56. sleep 90
  57. reboot
  58. done
  59. exit 0