[PATCH v2 0/6] Support for dumping capsule headers and empty capsules

Sughosh Ganu sughosh.ganu at linaro.org
Tue Oct 10 11:10:53 CEST 2023


These set of patches are intended for two tasks. The first set of
patches are adding support for dumping capsule header information,
which is then being used in the binman test framework for testing the
capsule generation. This replaces the current hardcoding of offsets
used for verifying the capsule contents in the binman tests.

Patch 1 introduces this functionality in the mkeficapsule tool. Patch
4 is using this functionality in the binman tests for capsules.

The other set of patches, 5 and 6 are for adding support for
generation of empty capsules in binman. The empty capsules are used
for the FWU A/B update functionality.

Changes since V1:
* Get rid of the superfluous hdr_size variable in the
  dump_fmp_payload_header() function
* Move the get_binman_test_guid() function outside the
  Entry_efi_capsule class so that it can be called from outside the
  module.
* Use lowercase characters in the GUID values
* Add comments for the _GetCapsuleHeaders() function.
* Use a simple dict in _GetCapsuleHeaders() for storing the capsule
  header values dumped by the mkeficapsule tool.
* Use a single boolean value to indicate the generation of either of
  accept/revert capsule.
* Move the parameters added to the list on the same line in a couple
  of places.
* Instead of using two separate boolean values, use a 'capsule-type'
  property for indicating generation of an accept/revert capsule.
* Make corresponding changes in the sanity checks, documentation and
  tests based on the above change.
* Use lower case characters for GUIDs.
* Call get_binman_test_guid() from the efi_capsule entry module.
* Add the documentation entry for the empty capsules in entries.rst.
* Remove the #[address,size]-cells properties from the test dts' for
  empty capsules.


Sughosh Ganu (6):
  tools: mkeficapsule: Add support to print capsule headers
  doc: capsule: Add documentation for the capsule dump feature
  binman: capsule: Remove superfluous [address,size]-cells properties
  binman: capsule: Use dumped capsule header contents for verification
  btool: mkeficapsule: Add support for EFI empty capsule generation
  binman: capsule: Add support for generating EFI empty capsules

 doc/develop/uefi/uefi.rst                     |  17 ++
 tools/binman/btool/mkeficapsule.py            |  26 ++
 tools/binman/entries.rst                      |  44 ++++
 tools/binman/etype/efi_capsule.py             |  24 +-
 tools/binman/etype/efi_empty_capsule.py       |  86 +++++++
 tools/binman/ftest.py                         | 160 +++++++++---
 tools/binman/test/311_capsule.dts             |   3 -
 tools/binman/test/312_capsule_signed.dts      |   3 -
 tools/binman/test/313_capsule_version.dts     |   3 -
 tools/binman/test/314_capsule_signed_ver.dts  |   3 -
 tools/binman/test/315_capsule_oemflags.dts    |   3 -
 tools/binman/test/316_capsule_missing_key.dts |   3 -
 .../binman/test/317_capsule_missing_index.dts |   3 -
 .../binman/test/318_capsule_missing_guid.dts  |   3 -
 tools/binman/test/319_capsule_accept.dts      |  13 +
 tools/binman/test/320_capsule_revert.dts      |  11 +
 .../test/321_capsule_accept_missing_guid.dts  |  11 +
 .../test/322_empty_capsule_type_missing.dts   |  12 +
 .../323_capsule_accept_revert_missing.dts     |  13 +
 tools/eficapsule.h                            |   2 +
 tools/mkeficapsule.c                          | 227 +++++++++++++++++-
 21 files changed, 599 insertions(+), 71 deletions(-)
 create mode 100644 tools/binman/etype/efi_empty_capsule.py
 create mode 100644 tools/binman/test/319_capsule_accept.dts
 create mode 100644 tools/binman/test/320_capsule_revert.dts
 create mode 100644 tools/binman/test/321_capsule_accept_missing_guid.dts
 create mode 100644 tools/binman/test/322_empty_capsule_type_missing.dts
 create mode 100644 tools/binman/test/323_capsule_accept_revert_missing.dts

-- 
2.34.1




More information about the U-Boot mailing list