Aaron Durbin (adurbin(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/12785
-gerrit
commit 8937fdf056225e7041189d3ded6e9bca406a44e7
Author: Patrick Georgi <pgeorgi(a)google.com>
Date: Tue Dec 15 10:09:55 2015 +0100
cbfs: Add type ids for empty files
We will soon need to handle empty files.
BUG=chromium:445938
BRANCH=tot
TEST=none
Change-Id: Ia72a4bff7d9bb36f6a6648c3dd89e86593d80761
Signed-off-by: Patrick Georgi <pgeorgi(a)google.com>
---
src/commonlib/include/commonlib/cbfs_serialized.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/commonlib/include/commonlib/cbfs_serialized.h b/src/commonlib/include/commonlib/cbfs_serialized.h
index edef551..679ff07 100644
--- a/src/commonlib/include/commonlib/cbfs_serialized.h
+++ b/src/commonlib/include/commonlib/cbfs_serialized.h
@@ -62,6 +62,8 @@
Users are welcome to use any other value for their
components */
+#define CBFS_TYPE_DELETED 0x00000000
+#define CBFS_TYPE_DELETED2 0xffffffff
#define CBFS_TYPE_STAGE 0x10
#define CBFS_TYPE_PAYLOAD 0x20
#define CBFS_TYPE_OPTIONROM 0x30
@@ -130,7 +132,7 @@ struct cbfs_file {
char magic[8];
uint32_t len;
uint32_t type;
- uint32_t checksum;
+ uint32_t attributes_offset;
uint32_t offset;
} __attribute__((packed));
Aaron Durbin (adurbin(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/12789
-gerrit
commit 1f02f414498c3f224c97384b5843b716a8e94bd9
Author: Patrick Georgi <pgeorgi(a)google.com>
Date: Fri Nov 20 23:23:44 2015 +0100
cbfstool: keep cbfs master header pointer
Adding new files overwrote the header with the empty file (ie 0xff),
so carve out some space.
BUG=chromium:445938
BRANCH=none
TEST=none
Change-Id: I91c292df381c2bac41c6cb9dda74dae99defd81d
Signed-off-by: Patrick Georgi <pgeorgi(a)google.com>
---
util/cbfstool/cbfs_image.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/util/cbfstool/cbfs_image.c b/util/cbfstool/cbfs_image.c
index 3820c40..2d7a6f0 100644
--- a/util/cbfstool/cbfs_image.c
+++ b/util/cbfstool/cbfs_image.c
@@ -523,6 +523,11 @@ static int cbfs_add_entry_at(struct cbfs_image *image,
}
len = addr_next - addr - min_entry_size;
+ /* keep space for master header pointer */
+ if ((void *)entry + min_entry_size + len > buffer_get(&image->buffer) +
+ buffer_size(&image->buffer) - sizeof(int32_t)) {
+ len -= sizeof(int32_t);
+ }
cbfs_create_empty_entry(entry, CBFS_COMPONENT_NULL, len, "");
if (verbose > 1) cbfs_print_entry_info(image, entry, stderr);
return 0;
Aaron Durbin (adurbin(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/12789
-gerrit
commit f11aefb2f22bf79f7db6fafa4bef9975bf062cb5
Author: Patrick Georgi <pgeorgi(a)google.com>
Date: Fri Nov 20 23:23:44 2015 +0100
cbfstool: keep cbfs master header pointer
Adding new files overwrote the header with the empty file (ie 0xff),
so carve out some space.
BUG=chromium:445938
BRANCH=none
TEST=none
Change-Id: I91c292df381c2bac41c6cb9dda74dae99defd81d
Signed-off-by: Patrick Georgi <pgeorgi(a)google.com>
---
util/cbfstool/cbfs_image.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/util/cbfstool/cbfs_image.c b/util/cbfstool/cbfs_image.c
index 3820c40..2d7a6f0 100644
--- a/util/cbfstool/cbfs_image.c
+++ b/util/cbfstool/cbfs_image.c
@@ -523,6 +523,11 @@ static int cbfs_add_entry_at(struct cbfs_image *image,
}
len = addr_next - addr - min_entry_size;
+ /* keep space for master header pointer */
+ if ((void *)entry + min_entry_size + len > buffer_get(&image->buffer) +
+ buffer_size(&image->buffer) - sizeof(int32_t)) {
+ len -= sizeof(int32_t);
+ }
cbfs_create_empty_entry(entry, CBFS_COMPONENT_NULL, len, "");
if (verbose > 1) cbfs_print_entry_info(image, entry, stderr);
return 0;