Re: [PATCH v2 0/6] Add support for fwumdata

Kory Maincent
2025-12-18T13:49:20Z

Hello Ilias,

On Thu, 18 Dec 2025 14:04:12 +0200
Ilias Apalodimas <ilias.apalodimas@linaro.org> wrote:

> Hi Kory,
>
> I haven't lost track of this, I'll try to have a look as soon as I can.
> For the record, I still don't think this is a great idea. I'd rather
> have people follow the design docs.

I don't get it. What are your arguments against this tool? It is a simple way
to change the content of the FWU metadata from Linux.

> I understand the acceptance capsule feels 'weird', but there was a
> good reason for it. There's a PR with an update to the spec, which
> makes the acceptance substantially easier now that all the ecosystem
> parts are in place [0[
>
> [0] https://github.com/ARM-software/edge-iot-arch-guide/pull/21

This design guideline is for one use case of FWU Metadata. It needs UEFI and
capsule update.

FWU Metadata is an update standard for ARM architecture, it is not dependent on
the implementation. UEFI with capsule update is one implementation, but we could
have others.
https://documentation-service.arm.com/static/660be6391bc22b03bca92702

On my case (ST board) there is no UEFI, I have TF-A (FSBL) that reads the FWU
metadata to know the location of the FIP Image (SSBL which contain U-boot and
OPTEE).
During the OTA process, Linux is updating the FWU metadata to change the active
bank and the bank state with this new fwumdata tool.

Note that the previous development of FWU support in U-boot as not been
developed in a generic way but bound to the UEFI capsule framework which is not
ideal. On my case if I want to read FWU metadata in U-boot I have to enable the
UEFI capsule config for nothing.

Regards,

>
> Cheers
> /Ilias
>
> On Fri, 12 Dec 2025 at 18:23, Kory Maincent <kory.maincent@bootlin.com> wrote:
> >
> > Add a new fwumdata tool to allows users to read, display, and modify FWU
> > (Firmware Update) metadata from Linux userspace. It provides functionality
> > similar to fw_printenv/fw_setenv but for FWU metadata. Users can view
> > metadata, change active/previous bank indices, modify bank states, and set
> > image acceptance flags. Configuration is done via fwumdata.config file.
> >
> > Made a few change to mkfwumdata tool along the way.
> >
> > Here is an output example
> >
> > $ ./fwumdata -l
> > FWU Metadata:
> > Version: 2
> > Active Index: 0
> > Previous Index: 1
> > CRC32: 0x1f21ff7b
> > Metadata Size: 120 bytes
> > Descriptor Offset: 32
> > Bank States:
> > Bank 0: accepted (0xfc)
> > Bank 1: accepted (0xfc)
> >
> > Firmware Store Descriptor:
> > Number of Banks: 2
> > Number of Images: 1
> > Image Entry Size: 80
> > Bank Info Entry Size: 24
> >
> > Images:
> > Image 0:
> > Image Type GUID:
> > 65ae85ad-1fb3-0b46-8c5d-285543aa6eab Location GUID:
> > 51513491-da07-2a4f-9bea-375ea53b1b5c Banks:
> > Bank 0:
> > Image GUID:
> > cb2df442-f929-6a44-a374-672d92eb2aa7 Accepted: yes (1)
> > Bank 1:
> > Image GUID:
> > a839a18f-395c-484f-83b8-0354077c8f9f Accepted: yes (1)
> >
> > Changes in v2:
> > - Fix a small offset mistake in last patch
> >
> > Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
> > ---
> > Kory Maincent (6):
> > tools: gitignore: Add mkfwumdata to the git ignore file
> > tools: Reorganize mkfwumdata tool into fwumdata_src directory
> > tools: mkfwumdata: Improve error message specificity
> > tools: mkfwumdata: Add bank count validation for FWU metadata v2
> > tools: Add support for fwumdata tool
> > tools: mkfwumdata: Remove dependency on fwu_mdata.h header
> >
> > MAINTAINERS | 7 +-
> > doc/develop/uefi/fwu_updates.rst | 4 +-
> > doc/fwumdata.1 | 222 +++++++++
> > tools/.gitignore | 2 +
> > tools/Kconfig | 9 +-
> > tools/Makefile | 4 +-
> > tools/fwumdata_src/Kconfig | 19 +
> > tools/fwumdata_src/fwumdata.c | 854
> > ++++++++++++++++++++++++++++++++++ tools/fwumdata_src/fwumdata.config |
> > 33 ++ tools/fwumdata_src/fwumdata.h | 138 ++++++
> > tools/fwumdata_src/fwumdata.mk | 10 +
> > tools/{ => fwumdata_src}/mkfwumdata.c | 106 ++---
> > 12 files changed, 1315 insertions(+), 93 deletions(-)
> > ---
> > base-commit: 31bf4a1c308773895a8e7ea047b3cea037e4c922
> > change-id: 20251107-feature_fwumdata-58508d61e1d3
> >
> > Best regards,
> > --
> > Köry Maincent, Bootlin
> > Embedded Linux and kernel engineering
> > https://bootlin.com
> >

--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering