Mark the new slot as not ready from the DownloadAction.
The FilesystemVerifierAction used to copy over the old kernel and old
rootfs to the new slot, invalidating the contents of the new slot
during the copy. Since now it only parses the source partitions,
marking the new slot as unbootable can be delayed until the payload
starts to download.
Bug: 24667689
Test: FEATURES=test emerge-link update_engine
Change-Id: I17736a10787cb747d181e8dffcc0bc58f9a0cabb
diff --git a/download_action.cc b/download_action.cc
index b913c97..a31c8a3 100644
--- a/download_action.cc
+++ b/download_action.cc
@@ -25,6 +25,7 @@
#include <base/strings/stringprintf.h>
#include "update_engine/action_pipe.h"
+#include "update_engine/boot_control_interface.h"
#include "update_engine/omaha_request_params.h"
#include "update_engine/p2p_manager.h"
#include "update_engine/payload_state_interface.h"
@@ -168,6 +169,14 @@
install_plan_.Dump();
+ LOG(INFO) << "Marking new slot as unbootable";
+ if (!system_state_->boot_control()->MarkSlotUnbootable(
+ install_plan_.target_slot)) {
+ LOG(WARNING) << "Unable to mark new slot "
+ << BootControlInterface::SlotName(install_plan_.target_slot)
+ << ". Proceeding with the update anyway.";
+ }
+
if (writer_) {
LOG(INFO) << "Using writer for test.";
} else {