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

Commit e1c2029b authored by Ameya Thakur's avatar Ameya Thakur Committed by Linux Build Service Account
Browse files

init: Add support for fast factory boot mode(ffbm)

We now boot into ffbm mode based on the value of the ro.bootmode
property.

Change-Id: Id1cd3d13182479cc9272bb4b3fb74a99083a3cff
parent c3ebecfe
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -401,6 +401,7 @@ int do_mount_all(int nargs, char **args)
    int ret = -1;
    int child_ret = -1;
    int status;
    char boot_mode[PROP_VALUE_MAX] = {0};
    struct fstab *fstab;

    if (nargs != 2) {
@@ -450,9 +451,12 @@ 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
        /* If fs_mgr determined this is an unencrypted device and we are
         * not booting into ffbm(fast factory boot mode),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 */
@@ -468,6 +472,8 @@ int do_mount_all(int nargs, char **args)

        // Although encrypted, we have device key, so we do not need to
        // do anything different from the nonencrypted case.
        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_NON_DEFAULT_FILE_ENCRYPTED) {
        if (e4crypt_install_keyring()) {
+3 −0
Original line number Diff line number Diff line
@@ -1099,6 +1099,9 @@ int main(int argc, char** argv) {
    char bootmode[PROP_VALUE_MAX];
    if (property_get("ro.bootmode", bootmode) > 0 && strcmp(bootmode, "charger") == 0) {
        action_for_each_trigger("charger", action_add_queue_tail);
    } else if (strncmp(bootmode, "ffbm", 4) == 0) {
        KLOG_ERROR("Booting into ffbm mode\n");
        action_for_each_trigger("ffbm", action_add_queue_tail);
    } else {
        action_for_each_trigger("late-init", action_add_queue_tail);
    }