mbox series

[0/8] Add some more EFI capsule tooling support

Message ID 20230908120002.29851-1-sughosh.ganu@linaro.org
Headers show
Series Add some more EFI capsule tooling support | expand

Message

Sughosh Ganu Sept. 8, 2023, 11:59 a.m. UTC
Recently, a set of patches were merged in next, which were adding
support for generating capsules as part of the U-Boot build. Mid way
through the review of those patches, it was decided to drop the
patches for generating capsules through a config file. That was
primarily due to the use of absolute paths in binman for testing the
capsule genertion through config file. Now that the base set of
patches have been merged, this series is picking up the remaining
patches for review. This series addresses the concern that Simon Glass
had with the use of absolute paths.

The first set of patches are adding support for generating capsules by
parsing the capsule parameters through a config file, and adding a
binman entry type for this. These are patches 1-5.

The other set of patches is for generating empty accept and revert
capsules through binman. These capsules are needed for the FWU A/B
update functionality.


Sughosh Ganu (8):
  tools: mkeficapsule: Add support for parsing capsule params from
    config file
  btool: mkeficapsule: Generate capsule through a config file
  binman: capsule: Generate capsules through config file
  doc: Document capsule generation through a config file
  sandbox: capsule: Add a config file for generating capsules
  test: capsule: Generate capsules through config file
  btool: mkeficapsule: Add support for EFI empty capsule generation
  binman: capsule: Add support for generating EFI empty capsules

 configs/sandbox_defconfig                     |   2 +
 doc/develop/uefi/uefi.rst                     |  70 ++++
 .../test_efi_capsule/capsule_gen_binman.dts   |   8 +
 test/py/tests/test_efi_capsule/conftest.py    |  18 +-
 .../test_efi_capsule/sandbox_capsule_cfg.txt  | 162 ++++++++
 tools/Kconfig                                 |  16 +
 tools/Makefile                                |   1 +
 tools/binman/btool/mkeficapsule.py            |  45 +++
 tools/binman/entries.rst                      |  35 ++
 tools/binman/etype/efi_capsule_cfg_file.py    |  66 ++++
 tools/binman/etype/efi_empty_capsule.py       |  91 +++++
 tools/binman/ftest.py                         |  81 ++++
 tools/binman/test/319_capsule_cfg.dts         |  15 +
 tools/binman/test/320_capsule_accept.dts      |  16 +
 tools/binman/test/321_capsule_revert.dts      |  14 +
 .../test/322_capsule_accept_missing_guid.dts  |  14 +
 .../binman/test/323_capsule_accept_revert.dts |  17 +
 tools/eficapsule.h                            | 115 ++++++
 tools/mkeficapsule.c                          |  87 +++--
 tools/mkeficapsule_parse.c                    | 352 ++++++++++++++++++
 20 files changed, 1190 insertions(+), 35 deletions(-)
 create mode 100644 test/py/tests/test_efi_capsule/sandbox_capsule_cfg.txt
 create mode 100644 tools/binman/etype/efi_capsule_cfg_file.py
 create mode 100644 tools/binman/etype/efi_empty_capsule.py
 create mode 100644 tools/binman/test/319_capsule_cfg.dts
 create mode 100644 tools/binman/test/320_capsule_accept.dts
 create mode 100644 tools/binman/test/321_capsule_revert.dts
 create mode 100644 tools/binman/test/322_capsule_accept_missing_guid.dts
 create mode 100644 tools/binman/test/323_capsule_accept_revert.dts
 create mode 100644 tools/mkeficapsule_parse.c

Comments

Tom Rini Sept. 13, 2023, 7:24 p.m. UTC | #1
On Fri, Sep 08, 2023 at 05:29:54PM +0530, Sughosh Ganu wrote:

> Recently, a set of patches were merged in next, which were adding
> support for generating capsules as part of the U-Boot build. Mid way
> through the review of those patches, it was decided to drop the
> patches for generating capsules through a config file. That was
> primarily due to the use of absolute paths in binman for testing the
> capsule genertion through config file. Now that the base set of
> patches have been merged, this series is picking up the remaining
> patches for review. This series addresses the concern that Simon Glass
> had with the use of absolute paths.
> 
> The first set of patches are adding support for generating capsules by
> parsing the capsule parameters through a config file, and adding a
> binman entry type for this. These are patches 1-5.
> 
> The other set of patches is for generating empty accept and revert
> capsules through binman. These capsules are needed for the FWU A/B
> update functionality.

I think what we really need next is to be able to implement and document
how to use the capsule (and FWU!) spec / mechanisms on another platform
and I think the Synquacer DeveloperBox would be a good target here as I
believe you have access to one and so does Simon to we can deal with
feedback on a real platform that both of you have access to.
Sughosh Ganu Sept. 14, 2023, 12:12 p.m. UTC | #2
hi Tom,

On Thu, 14 Sept 2023 at 00:54, Tom Rini <trini@konsulko.com> wrote:
>
> On Fri, Sep 08, 2023 at 05:29:54PM +0530, Sughosh Ganu wrote:
>
> > Recently, a set of patches were merged in next, which were adding
> > support for generating capsules as part of the U-Boot build. Mid way
> > through the review of those patches, it was decided to drop the
> > patches for generating capsules through a config file. That was
> > primarily due to the use of absolute paths in binman for testing the
> > capsule genertion through config file. Now that the base set of
> > patches have been merged, this series is picking up the remaining
> > patches for review. This series addresses the concern that Simon Glass
> > had with the use of absolute paths.
> >
> > The first set of patches are adding support for generating capsules by
> > parsing the capsule parameters through a config file, and adding a
> > binman entry type for this. These are patches 1-5.
> >
> > The other set of patches is for generating empty accept and revert
> > capsules through binman. These capsules are needed for the FWU A/B
> > update functionality.
>
> I think what we really need next is to be able to implement and document
> how to use the capsule (and FWU!) spec / mechanisms on another platform
> and I think the Synquacer DeveloperBox would be a good target here as I
> believe you have access to one and so does Simon to we can deal with
> feedback on a real platform that both of you have access to.

That should be possible. And although I personally don't have access
to the board, folks in the team do(including Ilias). I will work on
this once the patches for supporting empty capsules in binman get
merged.

-sughosh
Tom Rini Sept. 14, 2023, 1:24 p.m. UTC | #3
On Thu, Sep 14, 2023 at 05:42:49PM +0530, Sughosh Ganu wrote:
> hi Tom,
> 
> On Thu, 14 Sept 2023 at 00:54, Tom Rini <trini@konsulko.com> wrote:
> >
> > On Fri, Sep 08, 2023 at 05:29:54PM +0530, Sughosh Ganu wrote:
> >
> > > Recently, a set of patches were merged in next, which were adding
> > > support for generating capsules as part of the U-Boot build. Mid way
> > > through the review of those patches, it was decided to drop the
> > > patches for generating capsules through a config file. That was
> > > primarily due to the use of absolute paths in binman for testing the
> > > capsule genertion through config file. Now that the base set of
> > > patches have been merged, this series is picking up the remaining
> > > patches for review. This series addresses the concern that Simon Glass
> > > had with the use of absolute paths.
> > >
> > > The first set of patches are adding support for generating capsules by
> > > parsing the capsule parameters through a config file, and adding a
> > > binman entry type for this. These are patches 1-5.
> > >
> > > The other set of patches is for generating empty accept and revert
> > > capsules through binman. These capsules are needed for the FWU A/B
> > > update functionality.
> >
> > I think what we really need next is to be able to implement and document
> > how to use the capsule (and FWU!) spec / mechanisms on another platform
> > and I think the Synquacer DeveloperBox would be a good target here as I
> > believe you have access to one and so does Simon to we can deal with
> > feedback on a real platform that both of you have access to.
> 
> That should be possible. And although I personally don't have access
> to the board, folks in the team do(including Ilias). I will work on
> this once the patches for supporting empty capsules in binman get
> merged.

We need to make this the next task as not being able to put this to use
on a real platform today is blocking understanding of what abstractions
do and don't make real sense.  To tie this to another thread, since it's
not really clear how a real platform would make use of capsules it's not
really clear what sandbox should make every time.