ar71xx: mikrotik: fix upgrading beyond 19.07 using sysupgrade openwrt-19.07
authorKoen Vandeputte <koen.vandeputte@citymesh.com>
Fri, 2 Apr 2021 14:10:47 +0000 (16:10 +0200)
committerKoen Vandeputte <koen.vandeputte@ncentric.com>
Fri, 5 Nov 2021 12:10:26 +0000 (13:10 +0100)
Newer releases uses a different path within sysupgrade to store files.

This leads to sysupgrade currently being broken when trying to upgrade
MikroTik devices to this newer model, even when using the Force flag.

Fix this by trying the newer location for verification if the standard
one fails.

This patch allows to easily use sysupgrade for upgrading Mikrotik
devices beyond 19.07 releases.

Using RB922 as an example:

boardname --> rb-922uags-5hpacd

sysupgrade archive main folder name:

Within 19.07 -->  sysupgrade-mikrotik/
Beyond 19.07 -->  sysupgrade-mikrotik_routerboard-922uags-5hpacd/

Signed-off-by: Koen Vandeputte <koen.vandeputte@citymesh.com>
target/linux/ar71xx/base-files/lib/upgrade/platform.sh

index f44cdb061f749ce9a4066fdcf6429670af1b8214..9e4c0a8731b1db83c52e0650ca96b5144173efa1 100755 (executable)
@@ -571,7 +571,8 @@ platform_check_image() {
        rb-2011uias-2hnd-r2|\
        rb-sxt2n|\
        rb-sxt5n)
-               nand_do_platform_check routerboard $1
+               nand_do_platform_check routerboard $1  ||
+               nand_do_platform_check mikrotik_routerboard-$(echo "$board" | cut -c 4- ) $1
                return $?
                ;;
        c-60|\