diff options
author | Paul Lawrence <paullawrence@google.com> | 2014-02-03 13:27:49 -0800 |
---|---|---|
committer | Paul Lawrence <paullawrence@google.com> | 2014-03-24 15:00:53 -0700 |
commit | 166fa3de7060198252b43a4a9ddd841fb6d65cf7 (patch) | |
tree | 8835ae87de18f84267e858bae2583795c937fb38 /init | |
parent | 347c8de285454af2d3cba3d9b43d3bf23b20babb (diff) | |
download | system_core-166fa3de7060198252b43a4a9ddd841fb6d65cf7.zip system_core-166fa3de7060198252b43a4a9ddd841fb6d65cf7.tar.gz system_core-166fa3de7060198252b43a4a9ddd841fb6d65cf7.tar.bz2 |
Auto-encrypt drive at startup
Modify fs_mgr to unmount encryptable drives after test mounting them and
then trigger an auto-encrypt via the init script
Needs matching vold changes from
https://googleplex-android-review.googlesource.com/#/c/414200/
Feature is limited to list of serial numbers with this change
Bug: 11985952
Change-Id: I84f85a258b6a7e9809467c9149249302e203c41b
Diffstat (limited to 'init')
-rw-r--r-- | init/builtins.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/init/builtins.c b/init/builtins.c index a168062..a857c98 100644 --- a/init/builtins.c +++ b/init/builtins.c @@ -501,8 +501,12 @@ int do_mount_all(int nargs, char **args) return -1; } - /* ret is 1 if the device appears encrypted, 0 if not, and -1 on error */ - if (ret == 1) { + /* ret is 2 if device needs encrypted, 1 if the device appears encrypted, + * 0 if not, and -1 on error */ + if (ret == 2) { + property_set("ro.crypto.state", "unencrypted"); + property_set("vold.decrypt", "trigger_encryption"); + } else if (ret == 1) { property_set("ro.crypto.state", "encrypted"); property_set("vold.decrypt", "trigger_default_encryption"); } else if (ret == 0) { |