mediatek: filogic: fix sysupgrade on MMC on the BPi-R3
authorDaniel Golle <daniel@makrotopia.org>
Mon, 16 Jan 2023 21:02:00 +0000 (21:02 +0000)
committerDaniel Golle <daniel@makrotopia.org>
Mon, 16 Jan 2023 22:04:55 +0000 (22:04 +0000)
A previous attempt to simplify things went wrong and now sysupgrade
is broken on this device. Fix that.

Fixes: de94587e70 ("mediatek: filogic: don't rely on image preset in flash or sysupgrade")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh

index c2808bc7368f1a810e118409206436b6e5052b62..93b202218a8b7fdb10d84d8ce2fa418a8ad3eadb 100755 (executable)
@@ -43,17 +43,20 @@ platform_do_upgrade() {
 
        case "$board" in
        bananapi,bpi-r3)
-               case "$(cmdline_get_var root)" in
-               /dev/mmc*)
+               local rootdev="$(cmdline_get_var root)"
+               rootdev="${rootdev##*/}"
+               rootdev="${rootdev%p[0-9]*}"
+               case "$rootdev" in
+               mmc*)
                        CI_ROOTDEV="$rootdev"
                        CI_KERNPART="production"
                        emmc_do_upgrade "$1"
                        ;;
-               /dev/mtdblock*)
+               mtdblock*)
                        PART_NAME="fit"
                        default_do_upgrade "$1"
                        ;;
-               /dev/ubiblock*)
+               ubiblock*)
                        CI_KERNPART="fit"
                        nand_do_upgrade "$1"
                        ;;