diff options
author | John Crispin <john@phrozen.org> | 2020-06-04 14:26:11 +0200 |
---|---|---|
committer | John Crispin <john@phrozen.org> | 2020-06-07 17:53:37 +0200 |
commit | f72a2b004c3541b1834fe7af2ae69dcfcde8d338 (patch) | |
tree | 84a9d0d9341db4db44b1829a721525aa5d3cfc80 /target/linux/mediatek/mt7622 | |
parent | 55b97b688541b050e6d9f3f87c124c06fabe24ed (diff) | |
download | upstream-f72a2b004c3541b1834fe7af2ae69dcfcde8d338.tar.gz upstream-f72a2b004c3541b1834fe7af2ae69dcfcde8d338.tar.bz2 upstream-f72a2b004c3541b1834fe7af2ae69dcfcde8d338.zip |
mediatek: add bpi-r64 emmc support
Signed-off-by: John Crispin <john@phrozen.org>
Diffstat (limited to 'target/linux/mediatek/mt7622')
3 files changed, 43 insertions, 7 deletions
diff --git a/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network b/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network index 18ad24d046..b87a24fc2a 100755 --- a/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network @@ -9,7 +9,7 @@ mediatek_setup_interfaces() local board="$1" case $board in - 'elecom,wrc-2533gent') + *) ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6u@eth0" "5u@eth1" ;; diff --git a/target/linux/mediatek/mt7622/base-files/lib/preinit/79_move_config b/target/linux/mediatek/mt7622/base-files/lib/preinit/79_move_config new file mode 100644 index 0000000000..865a5fb90c --- /dev/null +++ b/target/linux/mediatek/mt7622/base-files/lib/preinit/79_move_config @@ -0,0 +1,20 @@ +#!/bin/sh + +. /lib/upgrade/common.sh + +RECOVERY_PART=/dev/mmcblk0p6 + +move_config() { + if [ -b $RECOVERY_PART ]; then + insmod nls_cp437 + insmod nls_iso8859-1 + insmod fat + insmod vfat + mkdir -p /recovery + mount -o rw,noatime $RECOVERY_PART /recovery + [ -f "/recovery/$BACKUP_FILE" ] && mv -f "/recovery/$BACKUP_FILE" / + umount /recovery + fi +} + +boot_hook_add preinit_mount_root move_config diff --git a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh index 42903f75a2..24b71ece63 100755 --- a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh @@ -2,6 +2,11 @@ platform_do_upgrade() { local board=$(board_name) case "$board" in + bananapi,bpi-r64-rootdisk) + #2097152=0x200000 is the offset in bytes from the start + #of eMMC and to the location of the kernel + get_image "$1" | dd of=/dev/mmcblk0 bs=2097152 seek=1 conv=fsync + ;; *) default_do_upgrade "$1" ;; @@ -17,19 +22,30 @@ platform_check_image() { [ "$#" -gt 1 ] && return 1 case "$board" in - elecom,wrc-2533gent) + *) [ "$magic" != "d00dfeed" ] && { echo "Invalid image type." return 1 } return 0 ;; - - *) - echo "Sysupgrade is not supported on your board yet." - return 1 - ;; esac return 0 } + +platform_copy_config_emmc() { + mkdir -p /recovery + mount -o rw,noatime /dev/mmcblk0p6 /recovery + cp -af "$UPGRADE_BACKUP" "/recovery/$BACKUP_FILE" + sync + umount /recovery +} + +platform_copy_config() { + case "$(board_name)" in + bananapi,bpi-r64-rootdisk) + platform_copy_config_emmc + ;; + esac +} |