diff options
author | Patrick Georgi <pgeorgi@google.com> | 2017-09-19 14:39:58 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2017-09-20 13:45:00 +0000 |
commit | 5d982d72be849a15f98bb0583b25bbcd6eb7d315 (patch) | |
tree | 5b0bc89e9b444d5fc295a9f6e275cdcf7618bffc /util/cbfstool/cbfs_image.h | |
parent | bea2d75f3174a8fbd24be2010977f975e7a16720 (diff) | |
download | coreboot-5d982d72be849a15f98bb0583b25bbcd6eb7d315.tar.xz |
util/cbfstool: Add "expand" command to make CBFS span an fmap region
vboot images come with multiple regions carrying CBFS file systems. To
expedite hashing (from slow flash memory), the FW_MAIN_* regions are
truncated since they typically have pretty large unused space at the
end that is of no interest.
For test purposes it can be useful to re-engage that space, so add a
command that creates a new empty file entry covering that area (except
for the last 4 bytes for the master header pointer, as usual).
BUG=b:65853903
BRANCH=none
TEST=`cbfstool test.bin expand -r FW_MAIN_A` creates a new empty file of
the expected size on a Chrome OS firmware image.
Change-Id: I160c8529ce4bfcc28685166b6d9035ade4f6f1d1
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/21598
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'util/cbfstool/cbfs_image.h')
-rw-r--r-- | util/cbfstool/cbfs_image.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/util/cbfstool/cbfs_image.h b/util/cbfstool/cbfs_image.h index 0d7877a7cc..1bd74cedd1 100644 --- a/util/cbfstool/cbfs_image.h +++ b/util/cbfstool/cbfs_image.h @@ -80,6 +80,10 @@ int cbfs_copy_instance(struct cbfs_image *image, struct buffer *dst); * beginning of the image. Returns 0 on success, otherwise non-zero. */ int cbfs_compact_instance(struct cbfs_image *image); +/* Expand a CBFS image inside an fmap region to the entire region's space. + Returns 0 on success, otherwise non-zero. */ +int cbfs_expand_to_region(struct buffer *region); + /* Releases the CBFS image. Returns 0 on success, otherwise non-zero. */ int cbfs_image_delete(struct cbfs_image *image); |