summaryrefslogtreecommitdiff
path: root/futility/cmd_update.c
diff options
context:
space:
mode:
Diffstat (limited to 'futility/cmd_update.c')
-rw-r--r--futility/cmd_update.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/futility/cmd_update.c b/futility/cmd_update.c
index f382b9ca..ce81660d 100644
--- a/futility/cmd_update.c
+++ b/futility/cmd_update.c
@@ -26,6 +26,7 @@ static struct option const long_opts[] = {
{"quirks", 1, NULL, 'f'},
{"list-quirks", 0, NULL, 'L'},
{"mode", 1, NULL, 'm'},
+ {"model", 1, NULL, 'M'},
{"manifest", 0, NULL, 'A'},
{"factory", 0, NULL, 'Y'},
{"force", 0, NULL, 'F'},
@@ -64,6 +65,7 @@ static void print_help(int argc, char *argv[])
"Debugging and testing options:\n"
" --wp=1|0 \tSpecify write protection status\n"
" --emulate=FILE \tEmulate system firmware using file\n"
+ " --model=MODEL \tOverride system model for images\n"
" --sys_props=LIST\tList of system properties to override\n"
"-d, --debug \tPrint debugging messages\n"
"-v, --verbose \tPrint verbose messages\n"
@@ -75,7 +77,7 @@ static int do_update(int argc, char *argv[])
{
struct updater_config *cfg;
struct updater_config_arguments args = {0};
- int i, errorcnt = 0;
+ int i, errorcnt = 0, do_update = 1;
fprintf(stderr, ">> Firmware updater started.\n");
cfg = updater_new_config();
@@ -108,6 +110,9 @@ static int do_update(int argc, char *argv[])
case 'm':
args.mode = optarg;
break;
+ case 'M':
+ args.model = optarg;
+ break;
case 'A':
args.do_manifest = 1;
break;
@@ -160,8 +165,8 @@ static int do_update(int argc, char *argv[])
Error("Unexpected arguments.\n");
}
if (!errorcnt)
- errorcnt += updater_setup_config(cfg, &args);
- if (!errorcnt && !args.do_manifest) {
+ errorcnt += updater_setup_config(cfg, &args, &do_update);
+ if (!errorcnt && do_update) {
int r = update_firmware(cfg);
if (r != UPDATE_ERR_DONE) {
r = Min(r, UPDATE_ERR_UNKNOWN);