platform.sh 628 B

123456789101112131415161718192021222324252627282930313233
  1. #
  2. # Copyright (C) 2011 OpenWrt.org
  3. #
  4. PART_NAME=firmware
  5. REQUIRE_IMAGE_METADATA=1
  6. routerstation_do_upgrade() {
  7. local append
  8. local kern_length=0x$(dd if="$1" bs=2 skip=1 count=4 2>/dev/null)
  9. [ -f "$CONF_TAR" -a "$SAVE_CONFIG" -eq 1 ] && append="-j $CONF_TAR"
  10. dd if="$1" bs=64k skip=1 2>/dev/null | \
  11. mtd -r $append -Fkernel:$kern_length:0x80060000,rootfs write - kernel:rootfs
  12. }
  13. platform_check_image() {
  14. return 0
  15. }
  16. platform_do_upgrade() {
  17. local board=$(board_name)
  18. case "$board" in
  19. ubnt,routerstation|\
  20. ubnt,routerstation-pro)
  21. routerstation_do_upgrade "$ARGV"
  22. ;;
  23. *)
  24. default_do_upgrade "$ARGV"
  25. ;;
  26. esac
  27. }