[PATCH v4] tplink-safeloader: Patch to handle partitions with alternate names.

Sander Vanheule sander at svanheule.net
Fri May 20 11:50:54 PDT 2022


Hi Ole Kristian,

Thanks for the updates, this has turned into a pretty clean patch :)

On Mon, 2022-05-16 at 15:50 +0200, Ole Kristian Lona wrote:
> Some devices, specifically Deco M4R-v3 / M5 have partition names that
> deviate from the scheme other devices use. They have an added "@0"
> and "@1" for some partition names.
> 
> The devices have fallback partitions which will be used in case the
> device determines that the primary partition set is unbootable.
> 
> This patch introduces an option to set these alternate partition names
> in the device definition of tplink-safeloader.
> 
> Signed-off-by: Ole Kristian Lona <oklo at oklona.net>

With one minor comment below:

Reviewed-by: Sander Vanheule <sander at svanheule.net>

> ---
> 
> @@ -2993,9 +3022,9 @@ static struct image_partition_entry make_partition_table(const struct
> flash_part
>         *(s++) = 0x00;
>  
>         size_t i;
> -       for (i = 0; p[i].name; i++) {
> +       for (i = 0; p->partitions[i].name; i++) {
>                 size_t len = end-s;
> -               size_t w = snprintf(s, len, "partition %s base 0x%05x size 0x%05x\n", p[i].name,
> p[i].base, p[i].size);
> +               size_t w = snprintf(s, len, "partition %s base 0x%05x size 0x%05x\n", p-
> >partitions[i].name, p->partitions[i].base, p->partitions[i].size);

If feel it would be better to split this line. There are long lines in this file, but 155 characters
seems a bit excessive.

As far as I'm concerned, you don't have to resubmit this patch if this is the only comment left.
Reflowing a single line can be done when merging.


Best,
Sander



More information about the openwrt-devel mailing list