From 8e439af05590389c586404c42ec28f1737cd4dfa Mon Sep 17 00:00:00 2001 From: nailyk-fr Date: Sat, 8 Oct 2016 20:51:01 +0200 Subject: 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 --- init/init_shinano.cpp | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'init') 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 -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()); } } -- cgit v1.2.3