update_engine: Log the rootfs and stateful partition's lsb-release
postinst cannot not do this anymore, so we need to log it in the UE itself.
BUG=chromium:786225
TEST=cros_flash two times and made sure they are logged.
Change-Id: I2fbc593f55e6425127de283c78e4170460bac0d9
Reviewed-on: https://chromium-review.googlesource.com/791515
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Alex Deymo <deymo@google.com>
diff --git a/image_properties_chromeos.cc b/image_properties_chromeos.cc
index 6bab63f..39ddeb3 100644
--- a/image_properties_chromeos.cc
+++ b/image_properties_chromeos.cc
@@ -26,6 +26,7 @@
#include "update_engine/common/constants.h"
#include "update_engine/common/hardware_interface.h"
#include "update_engine/common/platform_constants.h"
+#include "update_engine/common/utils.h"
#include "update_engine/system_state.h"
namespace {
@@ -149,4 +150,17 @@
return lsb_release.Save(path);
}
+void LogImageProperties() {
+ std::string lsb_release;
+ if (utils::ReadFile(kLsbRelease, &lsb_release)) {
+ LOG(INFO) << "lsb-release inside the old rootfs:\n" << lsb_release;
+ }
+
+ std::string stateful_lsb_release;
+ if (utils::ReadFile(std::string(kStatefulPartition) + kLsbRelease,
+ &stateful_lsb_release)) {
+ LOG(INFO) << "stateful lsb-release:\n" << stateful_lsb_release;
+ }
+}
+
} // namespace chromeos_update_engine