platform.sh 662 B

123456789101112131415161718192021222324252627
  1. platform_check_image() {
  2. [ "$ARGC" -gt 1 ] && return 1
  3. case "$(get_magic_word "$1")" in
  4. 48eb) return 0;;
  5. *)
  6. echo "Invalid image type"
  7. return 1
  8. ;;
  9. esac
  10. }
  11. platform_do_upgrade() {
  12. get_image "$1" > /dev/hda
  13. sync
  14. }
  15. x86_prepare_ext2() {
  16. # if we're running from ext2, we need to make sure that we have a mtd
  17. # partition that points to the active rootfs partition.
  18. # however this only matters if we actually need to preserve the config files
  19. [ "$SAVE_CONFIG" -eq 1 ] && return 0
  20. grep rootfs /proc/mtd >/dev/null || {
  21. echo /dev/hda2,65536,rootfs > /sys/module/block2mtd/parameters/block2mtd
  22. }
  23. }
  24. append sysupgrade_pre_upgrade x86_prepare_ext2