SV: [PATCH V3] tplink-safeloader: Patch to handle partitions with alternate names

Sander Vanheule sander at svanheule.net
Thu May 12 07:24:37 PDT 2022


Hi Ole Kristian,

On Thu, 2022-05-12 at 14:47 +0200, Ole Kristian Lona wrote:
> > >                         info->soft_ver.text, len, info->part_trail);
> > >         }
> > >  
> > > @@ -3055,11 +3082,11 @@ static struct image_partition_entry 
> > > make_soft_version(
> > >         };
> > >  
> > >         if (info->soft_ver_compat_level == 0)
> > > -               return init_meta_partition_entry("soft-version", &s,
> > > +               return init_meta_partition_entry(name, &s,
> > >                         (uint8_t *)(&s.compat_level) - (uint8_t 
> > > *)(&s),
> > >                         info->part_trail);
> > >         else
> > > -               return init_meta_partition_entry("soft-version", &s,
> > > +               return init_meta_partition_entry(name, &s,
> > >                         sizeof(s), info->part_trail);
> > >  }
> > >  
> > 
> > Shouldn't you also modify make_support_list() and make_extra_para()?
> 
> I believe "support-list" will never change the name, and it definitely hasn't
> in the firmwares I have seen. It sounds more logical to me that they always
> keep that name, so any device can check the support list for any firmware.
> 
> Extra-para is only used for a very few devices, but I now added an option for
> using a different name for that as well.

Even if they aren't modified in this particular case, I was mainly worried about
consistency. The partition names are now all stored in the device_info struct,
so IMHO it would be cleaner to pull them all the info from there. Even if the
default is never changed. Otherwise it's a bit pointless to  store the partition
names in a modifiable container anyway.

Best,
Sander



More information about the openwrt-devel mailing list