summaryrefslogtreecommitdiff
path: root/futility/updater.h
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2018-10-15 15:33:47 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-10-22 06:16:35 -0700
commit4e066900210883a4f502e626998daf79b9b66665 (patch)
tree8111b86089364581014f83117b5167e3977fbb2a /futility/updater.h
parent92fe37cef28d58f6d64c625b30e72fab99ff42a5 (diff)
downloadvboot-4e066900210883a4f502e626998daf79b9b66665.tar.gz
futility: updater: Support white label from VPD and --signature_id
For white label devices, we have to select and patch key files (root key and vblock) by VPD (`whitelabel_tag` or `customization_id`). The white label tag VPD will be processed and converted to a "signature ID" for key selection. To support that, updater has to fetch current (system) image if the matched model is following white label (so we can read VPD from it). For developers who want to load and use particular files, they can use --signature_id to override VPD values. BUG=chromium:875551 TEST=TEST=make futil; tests/futility/run_test_scripts.sh $(pwd)/build/futility BRANCH=None Change-Id: I3630bae28d1a8493b56d0e5efd29f3c61a470379 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1278420
Diffstat (limited to 'futility/updater.h')
-rw-r--r--futility/updater.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/futility/updater.h b/futility/updater.h
index c1405663..ae6db16a 100644
--- a/futility/updater.h
+++ b/futility/updater.h
@@ -114,7 +114,7 @@ struct updater_config {
struct updater_config_arguments {
char *image, *ec_image, *pd_image;
char *archive, *quirks, *mode;
- char *programmer, *model;
+ char *programmer, *model, *signature_id;
char *emulation, *sys_props, *write_protection;
int is_factory, try_update, force_update, do_manifest;
int verbosity;
@@ -131,6 +131,7 @@ struct model_config {
char *image, *ec_image, *pd_image;
struct patch_config patches;
char *signature_id;
+ int is_white_label;
};
struct manifest {
@@ -324,4 +325,16 @@ int patch_image_by_model(
const struct model_config *manifest_find_model(const struct manifest *manifest,
const char *model_name);
+/*
+ * Applies white label information to an existing model configuration.
+ * Collects signature ID information from either parameter signature_id or
+ * image file (via VPD) and updates model.patches for key files.
+ * Returns 0 on success, otherwise failure.
+ */
+int model_apply_white_label(
+ struct model_config *model,
+ struct archive *archive,
+ const char *signature_id,
+ const char *image);
+
#endif /* VBOOT_REFERENCE_FUTILITY_UPDATER_H_ */