vboot_reference: add creation of GBB blob to gbb_utility
Non-x86 platforms (ex, ARM) may need to create GBB from scratch.
The new "create" (-c) creates a GBB blob by given property maximum sizes.
The list must follow same order as specified in GBB header.
BUG=chromium-os:1302
TEST=gbb_utility -c 0x100,0x1000,0x03DE80,0x1000 gbb.blob
gbb_utility -s --hwid='test' gbb_blob
gbb_utility -s --rootkey='some_rootkey' gbb_blob
gbb_utility -g --hwid --rootkey='rk.bin' gbb_blob # output hwid=test
Change-Id: Ic854609effa32020f9536bc2d3f8457dff1c3719
Review URL: http://codereview.chromium.org/6173001
diff --git a/utility/include/gbb_utility.h b/utility/include/gbb_utility.h
index 468cddf..55d4a39 100644
--- a/utility/include/gbb_utility.h
+++ b/utility/include/gbb_utility.h
@@ -7,6 +7,7 @@
#define VBOOT_REFERENCE_GBB_UTILITY_H_
#include <string>
+#include <vector>
#include "gbb_header.h"
namespace vboot_reference {
@@ -33,6 +34,11 @@
// return true on success.
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.
+ // return true on success.
+ bool create_new(const std::vector<uint32_t> &create_param);
+
// retrieve the value of a property from GBB data.
// return the property value.
std::string get_property(PROPINDEX i) const;
@@ -86,4 +92,3 @@
} // namespace vboot_reference
#endif // VBOOT_REFERENCE_GBB_UTILITY_H_
-