developer | 95b9263 | 2024-06-25 17:37:19 +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 | { |
developer | f2fbad6 | 2024-07-24 17:33:36 +0800 | [diff] [blame] | 17 | @@ -64,6 +64,29 @@ platform_do_upgrade() { |
developer | 95b9263 | 2024-06-25 17:37:19 +0800 | [diff] [blame] | 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 |
developer | f2fbad6 | 2024-07-24 17:33:36 +0800 | [diff] [blame] | 25 | + export_fitblk_bootdev |
| 26 | + case "$CI_METHOD" in |
| 27 | + emmc) |
developer | 95b9263 | 2024-06-25 17:37:19 +0800 | [diff] [blame] | 28 | + mmc_do_upgrade "$1" |
| 29 | + ;; |
developer | f2fbad6 | 2024-07-24 17:33:36 +0800 | [diff] [blame] | 30 | + default) |
developer | 95b9263 | 2024-06-25 17:37:19 +0800 | [diff] [blame] | 31 | + default_do_upgrade "$1" |
| 32 | + ;; |
developer | f2fbad6 | 2024-07-24 17:33:36 +0800 | [diff] [blame] | 33 | + ubi) |
developer | 95b9263 | 2024-06-25 17:37:19 +0800 | [diff] [blame] | 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 | + ;; |
developer | f2fbad6 | 2024-07-24 17:33:36 +0800 | [diff] [blame] | 44 | abt,asr3000|\ |
| 45 | bananapi,bpi-r3|\ |
| 46 | bananapi,bpi-r3-mini|\ |
| 47 | @@ -175,6 +198,8 @@ platform_check_image() { |
developer | 95b9263 | 2024-06-25 17:37:19 +0800 | [diff] [blame] | 48 | [ "$#" -gt 1 ] && return 1 |
| 49 | |
| 50 | case "$board" in |
| 51 | + mediatek,mt7981-rfb|\ |
| 52 | + mediatek,mt7988a-rfb|\ |
| 53 | bananapi,bpi-r3|\ |
developer | f2fbad6 | 2024-07-24 17:33:36 +0800 | [diff] [blame] | 54 | bananapi,bpi-r3-mini|\ |
developer | 95b9263 | 2024-06-25 17:37:19 +0800 | [diff] [blame] | 55 | bananapi,bpi-r4|\ |
developer | f2fbad6 | 2024-07-24 17:33:36 +0800 | [diff] [blame] | 56 | @@ -197,6 +222,8 @@ platform_check_image() { |
developer | 95b9263 | 2024-06-25 17:37:19 +0800 | [diff] [blame] | 57 | |
| 58 | platform_copy_config() { |
| 59 | case "$(board_name)" in |
| 60 | + mediatek,mt7981-rfb|\ |
developer | f2fbad6 | 2024-07-24 17:33:36 +0800 | [diff] [blame] | 61 | + mediatek,mt7988a-rfb|\ |
| 62 | bananapi,bpi-r3|\ |
| 63 | bananapi,bpi-r3-mini|\ |
| 64 | bananapi,bpi-r4|\ |