mvebu: add sysupgrade support for clearfog
[openwrt/openwrt.git] / target / linux / mvebu / base-files / lib / upgrade / linksys.sh
index fc40333..baa29dc 100644 (file)
@@ -74,13 +74,18 @@ platform_do_upgrade_linksys() {
 }
 
 linksys_preupgrade() {
-       export RAMFS_COPY_BIN="${RAMFS_COPY_BIN} /usr/sbin/fw_printenv /usr/sbin/fw_setenv"
-       export RAMFS_COPY_BIN="${RAMFS_COPY_BIN} /bin/mkdir /bin/touch"
-       export RAMFS_COPY_DATA="${RAMFS_COPY_DATA} /etc/fw_env.config /var/lock/fw_printenv.lock"
+       local board=$(mvebu_board_name)
 
-       [ -f /tmp/sysupgrade.tgz ] && {
-               cp /tmp/sysupgrade.tgz /tmp/syscfg/sysupgrade.tgz
-       }
+       case "$board" in
+       armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-shelby|armada-xp-linksys-mamba)
+               export RAMFS_COPY_BIN="${RAMFS_COPY_BIN} /usr/sbin/fw_printenv /usr/sbin/fw_setenv"
+               export RAMFS_COPY_BIN="${RAMFS_COPY_BIN} /bin/mkdir /bin/touch"
+               export RAMFS_COPY_DATA="${RAMFS_COPY_DATA} /etc/fw_env.config /var/lock/fw_printenv.lock"
+
+               [ -f /tmp/sysupgrade.tgz ] && {
+                       cp /tmp/sysupgrade.tgz /tmp/syscfg/sysupgrade.tgz
+               }
+               ;;
+       esac
 }
 
-append sysupgrade_pre_upgrade linksys_preupgrade