OSDN Git Service

init: set default value of ro.hardware to the target name
authorChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 23 Sep 2016 09:59:47 +0000 (17:59 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Sat, 6 May 2017 14:54:43 +0000 (22:54 +0800)
People usually forget to set the value of androidboot.hardware to
the target name in kernel cmdline which results in boot failure.

The change tries to reduce such an error in the future. The target
name is hardcoded to the image. This eliminates the necessity of
androidboot.hardware.

init/Android.mk
init/init.cpp

index 65aab82..32d79e2 100644 (file)
@@ -60,6 +60,7 @@ include $(BUILD_STATIC_LIBRARY)
 
 include $(CLEAR_VARS)
 LOCAL_CPPFLAGS := $(init_cflags)
+LOCAL_CPPFLAGS += -DTARGET_PRODUCT=\"$(TARGET_PRODUCT)\"
 LOCAL_SRC_FILES:= \
     bootchart.cpp \
     builtins.cpp \
index 978dde8..f5b4c54 100644 (file)
@@ -427,7 +427,7 @@ static void export_kernel_boot_props() {
         { "ro.boot.mode",       "ro.bootmode",   "unknown", },
         { "ro.boot.baseband",   "ro.baseband",   "unknown", },
         { "ro.boot.bootloader", "ro.bootloader", "unknown", },
-        { "ro.boot.hardware",   "ro.hardware",   "unknown", },
+        { "ro.boot.hardware",   "ro.hardware",   TARGET_PRODUCT, },
         { "ro.boot.revision",   "ro.revision",   "0", },
     };
     for (size_t i = 0; i < ARRAY_SIZE(prop_map); i++) {