[coreboot-gerrit] Patch set updated for coreboot: cbfstool: rename checksum to attributes_offset

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Thu Jul 16 15:36:25 CEST 2015


Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10933

-gerrit

commit 5cbe000fe30281e927fe78a28e217caf3225d77f
Author: Patrick Georgi <pgeorgi at chromium.org>
Date:   Wed Jul 15 18:28:23 2015 +0200

    cbfstool: rename checksum to attributes_offset
    
    So far it's still unused, but its purpose will change:
    It will become an offset to another structure that contains additional file
    attributes.
    
    This change is compatible because the binary format doesn't change and so far
    the field was always set to 0, which can serve nicely as 'unused' field.
    
    Change-Id: I2dafb06866713d43a236556f9492641526270837
    Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
---
 util/cbfstool/cbfs.h       | 2 +-
 util/cbfstool/cbfs_image.c | 2 +-
 util/cbfstool/common.c     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/util/cbfstool/cbfs.h b/util/cbfstool/cbfs.h
index 1996b1c..e63db37 100644
--- a/util/cbfstool/cbfs.h
+++ b/util/cbfstool/cbfs.h
@@ -74,7 +74,7 @@ struct cbfs_file {
 	/* length of file data */
 	uint32_t len;
 	uint32_t type;
-	uint32_t checksum;
+	uint32_t attributes_offset;
 	/* length of header incl. variable data */
 	uint32_t offset;
 	char filename[];
diff --git a/util/cbfstool/cbfs_image.c b/util/cbfstool/cbfs_image.c
index 828d367..6f028c8 100644
--- a/util/cbfstool/cbfs_image.c
+++ b/util/cbfstool/cbfs_image.c
@@ -1035,7 +1035,7 @@ int cbfs_create_empty_entry(struct cbfs_file *entry,
 	memcpy(entry->magic, CBFS_FILE_MAGIC, sizeof(entry->magic));
 	entry->type = htonl(CBFS_COMPONENT_NULL);
 	entry->len = htonl(len);
-	entry->checksum = 0;  // TODO Build a checksum algorithm.
+	entry->attributes_offset = 0;
 	entry->offset = htonl(cbfs_calculate_file_header_size(name));
 	memset(entry->filename, 0, ntohl(entry->offset) - sizeof(*entry));
 	strcpy(entry->filename, name);
diff --git a/util/cbfstool/common.c b/util/cbfstool/common.c
index fffd096..d72db38 100644
--- a/util/cbfstool/common.c
+++ b/util/cbfstool/common.c
@@ -131,7 +131,7 @@ void cbfs_file_get_header(struct buffer *buf, struct cbfs_file *file)
 	bgets(buf, &file->magic, sizeof(file->magic));
 	file->len = xdr_be.get32(buf);
 	file->type = xdr_be.get32(buf);
-	file->checksum = xdr_be.get32(buf);
+	file->attributes_offset = xdr_be.get32(buf);
 	file->offset = xdr_be.get32(buf);
 }
 



More information about the coreboot-gerrit mailing list