From 411294e83f70a28cf2fe862cad2c8a5ee544c5c2 Mon Sep 17 00:00:00 2001 From: Zhao Wei Liew Date: Sun, 6 Nov 2016 21:25:09 +0800 Subject: [PATCH] land: Check reboot reason when setting alarm_boot prop Originally in early_boot.sh Change-Id: If2ce845a28d363a2336f61cf3debac659f953172 --- init/init_land.cpp | 5 ++++- rootdir/init.qcom.rc | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/init/init_land.cpp b/init/init_land.cpp index eadcc82..f90a433 100644 --- a/init/init_land.cpp +++ b/init/init_land.cpp @@ -62,6 +62,9 @@ static void init_alarm_boot_properties() { char const *alarm_file = "/proc/sys/kernel/boot_reason"; char buf[64]; + char tmp[PROP_VALUE_MAX]; + + property_get("ro.boot.alarmboot", tmp); if (read_file2(alarm_file, buf, sizeof(buf))) { /* @@ -79,7 +82,7 @@ static void init_alarm_boot_properties() * 7 -> CBLPWR_N pin toggled (for external power supply) * 8 -> KPDPWR_N pin toggled (power key pressed) */ - if (buf[0] == '3') + if (buf[0] == '3' || !strcmp(tmp,"true")) property_set("ro.alarm_boot", "true"); else property_set("ro.alarm_boot", "false"); diff --git a/rootdir/init.qcom.rc b/rootdir/init.qcom.rc index 1908b11..83c268d 100644 --- a/rootdir/init.qcom.rc +++ b/rootdir/init.qcom.rc @@ -234,7 +234,6 @@ on early-boot # Allow subsystem (modem etc) debugging write /sys/kernel/boot_adsp/boot 1 write /sys/kernel/boot_slpi/boot 1 - exec u:r:qti_init_shell:s0 -- /init.qcom.early_boot.sh # Graphics chown system graphics /sys/class/graphics/fb0/idle_time