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 9bc1ec66abaa7a6755810c2519357179a30235a6
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/12785
-gerrit
commit 02afaf6059d1fd317c6b40b907d43acc2d753b9e
Author: Patrick Georgi <pgeorgi(a)google.com>
Date: Tue Dec 15 10:09:55 2015 +0100
commonlib/cbfs: Add type ids for empty files
We will soon need to handle empty files.
Change-Id: Ia72a4bff7d9bb36f6a6648c3dd89e86593d80761
Signed-off-by: Patrick Georgi <pgeorgi(a)google.com>
---
src/commonlib/include/commonlib/cbfs_serialized.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/commonlib/include/commonlib/cbfs_serialized.h b/src/commonlib/include/commonlib/cbfs_serialized.h
index edef551..bea5d6b 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
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 74da560c19d3d1713ac9369f521993bb475851ab
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;