summaryrefslogtreecommitdiff
path: root/payload_consumer/install_plan.h
diff options
context:
space:
mode:
Diffstat (limited to 'payload_consumer/install_plan.h')
-rw-r--r--payload_consumer/install_plan.h34
1 files changed, 27 insertions, 7 deletions
diff --git a/payload_consumer/install_plan.h b/payload_consumer/install_plan.h
index ede36b31..7c77789b 100644
--- a/payload_consumer/install_plan.h
+++ b/payload_consumer/install_plan.h
@@ -45,6 +45,7 @@ struct InstallPlan {
bool operator!=(const InstallPlan& that) const;
void Dump() const;
+ std::string ToString() const;
// Loads the |source_path| and |target_path| of all |partitions| based on the
// |source_slot| and |target_slot| if available. Returns whether it succeeded
@@ -54,25 +55,28 @@ struct InstallPlan {
bool is_resume{false};
std::string download_url; // url to download from
std::string version; // version we are installing.
- // system version, if present and separate from version
- std::string system_version;
struct Payload {
- uint64_t size = 0; // size of the payload
- uint64_t metadata_size = 0; // size of the metadata
+ std::vector<std::string> payload_urls; // URLs to download the payload
+ uint64_t size = 0; // size of the payload
+ uint64_t metadata_size = 0; // size of the metadata
std::string metadata_signature; // signature of the metadata in base64
brillo::Blob hash; // SHA256 hash of the payload
InstallPayloadType type{InstallPayloadType::kUnknown};
+ std::string fp; // fingerprint value unique to the payload
+ std::string app_id; // App ID of the payload
// Only download manifest and fill in partitions in install plan without
// apply the payload if true. Will be set by DownloadAction when resuming
// multi-payload.
bool already_applied = false;
bool operator==(const Payload& that) const {
- return size == that.size && metadata_size == that.metadata_size &&
+ return payload_urls == that.payload_urls && size == that.size &&
+ metadata_size == that.metadata_size &&
metadata_signature == that.metadata_signature &&
hash == that.hash && type == that.type &&
- already_applied == that.already_applied;
+ already_applied == that.already_applied && fp == that.fp &&
+ app_id == that.app_id;
}
};
std::vector<Payload> payloads;
@@ -98,9 +102,17 @@ struct InstallPlan {
uint64_t source_size{0};
brillo::Blob source_hash;
+ // |target_path| is intended to be a path to block device, which you can
+ // open with |open| syscall and perform regular unix style read/write.
+ // For VABC, this will be empty. As you can't read/write VABC devices with
+ // regular syscall.
std::string target_path;
+ // |mountable_target_device| is intended to be a path to block device which
+ // can be used for mounting this block device's underlying filesystem.
+ std::string readonly_target_path;
uint64_t target_size{0};
brillo::Blob target_hash;
+
uint32_t block_size{0};
// Whether we should run the postinstall script from this partition and the
@@ -146,6 +158,9 @@ struct InstallPlan {
// True if this update is a rollback.
bool is_rollback{false};
+ // True if this rollback should preserve some system data.
+ bool rollback_data_save_requested{false};
+
// True if the update should write verity.
// False otherwise.
bool write_verity{true};
@@ -153,6 +168,10 @@ struct InstallPlan {
// If not blank, a base-64 encoded representation of the PEM-encoded
// public key in the response.
std::string public_key_rsa;
+
+ // The name of dynamic partitions not included in the payload. Only used
+ // for partial updates.
+ std::vector<std::string> untouched_dynamic_partitions;
};
class InstallPlanAction;
@@ -190,9 +209,10 @@ class InstallPlanAction : public Action<InstallPlanAction> {
typedef ActionTraits<InstallPlanAction>::InputObjectType InputObjectType;
typedef ActionTraits<InstallPlanAction>::OutputObjectType OutputObjectType;
- private:
+ protected:
InstallPlan install_plan_;
+ private:
DISALLOW_COPY_AND_ASSIGN(InstallPlanAction);
};