cbfstool: add unprocessed flag for file exporting

Hardware / Coreboot - Joel Kitching [google.com] - 16 November 2018 09:47 EST

Add an unprocessed flag (-U) which modifies how files are exported. In the case of a compressed raw file, extract without decompressing. In the case of a stage or payload, extract without decompressing or converting to an ELF.

This can be useful for verifying the integrity of a stage or payload, since converting to an ELF may not be a deterministic process on different platforms or coreboot versions.

BUG=b:111577108 TEST=USE=cb_legacy_tianocore emerge-eve edk2 coreboot-utils chromeos-bootimage cd /build/eve/firmware /build/eve/usr/bin/cbfstool image.bin extract -r RW_LEGACY \-n payload -f /tmp/payload_1 -U START=$((16#`xxd -s 20 -l 4 -p tianocore.cbfs`)) SIZE=$((16#`xxd -s 8 -l 4 -p tianocore.cbfs`)) dd if=tianocore.cbfs skip=$START count=$SIZE bs=1 > /tmp/payload_2 diff /tmp/payload_1 /tmp/payload_2 rm /tmp/payload_1 /tmp/payload_2

Change-Id: I351d471d699daedd51adf4a860661877f25607e6

21fdd89b0c cbfstool: add unprocessed flag for file exporting
util/cbfstool/cbfs_image.c | 51 ++++++++++++++++++++++++++++++----------------
util/cbfstool/cbfs_image.h | 5 +++--
util/cbfstool/cbfstool.c | 14 +++++++++----
3 files changed, 47 insertions(+), 23 deletions(-)

Upstream: review.coreboot.org


  • Share