[PATCH v2 1/2] uboot-envtools: add support for multiple config partitions

Adrian Schmutzler mail at adrianschmutzler.de
Wed Dec 16 09:34:02 EST 2020


Hi,

just a taste nitpick:

> --- a/package/boot/uboot-envtools/files/realtek
> +++ b/package/boot/uboot-envtools/files/realtek
> @@ -15,15 +15,21 @@ zyxel,gs1900-10hp)
>  	idx="$(find_mtd_index u-boot-env)"
>  	[ -n "$idx" ] && \
>  		ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x400"
> "0x10000"
> +	idx="$(find_mtd_index u-boot-env2)"
> +	[ -n "$idx" ] && \
> +		ubootenv_add_uci_sys_config "/dev/mtd$idx" "0x0"

I'd personally use a different variable name here, e.g. idx2, so it's clearly separated.

BTW, if you only need the variable once, you can directly use logic on the assignment:

+	idx2="$(find_mtd_index u-boot-env2)" &&
+		ubootenv_add_uci_sys_config "/dev/mtd$idx2" "0x0"

Best

Adrian 
-------------- 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/20201216/0f035c31/attachment.sig>


More information about the openwrt-devel mailing list