summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSami Tolvanen <samitolvanen@google.com>2015-12-07 12:33:58 +0000
committerSami Tolvanen <samitolvanen@google.com>2015-12-09 10:09:11 +0000
commit9e9efcadc5144e465314d30ca7b3db0ec0a2bc57 (patch)
treeff3a1a7bb2adbb503c7e0f7602c3b2ff25e9aec9
parent9729392ffa40ed37aab7fd535c6644d20279bbf0 (diff)
init: set ro.boot.flash.locked from ro.boot.verifiedbootstate
If ro.oem_unlock_supported is specified for the device and it supports verified boot, export lock status in ro.boot.flash.locked. Bug: 26039090 Change-Id: Ie7844aeb458c97944c72d46ea962b9cfb0a7875d
-rw-r--r--init/init.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/init/init.cpp b/init/init.cpp
index 9f4f6254d..4aef82372 100644
--- a/init/init.cpp
+++ b/init/init.cpp
@@ -350,6 +350,18 @@ static void import_kernel_nv(const std::string& key, const std::string& value, b
}
}
+static void export_oem_lock_status() {
+ if (property_get("ro.oem_unlock_supported") != "1") {
+ return;
+ }
+
+ std::string value = property_get("ro.boot.verifiedbootstate");
+
+ if (!value.empty()) {
+ property_set("ro.boot.flash.locked", value == "orange" ? "0" : "1");
+ }
+}
+
static void export_kernel_boot_props() {
struct {
const char *src_prop;
@@ -614,6 +626,7 @@ int main(int argc, char** argv) {
signal_handler_init();
property_load_boot_defaults();
+ export_oem_lock_status();
start_property_service();
const BuiltinFunctionMap function_map;