[coreboot] Retrieving additional payload files from CBFS

tturne at codeaurora.org tturne at codeaurora.org
Wed Apr 12 18:02:06 CEST 2017


On 2017-04-12 07:51, Trammell Hudson wrote:
> Is there an easy way for a running payload to extract additional files
> from its CBFS image in ROM?  I'd like to have a reproducible kernel and
> initrd as the primary payload, with user data (and keys) stored in a
> separate payload section of the CBFS.
> 
> On the build host I can use cbfstool to add/extract them from the file,
> but I'm not seeing an easy way to do it on the running machine
> short of 'dd if=/dev/mem' at the correct address.
> 
> --
> Trammell

I have always wondered why payload_load() has a hard-wired payload 
filename.

For internal test-purposes we have created cbfs containers with multiple 
payload files.
payload_load() can either be parameterized or cloned and renamed for 
each payload.

The simple solution that I would try is in ramstage load the secondary 
files and add them to the coreboot tables passed to depthcharge.
Depthcharge has access to the payload data without having to actually 
load them because they are already loaded.

If you are using another payload, I assume they use similar mechanism to 
receive the coreboot tables.

Of course if this is production code parameterizing payload_load() would 
have to be discussed on the list...
Cheers,
T.mike



More information about the coreboot mailing list