Add an overload function in boot control
It's used to support partial update. The overload function takes
additional info whether the partition is included in payload. And
it also outputs if the partition is a dynamic partition.
Bug: 157778739
Test: unit tests pass
Change-Id: I0741d44c223fb7c187fe208564371acd6d868c65
diff --git a/boot_control_chromeos.cc b/boot_control_chromeos.cc
index 0f47169..da84e99 100644
--- a/boot_control_chromeos.cc
+++ b/boot_control_chromeos.cc
@@ -148,9 +148,11 @@
return current_slot_;
}
-bool BootControlChromeOS::GetPartitionDevice(const string& partition_name,
- unsigned int slot,
- string* device) const {
+bool BootControlChromeOS::GetPartitionDevice(const std::string& partition_name,
+ BootControlInterface::Slot slot,
+ bool not_in_payload,
+ std::string* device,
+ bool* is_dynamic) const {
// Partition name prefixed with |kPartitionNamePrefixDlc| is a DLC module.
if (base::StartsWith(partition_name,
kPartitionNamePrefixDlc,
@@ -180,9 +182,18 @@
return false;
*device = part_device;
+ if (is_dynamic) {
+ *is_dynamic = false;
+ }
return true;
}
+bool BootControlChromeOS::GetPartitionDevice(const string& partition_name,
+ BootControlInterface::Slot slot,
+ string* device) const {
+ return GetPartitionDevice(partition_name, slot, false, device, nullptr);
+}
+
bool BootControlChromeOS::IsSlotBootable(Slot slot) const {
int partition_num = GetPartitionNumber(kChromeOSPartitionNameKernel, slot);
if (partition_num < 0)