diff options
author | Hung-Te Lin <hungte@chromium.org> | 2013-01-29 10:24:00 +0800 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2013-02-05 22:27:13 +0100 |
commit | 5f3eb26d857628615e6c92180a2dc2213011dd09 (patch) | |
tree | 67ed2f539784df57bf77c70c517f18a02dc0ffae /util/cbfstool/cbfs_image.h | |
parent | f56c73f1e1c2b13c7b2b989fc44358138394cc68 (diff) |
cbfstool: Use cbfs_image api for "add" command.
The "add" command is compatible with all legacy usage. Also, to support
platforms without top-aligned address, all address-type params (-b, -H, -l) can
now be ROM offset (address < 0x8000000) or x86 top-aligned address (address >
0x80000000).
Example:
cbfstool coreboot.rom add -f config -n config -t raw -b 0x2000
cbfstool coreboot.rom add -f stage -n newstage -b 0xffffd1c0
Verified boot-able on both ARM(snow) and x86(QEMU) system.
Change-Id: I485e4e88b5e269494a4b138e0a83f793ffc5a084
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-on: http://review.coreboot.org/2216
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'util/cbfstool/cbfs_image.h')
-rw-r--r-- | util/cbfstool/cbfs_image.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/util/cbfstool/cbfs_image.h b/util/cbfstool/cbfs_image.h index 5e1c87109d..676efde982 100644 --- a/util/cbfstool/cbfs_image.h +++ b/util/cbfstool/cbfs_image.h @@ -62,6 +62,12 @@ struct cbfs_file *cbfs_get_entry(struct cbfs_image *image, const char *name); int cbfs_export_entry(struct cbfs_image *image, const char *entry_name, const char *filename); +/* Adds an entry to CBFS image by given name and type. If content_offset is + * non-zero, try to align "content" (CBFS_SUBHEADER(p)) at content_offset. + * Returns 0 on success, otherwise non-zero. */ +int cbfs_add_entry(struct cbfs_image *image, struct buffer *buffer, + const char *name, uint32_t type, uint32_t content_offset); + /* Removes an entry from CBFS image. Returns 0 on success, otherwise non-zero. */ int cbfs_remove_entry(struct cbfs_image *image, const char *name); |