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

Commit 68737e6d authored by Ameya Thakur's avatar Ameya Thakur Committed by Steve Kondik
Browse files

init: add 'ffbm' action trigger when booting in factory mode

Android init process was extedned to recognize new boot mode
and start only required services for this mode. Init process will add
new action trigger 'ffbm', which will take care of rest of the
initialization process. 'ffbm' action trigger is defined in Qualcomm's
private init.rc file. It's functionality is identical with main
Android's 'boot' action triger except it doesnt add trigger actions
'core' and 'main'. Action trigger will start only minimal set of
services (media, adb, qcom-post-boot, rmt_storage) required for test
environment to operate correctly .

Change-Id: If74201f83d663e2f2932720cc3ecb494a61a854e
parent 2e8628e9
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -551,6 +551,7 @@ int do_mount_all(int nargs, char **args)
    int ret = -1;
    int child_ret = -1;
    int status;
    char boot_mode[PROP_VALUE_MAX];
    const char *prop;
    struct fstab *fstab;

@@ -600,9 +601,11 @@ int do_mount_all(int nargs, char **args)
        property_set("vold.decrypt", "trigger_default_encryption");
    } else if (ret == FS_MGR_MNTALL_DEV_NOT_ENCRYPTED) {
        property_set("ro.crypto.state", "unencrypted");
        /* If fs_mgr determined this is an unencrypted device, then trigger
         * that action.
        /* If fs_mgr determined this is an unencrypted device and we are
         * not booting into ffbm then trigger that action.
         */
        property_get("ro.bootmode", boot_mode);
        if (strncmp(boot_mode, "ffbm", 4))
            action_for_each_trigger("nonencrypted", action_add_queue_tail);
    } else if (ret == FS_MGR_MNTALL_DEV_NEEDS_RECOVERY) {
        /* Setup a wipe via recovery, and reboot into recovery */
+9 −3
Original line number Diff line number Diff line
@@ -1009,6 +1009,7 @@ int main(int argc, char **argv)
    int signal_fd_init = 0;
    int keychord_fd_init = 0;
    bool is_charger = false;
    bool is_ffbm = false;

    if (!strcmp(basename(argv[0]), "ueventd"))
        return ueventd_main(argc, argv);
@@ -1068,6 +1069,8 @@ int main(int argc, char **argv)
    restorecon("/dev/__properties__");
    restorecon_recursive("/sys");

    is_ffbm = !strncmp(bootmode, "ffbm", 4);
    if (!is_ffbm)
        is_charger = !strcmp(bootmode, "charger");

    INFO("property init\n");
@@ -1096,10 +1099,13 @@ int main(int argc, char **argv)
    /* Don't mount filesystems or start core system services if in charger mode. */
    if (is_charger) {
        action_for_each_trigger("charger", action_add_queue_tail);
    } else {
        if (is_ffbm) {
            action_for_each_trigger("ffbm", action_add_queue_tail);
        } else {
            action_for_each_trigger("late-init", action_add_queue_tail);
        }

    }
    /* run all property triggers based on current state of the properties */
    queue_builtin_action(queue_property_triggers_action, "queue_property_triggers");