update_engine: Set kernel_max_rollforward to inifinity for test images.
Instead of checking for consumer devices to set that value to infinity,
just check if the device is not an official build (test/dev images). The
consumer devices will get their value set at a later (update check)
stage. This allows bring up devices to easily have this value set.
BUG=b:129556191
TEST=none
Change-Id: I79db0c556b6d1bf80adb6adc65bc15b8d812889a
Reviewed-on: https://chromium-review.googlesource.com/1591793
Commit-Ready: Amin Hassani <ahassani@chromium.org>
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Zentaro Kavanagh <zentaro@chromium.org>
diff --git a/real_system_state.cc b/real_system_state.cc
index 700bfb7..cc03043 100644
--- a/real_system_state.cc
+++ b/real_system_state.cc
@@ -187,14 +187,13 @@
return false;
}
- // For devices that are not rollback enabled (ie. consumer devices),
- // initialize max kernel key version to 0xfffffffe, which is logically
- // infinity.
- if (policy_provider_.IsConsumerDevice()) {
+ // For images that are build for debugging purposes like test images
+ // initialize max kernel key version to 0xfffffffe, which is logical infinity.
+ if (!hardware_->IsOfficialBuild()) {
if (!hardware()->SetMaxKernelKeyRollforward(
chromeos_update_manager::kRollforwardInfinity)) {
LOG(ERROR) << "Failed to set kernel_max_rollforward to infinity for"
- << " consumer devices";
+ << " device with test/dev image.";
}
}