diff options
author | Andrew Mahone <andrew.mahone@gmail.com> | 2011-03-12 14:48:00 -0500 |
---|---|---|
committer | Andrew Mahone <andrew.mahone@gmail.com> | 2011-03-12 14:48:00 -0500 |
commit | 84ef75fd306194cf891592ea53c7fbedea3e0288 (patch) | |
tree | 4922de3dabcbe29c6256973f6289f27cc08591bc | |
parent | 7dfa14b9d3aac75fec8bcc2c15f86549afb67a24 (diff) | |
parent | df1ad79bef852f9315906af6330d4da5f78eaa02 (diff) | |
download | device_samsung_aries-common-84ef75fd306194cf891592ea53c7fbedea3e0288.zip device_samsung_aries-common-84ef75fd306194cf891592ea53c7fbedea3e0288.tar.gz device_samsung_aries-common-84ef75fd306194cf891592ea53c7fbedea3e0288.tar.bz2 |
Merge branch 'gingerbread' of git://github.com/teamhacksung/android_device_samsung_common into gingerbread
-rw-r--r-- | aries/core/init/Android.mk | 7 | ||||
-rwxr-xr-x | aries/core/init/init.c | 36 |
2 files changed, 24 insertions, 19 deletions
diff --git a/aries/core/init/Android.mk b/aries/core/init/Android.mk index 29fb491..3f39193 100644 --- a/aries/core/init/Android.mk +++ b/aries/core/init/Android.mk @@ -26,8 +26,13 @@ ifeq ($(TARGET_HAS_ANCIENT_MSMCAMERA), true) LOCAL_CFLAGS += -DNO_MSM_CAMDIR endif +ifeq ($(BOARD_PROVIDES_BOOTMODE), true) + LOCAL_CFLAGS += -DBOARD_PROVIDES_BOOTMODE +endif + + LOCAL_MODULE:= init.galaxys -LOCAL_MODULE_STEM:= init +LOCAL_MODULE_STEM:= init LOCAL_MODULE_TAGS := eng LOCAL_FORCE_STATIC_EXECUTABLE := true diff --git a/aries/core/init/init.c b/aries/core/init/init.c index bc2aa8a..8c42b58 100755 --- a/aries/core/init/init.c +++ b/aries/core/init/init.c @@ -404,7 +404,9 @@ static void import_kernel_nv(char *name, int in_qemu) strlcpy(qemu, value, sizeof(qemu)); } else if (!strcmp(name,"androidboot.console")) { strlcpy(console, value, sizeof(console)); - /* Samsung bootmode string */ + } else if (!strcmp(name,"androidboot.mode")) { + strlcpy(bootmode, value, sizeof(bootmode)); + /* Samsung Bootloader recovery cmdline */ } else if (!strcmp(name,"bootmode")) { strlcpy(bootmode, value, sizeof(bootmode)); } else if (!strcmp(name,"androidboot.serialno")) { @@ -581,14 +583,10 @@ static int set_init_properties_action(int nargs, char **args) if (qemu[0]) import_kernel_cmdline(1); - if (!strcmp(bootmode,"1")) + if (!strcmp(bootmode,"factory")) property_set("ro.factorytest", "1"); - else if (!strcmp(bootmode,"2")) + else if (!strcmp(bootmode,"factory2")) property_set("ro.factorytest", "2"); - else if (!strcmp(bootmode,"3")) - property_set("ro.factorytest", "3"); - else if (!strcmp(bootmode,"4")) - property_set("ro.factorytest", "4"); else property_set("ro.factorytest", "0"); @@ -695,24 +693,26 @@ int main(int argc, char **argv) open_devnull_stdio(); log_init(); + INFO("reading config file\n"); + init_parse_config_file("/init.rc"); + /* pull the kernel commandline and ramdisk properties file in */ import_kernel_cmdline(0); - INFO("reading config file\n"); - if (!strcmp(bootmode, "1")) - init_parse_config_file("/factorytest.rc"); - else if (!strcmp(bootmode, "2")) +#ifdef BOARD_PROVIDES_BOOTMODE + /* Samsung Galaxy S: special bootmode for recovery + * Samsung Bootloader only knows one Kernel, which has to detect + * from bootmode if it should run recovery. */ + if (!strcmp(bootmode, "2")) init_parse_config_file("/recovery.rc"); - else if (!strcmp(bootmode, "3")) - init_parse_config_file("/fota.rc"); - else if (!strcmp(bootmode, "4")) - init_parse_config_file("/lpm.rc"); - else { - init_parse_config_file("/init.rc"); + else +#endif + { get_hardware_name(hardware, &revision); snprintf(tmp, sizeof(tmp), "/init.%s.rc", hardware); init_parse_config_file(tmp); - } + } + action_for_each_trigger("early-init", action_add_queue_tail); |