target: socfpga: Add Altera SoCFPGA support
[openwrt.git] / target / linux / socfpga / base-files / lib / upgrade / platform.sh
diff --git a/target/linux/socfpga/base-files/lib/upgrade/platform.sh b/target/linux/socfpga/base-files/lib/upgrade/platform.sh
new file mode 100755 (executable)
index 0000000..d65e11e
--- /dev/null
@@ -0,0 +1,37 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+
+. /lib/socfpga.sh
+
+RAMFS_COPY_BIN="/bin/mkdir /bin/touch /bin/mknod"
+RAMFS_COPY_DATA=/lib/socfpga.sh
+
+platform_check_image() {
+       local board=$(socfpga_board_name)
+
+       [ "$#" -gt 1 ] && return 1
+
+       case "$board" in
+       "socfpga-sockit")
+               platform_do_check_sockit "$ARGV"
+               return 0;
+               ;;
+       esac
+
+       echo "Sysupgrade is not yet supported on $board."
+       return 1
+}
+
+platform_do_upgrade() {
+       local board=$(socfpga_board_name)
+
+       case "$board" in
+       "socfpga-sockit")
+               platform_do_upgrade_sockit "$ARGV"
+               ;;
+       *)
+               default_do_upgrade "$ARGV"
+               ;;
+       esac
+}