Skip to content

Commit

Permalink
Consider system image for quick roll forward (#1996)
Browse files Browse the repository at this point in the history
b/310711891

Change-Id: I34bea666b2780402775f0f8793474b474d5bc06c
(cherry picked from commit 14f44d4)
  • Loading branch information
yuying-y committed Dec 6, 2023
1 parent 344c437 commit b670010
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions components/update_client/cobalt_slot_management.cc
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@ bool CobaltQuickUpdate(
base::Version slot_candidate_version("1.0.1");
int slot_candidate = -1;

// Iterate over all writeable slots - index >= 1.
for (int i = 1; i < max_slots; i++) {
// Iterate over all slots - index >= 0.
for (int i = 0; i < max_slots; i++) {
LOG(INFO) << "CobaltQuickInstallation: iterating slot=" << i;
// Get the path to new installation.
std::vector<char> installation_path(kSbFileMaxPath);
Expand Down Expand Up @@ -329,13 +329,15 @@ bool CobaltQuickUpdate(
continue;
} else if (slot_candidate_version < installed_version &&
current_version < installed_version &&
!DrainFileIsAnotherAppDraining(installation_dir.value().c_str(),
app_key) &&
!CheckBadFileExists(installation_dir.value().c_str(), app_key) &&
!SbFileExists(good_app_key_file_path.c_str()) &&
starboard::loader_app::AnyGoodAppKeyFile(
installation_dir.value().c_str())) {
// Found a slot with newer version than the current version that's not
(i == 0 || !DrainFileIsAnotherAppDraining(
installation_dir.value().c_str(), app_key) &&
!CheckBadFileExists(
installation_dir.value().c_str(), app_key) &&
!SbFileExists(good_app_key_file_path.c_str()) &&
starboard::loader_app::AnyGoodAppKeyFile(
installation_dir.value().c_str()))) {
// Found a slot with newer version than the current version. It's either
// the system image slot, or a writeable installation slot that's not
// draining, and no bad file of current app exists, and a good file
// exists from a another app, but not from the current app.
// The final candidate is the newest version of the valid
Expand Down

0 comments on commit b670010

Please sign in to comment.