diff options
author | Aaron Durbin <adurbin@chromium.org> | 2016-01-26 17:08:56 -0600 |
---|---|---|
committer | Aaron Durbin <adurbin@chromium.org> | 2016-01-28 19:25:57 +0100 |
commit | 71c60ca4821f9ebd51066b2fb4166fd974755666 (patch) | |
tree | 4d8fc9fd81e3cb22d99089be980385fe0e82656a /util/cbfstool/cbfs_image.h | |
parent | 5dc628a2ef4f1b883dfbcf414230d9c459a87548 (diff) | |
download | coreboot-71c60ca4821f9ebd51066b2fb4166fd974755666.tar.xz |
util/cbfstool: add 'compact' command
While assembling CBFS images within the RW slots on Chrome OS
machines the current approach is to 'cbfstool copy' from the
RO CBFS to each RW CBFS. Additional fixups are required such
as removing unneeded files from the RW CBFS (e.g. verstage)
as well as removing and adding back files with the proper
arguments (FSP relocation as well as romstage XIP relocation).
This ends up leaving holes in the RW CBFS. To speed up RW
CBFS slot hashing it's beneficial to pack all non-empty files
together at the beginning of the CBFS. Therefore, provide
the 'compact' command which bubbles all the empty entries to
the end of the CBFS.
Change-Id: I8311172d71a2ccfccab384f8286cf9f21a17dec9
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/13479
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
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 38510d2cfc..0d7877a7cc 100644 --- a/util/cbfstool/cbfs_image.h +++ b/util/cbfstool/cbfs_image.h @@ -76,6 +76,10 @@ int cbfs_image_from_buffer(struct cbfs_image *out, struct buffer *in, * Will not succeed on new-style images without a master header. */ int cbfs_copy_instance(struct cbfs_image *image, struct buffer *dst); +/* Compact a fragmented CBFS image by placing all the non-empty files at the + * beginning of the image. Returns 0 on success, otherwise non-zero. */ +int cbfs_compact_instance(struct cbfs_image *image); + /* Releases the CBFS image. Returns 0 on success, otherwise non-zero. */ int cbfs_image_delete(struct cbfs_image *image); |