[PATCH 1/3] binman: Ignore hash*, signature* nodes in sections

Simon Glass sjg at chromium.org
Sat Aug 29 23:20:43 CEST 2020


Hi Alper,

On Tue, 25 Aug 2020 at 12:01, Alper Nebi Yasak <alpernebiyasak at gmail.com> wrote:
>
> Switch to str.startswith for matching like the FIT etype does since the
> current version doesn't ignore 'hash-1', 'hash-2', etc.
>
> Signed-off-by: Alper Nebi Yasak <alpernebiyasak at gmail.com>
> ---
>
>  tools/binman/etype/section.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py
> index 73c5553c81..c5166a5b57 100644
> --- a/tools/binman/etype/section.py
> +++ b/tools/binman/etype/section.py
> @@ -83,7 +83,7 @@ class Entry_section(Entry):
>
>      def _ReadEntries(self):
>          for node in self._node.subnodes:
> -            if node.name == 'hash':
> +            if node.name.startswith('hash') or node.name.startswith('signature'):
>                  continue
>              entry = Entry.Create(self, node)
>              entry.ReadNode()
> --
> 2.28.0
>

This looks like right but please add a test or update an existing one,
since code coverage is missing with this patch (binman test -T).

Regards,
Simon


On Tue, 25 Aug 2020 at 12:01, Alper Nebi Yasak <alpernebiyasak at gmail.com> wrote:
>
> Switch to str.startswith for matching like the FIT etype does since the
> current version doesn't ignore 'hash-1', 'hash-2', etc.
>
> Signed-off-by: Alper Nebi Yasak <alpernebiyasak at gmail.com>
> ---
>
>  tools/binman/etype/section.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py
> index 73c5553c81..c5166a5b57 100644
> --- a/tools/binman/etype/section.py
> +++ b/tools/binman/etype/section.py
> @@ -83,7 +83,7 @@ class Entry_section(Entry):
>
>      def _ReadEntries(self):
>          for node in self._node.subnodes:
> -            if node.name == 'hash':
> +            if node.name.startswith('hash') or node.name.startswith('signature'):
>                  continue
>              entry = Entry.Create(self, node)
>              entry.ReadNode()
> --
> 2.28.0
>


More information about the U-Boot mailing list