[PATCH v2 1/2] uboot-envtools: add support for multiple config partitions
Bjørn Mork
bjorn at mork.no
Tue Apr 6 10:41:34 BST 2021
"Adrian Schmutzler" <mail at adrianschmutzler.de> writes:
>> --- 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.
fixing up for v3
> 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"
Hmm, this doesn't work for me... And it doesn't match existing patterns
in the package. This is not the same:
$ idx2="";[ -n "$idx2" ] && echo "idx2=$idx2"
$ idx2="" && echo "idx2=$idx2"
idx2=
Am I misunderstanding your comment?
Bjørn
More information about the openwrt-devel
mailing list