Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f01fd5aa authored by Steve Kondik's avatar Steve Kondik Committed by Ricardo Cerqueira
Browse files

init: Support for emmc boot and init.target.rc

 * Via CodeAurora

Change-Id: Iaa9ed356574f364d8061e8941cffc3d458efc603
parent 5a05b861
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -100,6 +100,8 @@ static time_t process_needs_restart;

static const char *ENV[32];

static unsigned emmc_boot = 0;

/* add_environment - add "key=value" to the current environment */
int add_environment(const char *key, const char *val)
{
@@ -624,6 +626,10 @@ static void import_kernel_nv(char *name, int for_emulator)

    if (!strcmp(name,"qemu")) {
        strlcpy(qemu, value, sizeof(qemu));
    } else if (!strcmp(name,"androidboot.emmc")) {
        if (!strcmp(value,"true")) {
            emmc_boot = 1;
        }
    } else if (!strncmp(name, "androidboot.", 12) && name_len > 12) {
        const char *boot_prop_name = name + 12;
        char prop[PROP_NAME_MAX];
@@ -672,6 +678,7 @@ static void export_kernel_boot_props(void)

    snprintf(tmp, PROP_VALUE_MAX, "%d", revision);
    property_set("ro.revision", tmp);
    property_set("ro.emmc",emmc_boot ? "1" : "0");

    /* TODO: these are obsolete. We should delete them */
    if (!strcmp(bootmode,"factory"))
@@ -912,6 +919,12 @@ int main(int argc, char **argv)
    INFO("reading config file\n");
    init_parse_config_file("/init.rc");

    /* Check for a target specific initialisation file and read if present */
    if (access("/init.target.rc", R_OK) == 0) {
        INFO("Reading target specific config file");
            init_parse_config_file("/init.target.rc");
    }

    action_for_each_trigger("early-init", action_add_queue_tail);

    queue_builtin_action(wait_for_coldboot_done_action, "wait_for_coldboot_done");
@@ -924,7 +937,11 @@ int main(int argc, char **argv)
    /* skip mounting filesystems in charger mode */
    if (!is_charger) {
        action_for_each_trigger("early-fs", action_add_queue_tail);
    if(emmc_boot) {
        action_for_each_trigger("emmc-fs", action_add_queue_tail);
    } else {
        action_for_each_trigger("fs", action_add_queue_tail);
    }
        action_for_each_trigger("post-fs", action_add_queue_tail);
        action_for_each_trigger("post-fs-data", action_add_queue_tail);
    }