diff options
author | John Crispin <john@phrozen.org> | 2018-05-07 12:07:32 +0200 |
---|---|---|
committer | John Crispin <john@phrozen.org> | 2018-05-24 22:11:55 +0200 |
commit | 050da2107a7eb2a571a8a3d0cee21cc6a44b72b8 (patch) | |
tree | 147c3b85ccae12e4b1659acd86ac93b13ecfa15d /target/linux/mediatek/base-files | |
parent | 4f67c1522d92bc4512c3ecf58c38ff9886530b48 (diff) | |
download | upstream-050da2107a7eb2a571a8a3d0cee21cc6a44b72b8.tar.gz upstream-050da2107a7eb2a571a8a3d0cee21cc6a44b72b8.tar.bz2 upstream-050da2107a7eb2a571a8a3d0cee21cc6a44b72b8.zip |
mediatek: backport upstream mediatek patches
Signed-off-by: John Crispin <john@phrozen.org>
Diffstat (limited to 'target/linux/mediatek/base-files')
-rw-r--r-- | target/linux/mediatek/base-files/etc/inittab | 2 | ||||
-rwxr-xr-x | target/linux/mediatek/base-files/lib/upgrade/platform.sh | 64 |
2 files changed, 23 insertions, 43 deletions
diff --git a/target/linux/mediatek/base-files/etc/inittab b/target/linux/mediatek/base-files/etc/inittab index b169c82745..9820e7144b 100644 --- a/target/linux/mediatek/base-files/etc/inittab +++ b/target/linux/mediatek/base-files/etc/inittab @@ -1,3 +1,3 @@ ::sysinit:/etc/init.d/rcS S boot ::shutdown:/etc/init.d/rcS K shutdown -ttyS0::askfirst:/usr/libexec/login.sh +::askconsole:/usr/libexec/login.sh diff --git a/target/linux/mediatek/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/base-files/lib/upgrade/platform.sh index 0429ca8b89..646ce0dc53 100755 --- a/target/linux/mediatek/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/base-files/lib/upgrade/platform.sh @@ -1,49 +1,29 @@ -# -# Copyright (C) 2016 OpenWrt.org -# +platform_do_upgrade() { + default_do_upgrade "$ARGV" +} -platform_do_upgrade() { - local tar_file="$1" - local board="$(board_name)" +PART_NAME=firmware - case "$(board_name)" in - mediatek,mt7623-rfb-nand-ephy |\ - mediatek,mt7623-rfb-nand) - nand_do_upgrade $1 - ;; - *) - echo "flashing kernel" - tar xf $tar_file sysupgrade-$board/kernel -O | mtd write - kernel +platform_check_image() { + local board=$(board_name) + local magic="$(get_magic_long "$1")" - echo "flashing rootfs" - tar xf $tar_file sysupgrade-$board/root -O | mtd write - rootfs + [ "$#" -gt 1 ] && return 1 - return 0 - ;; - esac -} + case "$board" in + bananapi,bpi-r2) + [ "$magic" != "27051956" ] && { + echo "Invalid image type." + return 1 + } + return 0 + ;; -platform_check_image() { - local tar_file="$1" - local board=$(board_name) - - case "$board" in - bananapi,bpi-r2 |\ - mediatek,mt7623a-rfb-emmc) - local kernel_length=`(tar xf $tar_file sysupgrade-$board/kernel -O | wc -c) 2> /dev/null` - local rootfs_length=`(tar xf $tar_file sysupgrade-$board/root -O | wc -c) 2> /dev/null` - ;; - - *) + *) echo "Sysupgrade is not supported on your board yet." - return 1 - ;; - esac - - [ "$kernel_length" = 0 -o "$rootfs_length" = 0 ] && { - echo "The upgarde image is corrupt." - return 1 - } + return 1 + ;; + esac - return 0 -} + return 0 +} |