summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authornailyk-fr <nailyk_git@nailyk.fr>2016-10-08 20:51:01 +0200
committernailyk-fr <nailyk_git@nailyk.fr>2017-02-21 20:15:17 +0100
commit8e439af05590389c586404c42ec28f1737cd4dfa (patch)
tree156f1746ae91a72c15dd6759cc2e8b189cec8d13 /init
parentb6f06802bc854f8208fc149f68c9d0410a0597c3 (diff)
shinano-common: init: Use new bootloader parsing
* This commit is required to fix build on N branches. * Mostyl took from bacon (OPO). Change-Id: I344fbe6fcea3df9af75beb3b43f7b039f27e18a8
Diffstat (limited to 'init')
-rw-r--r--init/init_shinano.cpp20
1 files changed, 5 insertions, 15 deletions
diff --git a/init/init_shinano.cpp b/init/init_shinano.cpp
index e9ed00b..f78a4a1 100644
--- a/init/init_shinano.cpp
+++ b/init/init_shinano.cpp
@@ -24,24 +24,14 @@
#include <sys/system_properties.h>
-static void import_kernel_nv(char *name, __attribute__((unused)) bool foo)
+static void import_kernel_nv(const std::string& key,
+ const std::string& value, bool for_emulator __attribute__((unused)))
{
- char *value = strchr(name, '=');
- int name_len = strlen(name);
-
- if (value == 0) return;
- *value++ = 0;
- if (name_len == 0) return;
+ if (key.empty()) return;
// We only want the bootloader version
- if (strcmp(name, "oemandroidboot.s1boot") == 0) {
- const char *boot_prop_name = name + 15;
- char prop[PROP_NAME_MAX];
- int cnt;
-
- cnt = snprintf(prop, sizeof(prop), "ro.boot.%s", boot_prop_name);
- if (cnt < PROP_NAME_MAX)
- property_set(prop, value);
+ if (key == "oemandroidboot.s1boot") {
+ property_set("ro.boot.oemandroidboot.s1boot", value.c_str());
}
}