platform.sh 729 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #
  2. # Copyright (C) 2009-2010 OpenWrt.org
  3. #
  4. . /lib/adm5120.sh
  5. PART_NAME="firmware"
  6. RAMFS_COPY_DATA=/lib/adm5120.sh
  7. platform_check_image() {
  8. local magic="$(get_magic_word "$1")"
  9. [ "$#" -gt 1 ] && return 1
  10. case "$board_name" in
  11. "ZyXEL"*|"Compex WP54 family")
  12. # .trx files
  13. [ "$magic" != "4844" ] && {
  14. echo "Invalid image type."
  15. return 1
  16. }
  17. return 0
  18. ;;
  19. *)
  20. ;;
  21. esac
  22. echo "Sysupgrade is not yet supported on $board_name."
  23. return 1
  24. }
  25. platform_do_upgrade() {
  26. PART_NAME="$sys_mtd_part"
  27. default_do_upgrade "$ARGV"
  28. }
  29. disable_watchdog() {
  30. killall watchdog
  31. ( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
  32. echo 'Could not disable watchdog'
  33. return 1
  34. }
  35. }
  36. append sysupgrade_pre_upgrade disable_watchdog