mbox series

[0/5] Extend mkeficapsule tool to pack multiple payloads

Message ID 20230616113426.13976-1-stefan.herbrechtsmeier-oss@weidmueller.com
Headers show
Series Extend mkeficapsule tool to pack multiple payloads | expand

Message

Stefan Herbrechtsmeier June 16, 2023, 11:34 a.m. UTC
From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>


Currently, the mkeficapsule tool supports at most one payload inside the
capsule. However, the UEFI specification and the u-boot code
support multiple payloads inside one capsule. Extend the tool by
this feature. The tool is kept backwards-compatible, so it can still
be used and called exactly as before if desired.


Malte Schmidt (5):
  mkeficapsule: constify function parameters
  mkeficapsule: add support for multiple payloads inside capsule
  test: efi_capsule: test a capsule update containing multiple images
  doc: uefi: update mkeficapsule documentation
  doc: uefi: clarify capsule concept

 doc/develop/uefi/uefi.rst                     |  73 +-
 test/py/tests/test_efi_capsule/conftest.py    |  18 +-
 .../test_capsule_firmware_raw.py              |  46 +-
 .../test_capsule_firmware_signed_raw.py       |  24 +-
 tools/eficapsule.h                            |   5 -
 tools/mkeficapsule.c                          | 651 +++++++++++++-----
 6 files changed, 622 insertions(+), 195 deletions(-)

Comments

AKASHI Takahiro June 17, 2023, 12:45 a.m. UTC | #1
On Fri, Jun 16, 2023 at 01:34:21PM +0200, Stefan Herbrechtsmeier wrote:
> From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
> 
> 
> Currently, the mkeficapsule tool supports at most one payload inside the
> capsule. However, the UEFI specification and the u-boot code
> support multiple payloads inside one capsule. Extend the tool by
> this feature. The tool is kept backwards-compatible, so it can still
> be used and called exactly as before if desired.

One of reasons why only a single image be included is that I didn't
see any strong reason to do so because U-Boot already has an archive
format of multiple images, named FIT. I wanted to utilize the existing
framework which is widely used on U-Boot and the current implementation
of FMP supports this format.
It seems to be just enough.

Do you have any useful use case of multiple images?

-Takahiro Akashi


> 
> Malte Schmidt (5):
>   mkeficapsule: constify function parameters
>   mkeficapsule: add support for multiple payloads inside capsule
>   test: efi_capsule: test a capsule update containing multiple images
>   doc: uefi: update mkeficapsule documentation
>   doc: uefi: clarify capsule concept
> 
>  doc/develop/uefi/uefi.rst                     |  73 +-
>  test/py/tests/test_efi_capsule/conftest.py    |  18 +-
>  .../test_capsule_firmware_raw.py              |  46 +-
>  .../test_capsule_firmware_signed_raw.py       |  24 +-
>  tools/eficapsule.h                            |   5 -
>  tools/mkeficapsule.c                          | 651 +++++++++++++-----
>  6 files changed, 622 insertions(+), 195 deletions(-)
> 
> -- 
> 2.30.2
>
Schmidt, Malte June 19, 2023, 11:15 a.m. UTC | #2
Hello Takahiro,

Am 17.06.2023 um 02:45 schrieb AKASHI Takahiro:
> On Fri, Jun 16, 2023 at 01:34:21PM +0200, Stefan Herbrechtsmeier wrote:
>> From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
>>
>>
>> Currently, the mkeficapsule tool supports at most one payload inside the
>> capsule. However, the UEFI specification and the u-boot code
>> support multiple payloads inside one capsule. Extend the tool by
>> this feature. The tool is kept backwards-compatible, so it can still
>> be used and called exactly as before if desired.
> One of reasons why only a single image be included is that I didn't
> see any strong reason to do so because U-Boot already has an archive
> format of multiple images, named FIT. I wanted to utilize the existing
> framework which is widely used on U-Boot and the current implementation
> of FMP supports this format.
> It seems to be just enough.
>
> Do you have any useful use case of multiple images?
>
> -Takahiro Akashi
>
thank you for the feedback. I did not of think of this as the solution
to our use case as I had my EFI view point glasses on. I will check if
we can use the existing solution for our use case.
However, I think the extension is either still valuable or some u-boot
code could be removed.

Currently, the u-boot EFI code allows for multiple payloads as does the
EFI specification. Are there any tests which test this part of the u-boot
code? AFAIK my extension of the mkeficapsule tool is the first that
allows for testing this u-boot code and does so with the accompanying
tests.

Another question is: Why does the support for multiple payloads inside a
capsule exists in the u-boot code basis in the first place?
Right now there seem to be two ways to update multiple
binaries with a capsule update (a FIT image and a capsule containing
multiple payloads). Either it should be a valid assumption that both 
features
can be used and the accompanying tools can be extended to help
make use of them or documentation should exist which points out
that only one of the solutions is acceptable.

Best Regards
Malte
>> Malte Schmidt (5):
>>    mkeficapsule: constify function parameters
>>    mkeficapsule: add support for multiple payloads inside capsule
>>    test: efi_capsule: test a capsule update containing multiple images
>>    doc: uefi: update mkeficapsule documentation
>>    doc: uefi: clarify capsule concept
>>
>>   doc/develop/uefi/uefi.rst                     |  73 +-
>>   test/py/tests/test_efi_capsule/conftest.py    |  18 +-
>>   .../test_capsule_firmware_raw.py              |  46 +-
>>   .../test_capsule_firmware_signed_raw.py       |  24 +-
>>   tools/eficapsule.h                            |   5 -
>>   tools/mkeficapsule.c                          | 651 +++++++++++++-----
>>   6 files changed, 622 insertions(+), 195 deletions(-)
>>
>> -- 
>> 2.30.2
>>