From 42a725f7ecd1e6779d24f1a66eb13652de467de9 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Tue, 29 Jan 2013 11:50:46 +0000 Subject: mkimxboot: add a switch to force version Add a switch to override the product and component version of the sb file. This can usually for target like the Zen X-Fi2 where the upader allows to drop any file named firmware.sb and prints the version: by using a funky version the users can check they got it right. This should not be used on the fuze+ or zenxfi3 because the OF prevents downgrade. Also make rbutil always zero out the option structure passed to mkimxboot, this has already created bugs in the past. Change-Id: I175c5def52c40c2132e11300e2f037d60a4f040e --- rbutil/mkimxboot/main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'rbutil/mkimxboot/main.c') diff --git a/rbutil/mkimxboot/main.c b/rbutil/mkimxboot/main.c index b775242b10..3299d748d5 100644 --- a/rbutil/mkimxboot/main.c +++ b/rbutil/mkimxboot/main.c @@ -55,6 +55,7 @@ static void usage(void) printf(" -v \tSet variant\n"); printf(" -x\t\tDump device informations\n"); printf(" -w\tExtract the original firmware\n"); + printf(" -p \tForce product and component version\n"); printf("Supported variants: (default is standard)\n"); printf(" "); for(size_t i = 0; i < NR_VARIANTS; i++) @@ -77,6 +78,7 @@ int main(int argc, char *argv[]) enum imx_output_type_t type = IMX_DUALBOOT; bool debug = false; bool extract_of = false; + const char *force_version = NULL; if(argc == 1) usage(); @@ -96,7 +98,7 @@ int main(int argc, char *argv[]) {0, 0, 0, 0} }; - int c = getopt_long(argc, argv, "?di:o:b:t:v:xw", long_options, NULL); + int c = getopt_long(argc, argv, "?di:o:b:t:v:xwp:", long_options, NULL); if(c == -1) break; switch(c) @@ -156,6 +158,9 @@ int main(int argc, char *argv[]) case 'w': extract_of = true; break; + case 'p': + force_version = optarg; + break; default: abort(); } @@ -194,6 +199,7 @@ int main(int argc, char *argv[]) opt.debug = debug; opt.output = type; opt.fw_variant = variant; + opt.force_version = force_version; enum imx_error_t err = mkimxboot(infile, bootfile, outfile, opt); printf("Result: %d\n", err); return 0; -- cgit v1.2.3