summaryrefslogtreecommitdiff
path: root/futility
diff options
context:
space:
mode:
Diffstat (limited to 'futility')
-rw-r--r--futility/cmd_update.c5
-rw-r--r--futility/updater.c9
-rw-r--r--futility/updater.h2
3 files changed, 12 insertions, 4 deletions
diff --git a/futility/cmd_update.c b/futility/cmd_update.c
index 14b16877..1b202c0f 100644
--- a/futility/cmd_update.c
+++ b/futility/cmd_update.c
@@ -33,6 +33,7 @@ static struct option const long_opts[] = {
{"force", 0, NULL, 'F'},
{"programmer", 1, NULL, 'p'},
{"wp", 1, NULL, 'W'},
+ {"host_only", 0, NULL, 'H'},
{"emulate", 1, NULL, 'E'},
{"output_dir", 1, NULL, 'U'},
{"sys_props", 1, NULL, 'S'},
@@ -67,6 +68,7 @@ static void print_help(int argc, char *argv[])
"\n"
"Debugging and testing options:\n"
" --wp=1|0 \tSpecify write protection status\n"
+ " --host_only \tUpdate only AP (host) firmware\n"
" --emulate=FILE \tEmulate system firmware using file\n"
" --model=MODEL \tOverride system model for images\n"
" --signature_id=S\tOverride signature ID for key files\n"
@@ -132,6 +134,9 @@ static int do_update(int argc, char *argv[])
case 'W':
args.write_protection = optarg;
break;
+ case 'H':
+ args.host_only = 1;
+ break;
case 'E':
args.emulation = optarg;
break;
diff --git a/futility/updater.c b/futility/updater.c
index 6029612d..f4e793b3 100644
--- a/futility/updater.c
+++ b/futility/updater.c
@@ -1641,6 +1641,7 @@ static int save_from_stdin(const char *output)
* Returns 0 on success, otherwise number of failures.
*/
static int updater_load_images(struct updater_config *cfg,
+ int host_only,
const char *image,
const char *ec_image,
const char *pd_image)
@@ -1657,7 +1658,7 @@ static int updater_load_images(struct updater_config *cfg,
}
errorcnt += !!load_firmware_image(&cfg->image, image, ar);
}
- if (cfg->emulation)
+ if (cfg->emulation || host_only)
return errorcnt;
if (!cfg->ec_image.data && ec_image)
@@ -1769,7 +1770,8 @@ static int updater_setup_archive(
}
errorcnt += updater_load_images(
- cfg, model->image, model->ec_image, model->pd_image);
+ cfg, arg->host_only, model->image, model->ec_image,
+ model->pd_image);
errorcnt += patch_image_by_model(&cfg->image, model, ar);
return errorcnt;
}
@@ -1862,7 +1864,8 @@ int updater_setup_config(struct updater_config *cfg,
/* Always load images specified from command line directly. */
errorcnt += updater_load_images(
- cfg, arg->image, arg->ec_image, arg->pd_image);
+ cfg, arg->host_only, arg->image, arg->ec_image,
+ arg->pd_image);
if (!archive_path)
archive_path = ".";
diff --git a/futility/updater.h b/futility/updater.h
index 26e88dad..9c8502b1 100644
--- a/futility/updater.h
+++ b/futility/updater.h
@@ -117,7 +117,7 @@ struct updater_config_arguments {
char *programmer, *model, *signature_id;
char *emulation, *sys_props, *write_protection;
char *output_dir;
- int is_factory, try_update, force_update, do_manifest;
+ int is_factory, try_update, force_update, do_manifest, host_only;
int verbosity;
};