diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2013-01-29 11:50:46 +0000 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2013-01-29 11:53:07 +0000 |
commit | 42a725f7ecd1e6779d24f1a66eb13652de467de9 (patch) | |
tree | 1727364077a26e2e77b1ac78a2160508c2c88395 /rbutil/mkimxboot/main.c | |
parent | d73c20933b5a7428c8f30442a6e0b90b34ece291 (diff) | |
download | rockbox-42a725f7ecd1e6779d24f1a66eb13652de467de9.tar.gz rockbox-42a725f7ecd1e6779d24f1a66eb13652de467de9.zip |
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
Diffstat (limited to 'rbutil/mkimxboot/main.c')
-rw-r--r-- | rbutil/mkimxboot/main.c | 8 |
1 files changed, 7 insertions, 1 deletions
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) | |||
55 | printf(" -v <v>\tSet variant\n"); | 55 | printf(" -v <v>\tSet variant\n"); |
56 | printf(" -x\t\tDump device informations\n"); | 56 | printf(" -x\t\tDump device informations\n"); |
57 | printf(" -w\tExtract the original firmware\n"); | 57 | printf(" -w\tExtract the original firmware\n"); |
58 | printf(" -p <ver>\tForce product and component version\n"); | ||
58 | printf("Supported variants: (default is standard)\n"); | 59 | printf("Supported variants: (default is standard)\n"); |
59 | printf(" "); | 60 | printf(" "); |
60 | for(size_t i = 0; i < NR_VARIANTS; i++) | 61 | for(size_t i = 0; i < NR_VARIANTS; i++) |
@@ -77,6 +78,7 @@ int main(int argc, char *argv[]) | |||
77 | enum imx_output_type_t type = IMX_DUALBOOT; | 78 | enum imx_output_type_t type = IMX_DUALBOOT; |
78 | bool debug = false; | 79 | bool debug = false; |
79 | bool extract_of = false; | 80 | bool extract_of = false; |
81 | const char *force_version = NULL; | ||
80 | 82 | ||
81 | if(argc == 1) | 83 | if(argc == 1) |
82 | usage(); | 84 | usage(); |
@@ -96,7 +98,7 @@ int main(int argc, char *argv[]) | |||
96 | {0, 0, 0, 0} | 98 | {0, 0, 0, 0} |
97 | }; | 99 | }; |
98 | 100 | ||
99 | int c = getopt_long(argc, argv, "?di:o:b:t:v:xw", long_options, NULL); | 101 | int c = getopt_long(argc, argv, "?di:o:b:t:v:xwp:", long_options, NULL); |
100 | if(c == -1) | 102 | if(c == -1) |
101 | break; | 103 | break; |
102 | switch(c) | 104 | switch(c) |
@@ -156,6 +158,9 @@ int main(int argc, char *argv[]) | |||
156 | case 'w': | 158 | case 'w': |
157 | extract_of = true; | 159 | extract_of = true; |
158 | break; | 160 | break; |
161 | case 'p': | ||
162 | force_version = optarg; | ||
163 | break; | ||
159 | default: | 164 | default: |
160 | abort(); | 165 | abort(); |
161 | } | 166 | } |
@@ -194,6 +199,7 @@ int main(int argc, char *argv[]) | |||
194 | opt.debug = debug; | 199 | opt.debug = debug; |
195 | opt.output = type; | 200 | opt.output = type; |
196 | opt.fw_variant = variant; | 201 | opt.fw_variant = variant; |
202 | opt.force_version = force_version; | ||
197 | enum imx_error_t err = mkimxboot(infile, bootfile, outfile, opt); | 203 | enum imx_error_t err = mkimxboot(infile, bootfile, outfile, opt); |
198 | printf("Result: %d\n", err); | 204 | printf("Result: %d\n", err); |
199 | return 0; | 205 | return 0; |