<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Is there an easy way for a running payload to extract additional files<br>
from its CBFS image in ROM? I'd like to have a reproducible kernel and<br>
initrd as the primary payload, with user data (and keys) stored in a<br>
separate payload section of the CBFS.<br>
<br>
On the build host I can use cbfstool to add/extract them from the file,<br>
but I'm not seeing an easy way to do it on the running machine<br>
short of 'dd if=/dev/mem' at the correct address.<br></blockquote><div><br></div><div>If you were talking about a "normal" payload (linking libpayload) that would be easy... there's plenty of CBFS APIs in libpayload (cbfs_find_file() would be the simplest for this case).</div><div><br></div><div>But it sounds like you're using a Linux kernel as payload? Then I'm afraid you're restricted to the normal ways that Linux can use to access the firmware flash... flashrom it out and use cbfstool extract (which should work on a real system, not so sure about qemu). Depending on what exactly you're trying to do, it may be easier to just include your data in an initramfs instead.</div></div></div></div>