update_engine: Added more logging and debugging for rollback checking
To help troubleshoot issues similar to http://crbug.com/356975 I added
more logging in DBus methods of update_engine to trace various stages
of determining available boot partitions, etc.
Also added two more DBus methods - to get the suggested rollback
partition name (and switched CanRollback to use this method) and
the list of availavle kernel partitions along with the 'bootable'
flag for each.
Changed update_engine_client to show the name of avaiable rollback
partition with --can_rollback and also added --show_kernels to
output list of available kernel partitions and whether each partition
is bootable or not.
BUG=None
TEST=Unit tests pass
Change-Id: Ib7f92a6460c578953ea1ba9b23bd0669acb0e22f
Reviewed-on: https://chromium-review.googlesource.com/191949
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
diff --git a/hardware.cc b/hardware.cc
index 44bc9de..f094d97 100644
--- a/hardware.cc
+++ b/hardware.cc
@@ -86,10 +86,7 @@
}
std::vector<std::string> devices;
- const int slot_count = 2; // Use only partition slots A and B
- devices.reserve(slot_count);
- for(int slot = 0; slot < slot_count; slot++) {
- int partition_num = (slot + 1) * 2; // for now, only #2, #4
+ for (int partition_num : {2, 4}) { // for now, only #2, #4 for slot A & B
std::string device = utils::MakePartitionName(disk_name, partition_num);
if(!device.empty()) {
devices.push_back(std::move(device));