diff options
| author | Luca Stefani <luca.stefani.ge1@gmail.com> | 2016-07-12 10:44:35 +0200 |
|---|---|---|
| committer | MobiusM <danholandi@gmail.com> | 2016-07-20 20:00:13 +0300 |
| commit | 301f4925d2f0d00cc32aac98ff78aae98aafd577 (patch) | |
| tree | 21c1ca7f02ca1094d39cb68c5cff2e915bea5daf | |
| parent | 9531c5dcd2f1c0ea196368246748c8404495b5c4 (diff) | |
g2m: Move to standalone libinitmm6.0
Change-Id: I0a697e9df1f9ca809002e8051ab5162cc208abfc
| -rw-r--r-- | BoardConfig.mk | 6 | ||||
| -rw-r--r-- | init/Android.mk | 11 | ||||
| -rw-r--r-- | init/init_g2m.cpp | 48 |
3 files changed, 24 insertions, 41 deletions
diff --git a/BoardConfig.mk b/BoardConfig.mk index 830320c..55d9065 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -26,11 +26,11 @@ -include device/lge/msm8226-common/BoardConfigCommon.mk # Vendor Init -TARGET_UNIFIED_DEVICE := true -TARGET_INIT_VENDOR_LIB := libinit_msm -TARGET_LIBINIT_DEFINES_FILE := device/lge/g2m/init/init_g2m.cpp +TARGET_INIT_VENDOR_LIB := libinit_g2m TARGET_OTA_ASSERT_DEVICE := g2m,g2mds,g2mss,d620,d618,d610 +TARGET_RECOVERY_DEVICE_MODULES := libinit_g2m TARGET_RELEASETOOLS_EXTENSIONS := device/lge/g2m +TARGET_UNIFIED_DEVICE := true # Bootloader TARGET_BOOTLOADER_BOARD_NAME := g2m diff --git a/init/Android.mk b/init/Android.mk new file mode 100644 index 0000000..a2080d7 --- /dev/null +++ b/init/Android.mk @@ -0,0 +1,11 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE_TAGS := optional +LOCAL_C_INCLUDES := system/core/init +LOCAL_CFLAGS := -Wall -DANDROID_TARGET=\"$(TARGET_BOARD_PLATFORM)\" +LOCAL_SRC_FILES := init_g2m.cpp +LOCAL_MODULE := libinit_g2m + +include $(BUILD_STATIC_LIBRARY) diff --git a/init/init_g2m.cpp b/init/init_g2m.cpp index 968bcc0..d79e16a 100644 --- a/init/init_g2m.cpp +++ b/init/init_g2m.cpp @@ -36,36 +36,7 @@ #include "log.h" #include "util.h" - -#define CHUNK 2048 /* read 2048 bytes at a time */ - -int check_cmdline(const char param[]) { - - char buf[CHUNK]; - FILE *file; - size_t nread; - file = fopen("/proc/cmdline", "r"); - if (file) { - while ((nread = fread(buf, 1, sizeof buf, file)) > 0) { - /* fwrite(buf, 1, nread, stdout); */ - char delims[] = " "; - char *word = NULL; - word = strtok(buf, delims); - - while(word != NULL) { - if (!strcmp(param,word)) { - fclose(file); - return 1; - } - word = strtok(NULL, delims); - } - } - } - fclose(file); - return 0; -} - -void init_msm_properties(unsigned long msm_id, unsigned long msm_ver, char *board_type) +void vendor_load_properties() { char serial[PROP_VALUE_MAX]; char device[PROP_VALUE_MAX]; @@ -78,23 +49,23 @@ void init_msm_properties(unsigned long msm_id, unsigned long msm_ver, char *boar property_set("ro.product.model", "LG-D618"); property_set("ro.build.description", "g2mds_global_com-user 5.0.2 LRX22G 152311629f422 release-keys"); property_set("ro.build.fingerprint", "lge/g2mds_global_com/g2mds:5.0.2/LRX22G/152311629f422:user/release-keys"); - property_set("persist.radio.multisim.config", "dsds"); + property_set("persist.radio.multisim.config", "dsds"); property_set("persist.multisim.config", "dsds"); - property_set("persist.radio.dont_use_dsd", "true"); - property_set("ro.telephony.ril.config", "simactivation"); + property_set("persist.radio.dont_use_dsd", "true"); + property_set("ro.telephony.ril.config", "simactivation"); } else if (strncmp(serial, "LGD610", 6) == 0) { /* D610 */ - property_set("ro.product.model", "LG-D610"); - property_set("ro.product.device", "g2mss"); + property_set("ro.product.model", "LG-D610"); + property_set("ro.product.device", "g2mss"); property_set("ro.build.description", "g2mss_global_com-user 5.0.2 LRX22G 152311629f422 release-keys"); property_set("ro.build.fingerprint", "lge/g2mss_global_com/g2mss:5.0.2/LRX22G/152311629f422:user/release-keys"); property_set("persist.radio.multisim.config", ""); property_set("persist.multisim.config", ""); } else if (strncmp(serial, "LGD620", 6) == 0) { /* D620 */ - property_set("ro.product.model", "LG-D620"); - property_set("ro.product.device", "g2m"); - property_set("ro.nfc.port", "I2C"); + property_set("ro.product.model", "LG-D620"); + property_set("ro.product.device", "g2m"); + property_set("ro.nfc.port", "I2C"); property_set("ro.build.description", "g2m_global_com-user 5.0.2 LRX22G 152311629f422 release-keys"); property_set("ro.build.fingerprint", "lge/g2m_global_com/g2m:5.0.2/LRX22G/152311629f422:user/release-keys"); property_set("persist.radio.multisim.config", ""); @@ -107,6 +78,7 @@ void init_msm_properties(unsigned long msm_id, unsigned long msm_ver, char *boar property_set("persist.radio.multisim.config", ""); property_set("persist.multisim.config", ""); } + property_get("ro.product.device", device); strlcpy(devicename, device, sizeof(devicename)); ERROR("Found hardware id: %s setting build properties for %s device\n", serial, devicename); |
