PolicyManager: New System provider.

The system provider exposes information about the device from
crossystem and the kernel boot command line options.

BUG=chromium:338587
TEST=Unit tests.

Change-Id: I2837a97740b63562155717cfe6a12fad69fd8cea
Reviewed-on: https://chromium-review.googlesource.com/191121
Reviewed-by: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
diff --git a/policy_manager/real_system_provider.cc b/policy_manager/real_system_provider.cc
new file mode 100644
index 0000000..72669ff
--- /dev/null
+++ b/policy_manager/real_system_provider.cc
@@ -0,0 +1,33 @@
+// Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "update_engine/policy_manager/real_system_provider.h"
+
+#include <string>
+#include <vector>
+
+#include <base/logging.h>
+#include <vboot/crossystem.h>
+
+#include "update_engine/policy_manager/generic_variables.h"
+#include "update_engine/utils.h"
+
+using std::string;
+using std::vector;
+
+namespace chromeos_policy_manager {
+
+bool RealSystemProvider::DoInit() {
+  set_var_is_normal_boot_mode(
+      new ConstCopyVariable<bool>("is_normal_boot_mode",
+                                  VbGetSystemPropertyInt("devsw_boot") != 0));
+
+  set_var_is_official_build(
+      new ConstCopyVariable<bool>("var_is_official_build",
+                                  VbGetSystemPropertyInt("debug_build") == 0));
+
+  return true;
+}
+
+}  // namespace chromeos_policy_manager