octeon: add new target and support for Ubiquiti EdgeRouter 6P
[openwrt/openwrt.git] / target / linux / octeon / base-files / lib / upgrade / platform.sh
index 33a99312637740b0f9381510915f579df8da307d..255699bb31978725f1d213907b68bb535dee1ba6 100755 (executable)
@@ -29,6 +29,12 @@ platform_copy_config() {
                cp -af "$UPGRADE_BACKUP" "/mnt/$BACKUP_FILE"
                umount /mnt
                ;;
+       ubnt,edgerouter-4 | \
+       ubnt,edgerouter-6p)
+               mount -t vfat /dev/mmcblk0p1 /mnt
+               cp -af "$UPGRADE_BACKUP" "/mnt/$BACKUP_FILE"
+               umount /mnt
+               ;;
        esac
 }
 
@@ -78,7 +84,9 @@ platform_do_upgrade() {
 
        [ -b "${rootfs}" ] || return 1
        case "$board" in
-       er)
+       er | \
+       ubnt,edgerouter-4 | \
+       ubnt,edgerouter-6p)
                kernel=mmcblk0p1
                ;;
        erlite)
@@ -107,7 +115,9 @@ platform_check_image() {
        case "$board" in
        er | \
        erlite | \
-       itus,shield-router)
+       itus,shield-router | \
+       ubnt,edgerouter-4 | \
+       ubnt,edgerouter-6p)
                local kernel_length=$(tar xf $tar_file $board_dir/kernel -O | wc -c 2> /dev/null)
                local rootfs_length=$(tar xf $tar_file $board_dir/root -O | wc -c 2> /dev/null)
                [ "$kernel_length" = 0 -o "$rootfs_length" = 0 ] && {