mediatek: filogic: don't rely on image preset in flash or sysupgrade
authorDaniel Golle <daniel@makrotopia.org>
Tue, 18 Oct 2022 18:47:25 +0000 (19:47 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Tue, 18 Oct 2022 19:08:47 +0000 (20:08 +0100)
Instead of trying to figure out the actual root device, just use the
kernel 'root' cmdline parameter as a hint to decide which device to
flash to.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh

index 811e5133f2e469e0e40d2ec3879796bff3d6f4af..a9327ae282a5de63f4662b5375eb50d359581342 100755 (executable)
@@ -2,23 +2,20 @@ REQUIRE_IMAGE_METADATA=1
 
 platform_do_upgrade() {
        local board=$(board_name)
-       local file_type=$(identify $1)
 
        case "$board" in
        bananapi,bpi-r3)
-               export_bootdevice
-               export_partdevice rootdev 0
-               case "$rootdev" in
-               mmc*)
+               case "$(cmdline_get_var root)" in
+               /dev/mmc*)
                        CI_ROOTDEV="$rootdev"
                        CI_KERNPART="production"
                        emmc_do_upgrade "$1"
                        ;;
-               mtdblock*)
+               /dev/mtdblock*)
                        PART_NAME="fit"
                        default_do_upgrade "$1"
                        ;;
-               ubiblock*)
+               /dev/ubiblock*)
                        CI_KERNPART="fit"
                        nand_do_upgrade "$1"
                        ;;
@@ -58,10 +55,8 @@ platform_check_image() {
 platform_copy_config() {
        case "$(board_name)" in
        bananapi,bpi-r3)
-               export_bootdevice
-               export_partdevice rootdev 0
-               case "$rootdev" in
-               mmc*)
+               case "$(cmdline_get_var root)" in
+               /dev/mmc*)
                        emmc_copy_config
                        ;;
                esac