summaryrefslogtreecommitdiff
path: root/common/hardware_interface.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/hardware_interface.h')
-rw-r--r--common/hardware_interface.h45
1 files changed, 35 insertions, 10 deletions
diff --git a/common/hardware_interface.h b/common/hardware_interface.h
index d92a6fcc..4e820f1a 100644
--- a/common/hardware_interface.h
+++ b/common/hardware_interface.h
@@ -25,6 +25,8 @@
#include <base/files/file_path.h>
#include <base/time/time.h>
+#include "update_engine/common/error_code.h"
+
namespace chromeos_update_engine {
// The hardware interface allows access to the crossystem exposed properties,
@@ -62,13 +64,9 @@ class HardwareInterface {
// Returns the HWID or an empty string on error.
virtual std::string GetHardwareClass() const = 0;
- // Returns the firmware version or an empty string if the system is
- // not running chrome os firmware.
- virtual std::string GetFirmwareVersion() const = 0;
-
- // Returns the ec version or an empty string if the system is not
- // running a custom chrome os ec.
- virtual std::string GetECVersion() const = 0;
+ // Returns the OEM device requisition or an empty string if the system does
+ // not have a requisition, or if not running Chrome OS.
+ virtual std::string GetDeviceRequisition() const = 0;
// Returns the minimum kernel key version that verified boot on Chrome OS
// will allow to boot. This is the value of crossystem tpm_kernver. Returns
@@ -102,9 +100,9 @@ class HardwareInterface {
virtual int GetPowerwashCount() const = 0;
// Signals that a powerwash (stateful partition wipe) should be performed
- // after reboot. If |is_rollback| is true additional state is preserved
- // during shutdown that can be restored after the powerwash.
- virtual bool SchedulePowerwash(bool is_rollback) = 0;
+ // after reboot. If |save_rollback_data| is true additional state is
+ // preserved during shutdown that can be restored after the powerwash.
+ virtual bool SchedulePowerwash(bool save_rollback_data) = 0;
// Cancel the powerwash operation scheduled to be performed on next boot.
virtual bool CancelPowerwash() = 0;
@@ -138,6 +136,33 @@ class HardwareInterface {
// If |warm_reset| is true, sets the warm reset to indicate a warm reset is
// needed on the next reboot. Otherwise, clears the flag.
virtual void SetWarmReset(bool warm_reset) = 0;
+
+ // If not reset, sets the vbmeta digest of the inactive slot as a sysprop.
+ // Otherwise, clears the sysprop.
+ virtual void SetVbmetaDigestForInactiveSlot(bool reset) = 0;
+
+ // Return the version/timestamp for partition `partition_name`.
+ // Don't make any assumption about the formatting of returned string.
+ // Only used for logging/debugging purposes.
+ virtual std::string GetVersionForLogging(
+ const std::string& partition_name) const = 0;
+
+ // Return true if and only if `new_version` is "newer" than the
+ // version number of partition `partition_name`. The notion of
+ // "newer" is defined by this function. Caller should not make
+ // any assumption about the underlying logic.
+ // Return:
+ // - kSuccess if update is valid.
+ // - kPayloadTimestampError if downgrade is detected
+ // - kDownloadManifestParseError if |new_version| has an incorrect format
+ // - Other error values if the source of error is known, or kError for
+ // a generic error on the device.
+ virtual ErrorCode IsPartitionUpdateValid(
+ const std::string& partition_name,
+ const std::string& new_version) const = 0;
+
+ virtual const char* GetPartitionMountOptions(
+ const std::string& partition_name) const = 0;
};
} // namespace chromeos_update_engine