diff options
author | Joel Kitching <kitching@google.com> | 2019-04-25 18:31:14 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-05-17 18:36:48 -0700 |
commit | 27e3e9fcba98dba576322273a34bd0cbbb639e81 (patch) | |
tree | 208694afb44812fd666551682bffe95c96856d48 /utility | |
parent | 719968c47a6220b3e660e4f72cbc2a56750eec00 (diff) | |
download | vboot-27e3e9fcba98dba576322273a34bd0cbbb639e81.tar.gz |
vboot: deprecate v1 GoogleBinaryBlockHeader struct
Deprecate internal usage of GoogleBinaryBlockHeader struct in
favour of vb2_gbb_header struct. Keep the v1 struct around until
we remove references in other repos.
BUG=b:124141368, chromium:954774
TEST=make clean && make runtests
BRANCH=none
Change-Id: I396d2e624bd5dcac9c461cc86e8175e8f7692d26
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1583826
Commit-Ready: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>
Diffstat (limited to 'utility')
-rw-r--r-- | utility/include/gbb_utility.h | 7 | ||||
-rw-r--r-- | utility/load_kernel_test.c | 15 |
2 files changed, 10 insertions, 12 deletions
diff --git a/utility/include/gbb_utility.h b/utility/include/gbb_utility.h index 49d6d43a..f1c850fe 100644 --- a/utility/include/gbb_utility.h +++ b/utility/include/gbb_utility.h @@ -8,7 +8,6 @@ #include <string> #include <vector> -#include "gbb_header.h" namespace vboot_reference { @@ -36,7 +35,7 @@ class GoogleBinaryBlockUtil { bool save_to_file(const char *filename); // create a new GBB blob by providing a list of reserved data size for each - // properties, following the order described in GoogleBinaryBlockHeader. + // properties, following the order described in vb2_gbb_header. // return true on success. bool create_new(const std::vector<uint32_t> &create_param); @@ -81,7 +80,7 @@ class GoogleBinaryBlockUtil { // load and check header structure from image by given offset. // return true if a valid GBB header is loaded into *phdr. bool load_gbb_header(const std::string &image, long offset, - GoogleBinaryBlockHeader *phdr) const; + struct vb2_gbb_header *phdr) const; // find the size, offset, and name information for given property. // return true if the offset and size are assign to *poffset and *psize; @@ -90,7 +89,7 @@ class GoogleBinaryBlockUtil { bool find_property(PROPINDEX i, uint32_t *poffset, uint32_t *psize, const char **pname) const; - GoogleBinaryBlockHeader header_; // copy of GBB header from image + struct vb2_gbb_header header_; // copy of GBB header from image std::string file_content_; // complete image file content long header_offset_; // offset to GBB header in file_content_ bool is_valid_gbb; // if we are holding a valid GBB diff --git a/utility/load_kernel_test.c b/utility/load_kernel_test.c index 6606c425..331e57ad 100644 --- a/utility/load_kernel_test.c +++ b/utility/load_kernel_test.c @@ -17,7 +17,6 @@ #include "2sysincludes.h" #include "2api.h" #include "2misc.h" -#include "gbb_header.h" #include "host_common.h" #include "load_kernel_fw.h" #include "rollback_index.h" @@ -86,7 +85,7 @@ int main(int argc, char* argv[]) { uint64_t key_size; uint8_t* key_blob = NULL; VbSharedDataHeader* shared; - GoogleBinaryBlockHeader* gbb; + struct vb2_gbb_header* gbb; VbError_t rv; int c, argsleft; int errorcnt = 0; @@ -160,13 +159,13 @@ int main(int argc, char* argv[]) { } /* Initialize the GBB */ - uint32_t gbb_size = sizeof(GoogleBinaryBlockHeader) + key_size; - gbb = (GoogleBinaryBlockHeader*)malloc(gbb_size); + uint32_t gbb_size = sizeof(struct vb2_gbb_header) + key_size; + gbb = (struct vb2_gbb_header*)malloc(gbb_size); memset(gbb, 0, gbb_size); - memcpy(gbb->signature, GBB_SIGNATURE, GBB_SIGNATURE_SIZE); - gbb->major_version = GBB_MAJOR_VER; - gbb->minor_version = GBB_MINOR_VER; - gbb->header_size = sizeof(GoogleBinaryBlockHeader); + memcpy(gbb->signature, VB2_GBB_SIGNATURE, VB2_GBB_SIGNATURE_SIZE); + gbb->major_version = VB2_GBB_MAJOR_VER; + gbb->minor_version = VB2_GBB_MINOR_VER; + gbb->header_size = sizeof(struct vb2_gbb_header); /* Fill in the given key, if any, for both root and recovery */ if (key_blob) { gbb->rootkey_offset = gbb->header_size; |