update_engine: Do not attempt to run backuptool in recovery
Change-Id: I0d58eb87096a51cdaab9f66ab4f8bf257a3d2ff2
diff --git a/payload_consumer/postinstall_runner_action.cc b/payload_consumer/postinstall_runner_action.cc
index 4a70bd5..28e4515 100644
--- a/payload_consumer/postinstall_runner_action.cc
+++ b/payload_consumer/postinstall_runner_action.cc
@@ -181,7 +181,7 @@
}
#ifdef __ANDROID__
-#ifdef RUN_BACKUPTOOL
+#if !defined(__ANDROID_RECOVERY__) && defined(RUN_BACKUPTOOL)
// Check the currently installed /system partition to see if it's ever
// been mounted R/W. If it has, we'll run backuptool scripts for it
// since we can safely assume something on the partition has been
@@ -248,7 +248,7 @@
}
utils::UnmountFilesystem(fs_mount_dir_);
-#endif // RUN_BACKUPTOOL
+#endif // !__ANDROID_RECOVERY__ && RUN_BACKUPTOOL
// In Chromium OS, the postinstall step is allowed to write to the block
// device on the target image, so we don't mark it as read-only and should