Commit ae7f92ce authored by Marton Hunyady's avatar Marton Hunyady Committed by Commit Bot

Add logging when a rollback or powerwash notification is shown

Add warning level logging when:
- It's detected that update_engine is downloading a rollback
  image or switching channel.
- Notification about the rollback or channel switch to a more
  stable channel is shown.

Bug: 871759
Change-Id: I930b7a23def82ff239ec8da4feeff9daaf960b37
Reviewed-on: https://chromium-review.googlesource.com/1190882
Commit-Queue: Marton Hunyady <hunyadym@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#586754}
parent 2f6659c5
......@@ -8,6 +8,7 @@
#include <utility>
#include "base/logging.h"
#include "base/macros.h"
#include "base/metrics/histogram_macros.h"
#include "base/no_destructor.h"
......@@ -231,6 +232,10 @@ void UpgradeDetectorChromeos::OnChannelsReceived(std::string current_channel,
to_more_stable_channel
? RollbackReason::kToMoreStableChannel
: RollbackReason::kEnterpriseRollback);
LOG(WARNING) << "Device is rolling back, will require powerwash. Reason: "
<< to_more_stable_channel
<< ", current_channel: " << current_channel
<< ", target_channel: " << target_channel;
// ChromeOS shows upgrade arrow once the upgrade becomes available.
NotifyOnUpgrade();
......
......@@ -7,12 +7,14 @@
#include <stdint.h>
#include <algorithm>
#include <string>
#include <vector>
#include "base/bind.h"
#include "base/callback.h"
#include "base/command_line.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/macros.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/string_util.h"
......@@ -503,11 +505,14 @@ class UpdateEngineClientImpl : public UpdateEngineClient {
status.new_version = new_version;
// TODO(hunyadym, https://crbug.com/864672): Add a new DBus call to
// determine this based on the Omaha response, and not version comparison.
status.is_rollback = version_loader::IsRollback(
version_loader::GetVersion(version_loader::VERSION_SHORT),
status.new_version);
if (status.is_rollback)
VLOG(1) << "New image is a rollback.";
std::string current_version =
version_loader::GetVersion(version_loader::VERSION_SHORT);
status.is_rollback =
version_loader::IsRollback(current_version, status.new_version);
if (status.is_rollback) {
LOG(WARNING) << "New image is a rollback from " << current_version
<< " to " << new_version << ".";
}
status.new_size = new_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment