summaryrefslogtreecommitdiff
path: root/futility/updater.h
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2018-10-15 14:57:34 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-10-22 06:16:35 -0700
commit92fe37cef28d58f6d64c625b30e72fab99ff42a5 (patch)
treeb9ed716ec51119af8d8555e7589931201cfa0d94 /futility/updater.h
parent4d4c36e9df592548ae169cf6f145ecc9399a7963 (diff)
downloadvboot-92fe37cef28d58f6d64c625b30e72fab99ff42a5.tar.gz
futility: updater: Add '--model' and select images by system model
For devices using Unified Build, we have to select and load images from archive by model configuration (setvars.sh). The system model can be retrieved by $(mosys platform model), but for developers who want to simulate or get images for particular platform, a command line argument --model is needed. BUG=chromium:875551 TEST=TEST=make futil; tests/futility/run_test_scripts.sh $(pwd)/build/futility BRANCH=None Change-Id: I8f4a6735b34bc694a05808b001c7309623b2afa3 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1278419 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'futility/updater.h')
-rw-r--r--futility/updater.h23
1 files changed, 20 insertions, 3 deletions
diff --git a/futility/updater.h b/futility/updater.h
index 21bdbdb5..c1405663 100644
--- a/futility/updater.h
+++ b/futility/updater.h
@@ -135,10 +135,10 @@ struct model_config {
struct manifest {
int num;
- int default_model;
- int has_keyset;
struct model_config *models;
struct archive *archive;
+ int default_model;
+ int has_keyset;
};
enum updater_error_codes {
@@ -183,7 +183,8 @@ void updater_delete_config(struct updater_config *cfg);
* Returns number of failures, or 0 on success.
*/
int updater_setup_config(struct updater_config *cfg,
- const struct updater_config_arguments *arg);
+ const struct updater_config_arguments *arg,
+ int *do_update);
/* Prints the name and description from all supported quirks. */
void updater_list_config_quirks(const struct updater_config *cfg);
@@ -307,4 +308,20 @@ void delete_manifest(struct manifest *manifest);
/* Prints the information of objects in manifest (models and images) in JSON. */
void print_json_manifest(const struct manifest *manifest);
+/*
+ * Modifies a firmware image from patch information specified in model config.
+ * Returns 0 on success, otherwise number of failures.
+ */
+int patch_image_by_model(
+ struct firmware_image *image, const struct model_config *model,
+ struct archive *archive);
+
+/*
+ * Finds the existing model_config from manifest that best matches current
+ * system (as defined by model_name).
+ * Returns a model_config from manifest, or NULL if not found.
+ */
+const struct model_config *manifest_find_model(const struct manifest *manifest,
+ const char *model_name);
+
#endif /* VBOOT_REFERENCE_FUTILITY_UPDATER_H_ */