[PATCH 3/4] mediatek: mt7622: add ubi support for bananapi bpi-r64

Adrian Schmutzler mail at adrianschmutzler.de
Mon Apr 5 19:38:13 BST 2021


Hi,

> -----Original Message-----
> From: openwrt-devel [mailto:openwrt-devel-bounces at lists.openwrt.org]
> On Behalf Of Oskari Lemmela
> Sent: Montag, 5. April 2021 19:53
> To: openwrt-devel at lists.openwrt.org
> Cc: Oskari Lemmela <oskari at lemmela.net>
> Subject: [PATCH 3/4] mediatek: mt7622: add ubi support for bananapi bpi-r64

Patches 3 and 4 lack a commit message. That's mandatory.

An additional comment below.

> 
> Signed-off-by: Oskari Lemmela <oskari at lemmela.net>
> ---
>  package/boot/uboot-envtools/files/mediatek    | 14 ++++++--
>  .../mt7622/base-files/lib/upgrade/platform.sh | 34 +++++++++++++------
>  2 files changed, 34 insertions(+), 14 deletions(-)
> 
> diff --git a/package/boot/uboot-envtools/files/mediatek
> b/package/boot/uboot-envtools/files/mediatek
> index 50269c9500..85d7db206d 100644
> --- a/package/boot/uboot-envtools/files/mediatek
> +++ b/package/boot/uboot-envtools/files/mediatek
> @@ -21,9 +21,17 @@ case "$board" in
>  	. /lib/upgrade/common.sh
>  	export_bootdevice
>  	export_partdevice rootdev 0
> -	local envdev=/dev/$(get_partition_by_name $rootdev ubootenv)
> -	ubootenv_add_uci_config "$envdev" "0x0" "0x80000" "0x80000" "1"
> -	ubootenv_add_uci_config "$envdev" "0x80000" "0x80000" "0x80000"
> "1"
> +	case "$rootdev" in
> +	mmc*)
> +		local envdev=/dev/$(get_partition_by_name $rootdev
> ubootenv)
> +		ubootenv_add_uci_config "$envdev" "0x0" "0x80000"
> "0x80000" "1"
> +		ubootenv_add_uci_config "$envdev" "0x80000" "0x80000"
> "0x80000" "1"
> +		;;
> +	ubi*)
> +		ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x1f000"
> "0x1f000" "1"
> +		ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x1f000"
> "0x1f000" "1"
> +		;;
> +	esac

Are you sure these globs will work in each and every case?

Best

Adrian

>  	;;
>  buffalo,wsr-2533dhp2)
>  	ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x1000" "0x20000"
> 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 2c1460650f..3a36f8ae1f 100755
> --- a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh
> @@ -10,16 +10,24 @@ platform_do_upgrade() {
>  	bananapi,bpi-r64)
>  		export_bootdevice
>  		export_partdevice rootdev 0
> -		local fitpart=$(get_partition_by_name $rootdev
> "production")
> -		[ "$fitpart" ] || return 1
> -		dd if=/dev/zero of=/dev/$fitpart bs=4096 count=1
> 2>/dev/null
> -		blockdev --rereadpt /dev/$rootdev
> -		get_image "$1" | dd of=/dev/$fitpart
> -		blockdev --rereadpt /dev/$rootdev
> -		local datapart=$(get_partition_by_name $rootdev
> "rootfs_data")
> -		[ "$datapart" ] || return 0
> -		dd if=/dev/zero of=/dev/$datapart bs=4096 count=1
> 2>/dev/null
> -		echo $datapart > /tmp/sysupgrade.datapart
> +		case "$rootdev" in
> +		mmc*)
> +			local fitpart=$(get_partition_by_name $rootdev
> "production")
> +			[ "$fitpart" ] || return 1
> +			dd if=/dev/zero of=/dev/$fitpart bs=4096 count=1
> 2>/dev/null
> +			blockdev --rereadpt /dev/$rootdev
> +			get_image "$1" | dd of=/dev/$fitpart
> +			blockdev --rereadpt /dev/$rootdev
> +			local datapart=$(get_partition_by_name $rootdev
> "rootfs_data")
> +			[ "$datapart" ] || return 0
> +			dd if=/dev/zero of=/dev/$datapart bs=4096 count=1
> 2>/dev/null
> +			echo $datapart > /tmp/sysupgrade.datapart
> +			;;
> +		ubi*)
> +			CI_KERNPART="fit"
> +			nand_do_upgrade "$1"
> +			;;
> +		esac
>  		;;
>  	buffalo,wsr-2533dhp2)
>  		local magic="$(get_magic_long "$1")"
> @@ -87,7 +95,11 @@ platform_copy_config_mmc() {
>  platform_copy_config() {
>  	case "$(board_name)" in
>  	bananapi,bpi-r64)
> -		platform_copy_config_mmc
> +		export_bootdevice
> +		export_partdevice rootdev 0
> +		if echo $rootdev | grep -q mmc; then
> +			platform_copy_config_mmc
> +		fi
>  		;;
>  	esac
>  }
> --
> 2.25.1
> 
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openpgp-digital-signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.openwrt.org/pipermail/openwrt-devel/attachments/20210405/cf0ba618/attachment.sig>


More information about the openwrt-devel mailing list