[PATCH v2 02/10] binman: Make compressed data header optional
Simon Glass
sjg at chromium.org
Mon Aug 15 19:37:55 CEST 2022
Hi Stefan,
On Mon, 15 Aug 2022 at 01:09, Stefan Herbrechtsmeier
<stefan.herbrechtsmeier-oss at weidmueller.com> wrote:
>
> Hi Simon,
>
> Am 13.08.2022 um 16:59 schrieb Simon Glass:
> > Hi Stefan,
> >
> > On Mon, 8 Aug 2022 at 04:51, Stefan Herbrechtsmeier
[..]
> >> # This is imported if needed
> >> state = None
> >> @@ -17,6 +19,9 @@ class Entry_blob_dtb(Entry_blob):
> >> This is a blob containing a device tree. The contents of the blob are
> >> obtained from the list of available device-tree files, managed by the
> >> 'state' module.
> >> +
> >> + Additional attributes:
> >> + prepend: Header used (e.g. 'length'), 'none' if none
> >> """
> >> def __init__(self, section, etype, node):
> >> # Put this here to allow entry-docs and help to work without libfdt
> >> @@ -25,6 +30,12 @@ class Entry_blob_dtb(Entry_blob):
> >>
> >> super().__init__(section, etype, node)
> >>
> >> + self.prepend = 'none'
> >
> > None ?
>
> I copy this from the compress attribute. You only need one check to
> support a missing value or a 'none' value. But I don't need this check
> and can use None.
OK I see. The idea there was that people might want to explicitly say
'none'. I;m not sure how use that is, particularly with prepend, but
I'm OK with either way.
>
> >
> >> +
> >> + def ReadNode(self):
> >> + super().ReadNode()
> >> + self.prepend = fdt_util.GetString(self._node, 'prepend', 'none')
> >
> > Can you drop the 'none' so that it uses None instead?
>
> Is 'none' a valid entry? Do we need to distinguish between 'none' and an
> invalid value?
Eventually we do...but for now bad things happen. See the TODO in
binman for some of that.
>
> > Aso we should check for a valid value here - e.g. it must be 'length'
> > and not something else, otherwise self.Raise()
>
> Okay. I will remove the 'none' and only support 'length'.
As above, up to you. I had forgotten about the compress thing.
Regards,
Simon
More information about the U-Boot
mailing list