summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorAmeya Thakur <ameyat@codeaurora.org>2015-08-03 12:09:52 -0700
committerLinux Build Service Account <lnxbuild@localhost>2015-10-06 03:22:38 -0600
commite1c2029ba2450c1f25001104f5e09e54824e3b9d (patch)
treebec60453f42c600df2a2fda9b9d03aabd7fdedcb /init
parentc3ebecfefb84f8328228c8253ead0eb6a9768ca8 (diff)
downloadsystem_core-e1c2029ba2450c1f25001104f5e09e54824e3b9d.zip
system_core-e1c2029ba2450c1f25001104f5e09e54824e3b9d.tar.gz
system_core-e1c2029ba2450c1f25001104f5e09e54824e3b9d.tar.bz2
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
Diffstat (limited to 'init')
-rw-r--r--init/builtins.cpp14
-rw-r--r--init/init.cpp3
2 files changed, 13 insertions, 4 deletions
diff --git a/init/builtins.cpp b/init/builtins.cpp
index 9e5f9ff..671c783 100644
--- a/init/builtins.cpp
+++ b/init/builtins.cpp
@@ -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,10 +451,13 @@ 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(fast factory boot mode),then trigger
+ * that action.
*/
- action_for_each_trigger("nonencrypted", action_add_queue_tail);
+ 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 */
ERROR("fs_mgr_mount_all suggested recovery, so wiping data via recovery.\n");
@@ -468,7 +472,9 @@ 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.
- action_for_each_trigger("nonencrypted", action_add_queue_tail);
+ 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()) {
return -1;
diff --git a/init/init.cpp b/init/init.cpp
index c72f055..3997221 100644
--- a/init/init.cpp
+++ b/init/init.cpp
@@ -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);
}