developer | 538f2d1 | 2024-11-05 15:54:46 +0800 | [diff] [blame] | 1 | From: Weijie Gao <weijie.gao@mediatek.com> |
| 2 | Subject: [PATCH 4/8] mediatek: filogic: add support for MediaTek RBFs upgrade |
| 3 | |
| 4 | Add support for MediaTek RBFs upgrade (both normal and dual-image) |
| 5 | |
| 6 | Signed-off-by: Weijie Gao <weijie.gao@mediatek.com> |
| 7 | |
| 8 | --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh |
| 9 | +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh |
| 10 | @@ -1,5 +1,5 @@ |
| 11 | REQUIRE_IMAGE_METADATA=1 |
| 12 | -RAMFS_COPY_BIN='fitblk' |
| 13 | +RAMFS_COPY_BIN='fitblk blkid' |
| 14 | |
| 15 | asus_initial_setup() |
| 16 | { |
| 17 | @@ -64,6 +64,29 @@ platform_do_upgrade() { |
| 18 | local board=$(board_name) |
| 19 | |
| 20 | case "$board" in |
| 21 | + mediatek,mt7981-rfb|\ |
| 22 | + mediatek,mt7988a-rfb) |
| 23 | + [ -e /dev/fit0 ] && fitblk /dev/fit0 |
| 24 | + [ -e /dev/fitrw ] && fitblk /dev/fitrw |
| 25 | + export_fitblk_bootdev |
| 26 | + case "$CI_METHOD" in |
| 27 | + emmc) |
| 28 | + mmc_do_upgrade "$1" |
| 29 | + ;; |
| 30 | + default) |
| 31 | + default_do_upgrade "$1" |
| 32 | + ;; |
| 33 | + ubi) |
| 34 | + CI_KERNPART="firmware" |
| 35 | + ubi_do_upgrade "$1" |
| 36 | + ;; |
| 37 | + *) |
| 38 | + if grep \"rootfs_data\" /proc/mtd; then |
| 39 | + default_do_upgrade "$1" |
| 40 | + fi |
| 41 | + ;; |
| 42 | + esac |
| 43 | + ;; |
| 44 | abt,asr3000|\ |
| 45 | bananapi,bpi-r3|\ |
| 46 | bananapi,bpi-r3-mini|\ |
| 47 | @@ -175,6 +198,8 @@ platform_check_image() { |
| 48 | [ "$#" -gt 1 ] && return 1 |
| 49 | |
| 50 | case "$board" in |
| 51 | + mediatek,mt7981-rfb|\ |
| 52 | + mediatek,mt7988a-rfb|\ |
| 53 | bananapi,bpi-r3|\ |
| 54 | bananapi,bpi-r3-mini|\ |
| 55 | bananapi,bpi-r4|\ |
| 56 | @@ -197,6 +222,8 @@ platform_check_image() { |
| 57 | |
| 58 | platform_copy_config() { |
| 59 | case "$(board_name)" in |
| 60 | + mediatek,mt7981-rfb|\ |
| 61 | + mediatek,mt7988a-rfb|\ |
| 62 | bananapi,bpi-r3|\ |
| 63 | bananapi,bpi-r3-mini|\ |
| 64 | bananapi,bpi-r4|\ |