Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(560)

Unified Diff: cbootimage.c

Issue 6579034: Add the device type/parameters support for cbootimage tool. (Closed) Base URL: http://git.chromium.org/git/cbootimage.git@master
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cbootimage.h ('k') | nvbctlib.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cbootimage.c
diff --git a/cbootimage.c b/cbootimage.c
index 1792749c6e3a75066b0f86a466379a701a861bfb..1df62387f9ecfe605b78d703f56569960c67d08a 100644
--- a/cbootimage.c
+++ b/cbootimage.c
@@ -59,6 +59,7 @@ usage(void)
printf(" options:\n");
printf(" -h, --help, -? Display this message.\n");
printf(" -d, --debug Output debugging information.\n");
+ printf(" -gbct Generate the new bct file.\n");
printf(" configfile File with configuration information\n");
printf(" imagename Output image name\n");
}
@@ -68,6 +69,8 @@ process_command_line(int argc, char *argv[], build_image_context *context)
{
int arg = 1;
+ context->generate_bct = 0;
+
while (arg < argc) {
/* Process the next argument. */
if (!strcmp(argv[arg], "-h") ||
@@ -80,6 +83,9 @@ process_command_line(int argc, char *argv[], build_image_context *context)
!strcmp(argv[arg], "--debug")) {
enable_debug = 1;
arg++;
+ } else if (!strcmp(argv[arg], "-gbct")) {
+ context->generate_bct = 1;
+ arg++;
} else if (argv[arg][0] == '-') {
printf("Illegal option %s\n", argv[arg]);
usage();
@@ -168,6 +174,20 @@ main(int argc, char *argv[])
/* Parse & process the contents of the config file. */
process_config_file(&context);
+ /* Generate the new bct file */
+ if (context.generate_bct != 0) {
+ /* Signing the bct. */
+ e = sign_bct(&context, context.bct);
+ if (e != 0)
+ printf("Signing BCT failed, error: %d.\n", e);
+
+ fwrite(context.bct, 1, sizeof(nvboot_config_table),
+ context.raw_file);
+ printf("New BCT file %s has been successfully generated!\n",
+ context.image_filename);
+ goto fail;
+ }
+
/* Update the bct file */
/* Update the add on file */
e = update_addon_item(&context);
« no previous file with comments | « cbootimage.h ('k') | nvbctlib.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698