From 88dd713539cf109f5f9c5570a93b3e61d514c476 Mon Sep 17 00:00:00 2001 From: Paul Lawrence Date: Tue, 7 Jul 2015 17:05:58 +0000 Subject: Revert "Change init sequence to support file level encryption" This reverts commit d815178b7512cb44d8b5f234e3f823b5a3e44dea. Change-Id: I7e3f55d3092fcd04ea9f62f1971c9d42570f096c --- init/builtins.cpp | 4 ++-- init/init_parser.cpp | 2 +- init/keywords.h | 4 ++-- init/property_service.cpp | 8 +++++++- init/property_service.h | 2 +- rootdir/init.rc | 12 ++++-------- 6 files changed, 17 insertions(+), 15 deletions(-) diff --git a/init/builtins.cpp b/init/builtins.cpp index 64a363e..9e5f9ff 100644 --- a/init/builtins.cpp +++ b/init/builtins.cpp @@ -803,9 +803,9 @@ int do_load_persist_props(int nargs, char **args) { return -1; } -int do_load_system_props(int nargs, char **args) { +int do_load_all_props(int nargs, char **args) { if (nargs == 1) { - load_system_props(); + load_all_props(); return 0; } return -1; diff --git a/init/init_parser.cpp b/init/init_parser.cpp index 0f0c88e..666a86e 100644 --- a/init/init_parser.cpp +++ b/init/init_parser.cpp @@ -159,7 +159,7 @@ static int lookup_keyword(const char *s) case 'l': if (!strcmp(s, "oglevel")) return K_loglevel; if (!strcmp(s, "oad_persist_props")) return K_load_persist_props; - if (!strcmp(s, "oad_system_props")) return K_load_system_props; + if (!strcmp(s, "oad_all_props")) return K_load_all_props; break; case 'm': if (!strcmp(s, "kdir")) return K_mkdir; diff --git a/init/keywords.h b/init/keywords.h index ddaaffb..e637d7d 100644 --- a/init/keywords.h +++ b/init/keywords.h @@ -34,7 +34,7 @@ int do_chown(int nargs, char **args); int do_chmod(int nargs, char **args); int do_loglevel(int nargs, char **args); int do_load_persist_props(int nargs, char **args); -int do_load_system_props(int nargs, char **args); +int do_load_all_props(int nargs, char **args); int do_verity_load_state(int nargs, char **args); int do_verity_update_state(int nargs, char **args); int do_wait(int nargs, char **args); @@ -66,7 +66,7 @@ enum { KEYWORD(installkey, COMMAND, 1, do_installkey) KEYWORD(ioprio, OPTION, 0, 0) KEYWORD(keycodes, OPTION, 0, 0) - KEYWORD(load_system_props, COMMAND, 0, do_load_system_props) + KEYWORD(load_all_props, COMMAND, 0, do_load_all_props) KEYWORD(load_persist_props, COMMAND, 0, do_load_persist_props) KEYWORD(loglevel, COMMAND, 1, do_loglevel) KEYWORD(mkdir, COMMAND, 1, do_mkdir) diff --git a/init/property_service.cpp b/init/property_service.cpp index 52f6b98..c2881ae 100644 --- a/init/property_service.cpp +++ b/init/property_service.cpp @@ -560,10 +560,16 @@ void load_recovery_id_prop() { close(fd); } -void load_system_props() { +void load_all_props() { load_properties_from_file(PROP_PATH_SYSTEM_BUILD, NULL); load_properties_from_file(PROP_PATH_VENDOR_BUILD, NULL); load_properties_from_file(PROP_PATH_FACTORY, "ro.*"); + + load_override_properties(); + + /* Read persistent properties after all default values have been loaded. */ + load_persistent_properties(); + load_recovery_id_prop(); } diff --git a/init/property_service.h b/init/property_service.h index 303f251..a27053d 100644 --- a/init/property_service.h +++ b/init/property_service.h @@ -23,7 +23,7 @@ extern void property_init(void); extern void property_load_boot_defaults(void); extern void load_persist_props(void); -extern void load_system_props(void); +extern void load_all_props(void); extern void start_property_service(void); void get_property_workspace(int *fd, int *sz); extern int __property_get(const char *name, char *value); diff --git a/rootdir/init.rc b/rootdir/init.rc index dd97bcd..7af2b77 100644 --- a/rootdir/init.rc +++ b/rootdir/init.rc @@ -181,8 +181,8 @@ on property:sys.boot_from_charger_mode=1 trigger late-init # Load properties from /system/ + /factory after fs mount. -on load_system_props_action - load_system_props +on load_all_props_action + load_all_props start logd start logd-reinit @@ -195,16 +195,12 @@ on late-init trigger early-fs trigger fs trigger post-fs + trigger post-fs-data # Load properties from /system/ + /factory after fs mount. Place # this in another action so that the load will be scheduled after the prior # issued fs triggers have completed. - trigger load_system_props_action - - # Now we can mount /data. File encryption requires keymaster to decrypt - # /data, which in turn can only be loaded when system properties are present - trigger post-fs-data - trigger load_persist_props + trigger load_all_props_action # Remove a file to wake up anything waiting for firmware. trigger firmware_mounts_complete -- cgit v1.1 From 17b314fd73b2849121e22d8386b740a11eb6a95f Mon Sep 17 00:00:00 2001 From: Tim Murray Date: Wed, 2 Sep 2015 11:27:55 -0700 Subject: Add zygote to the foreground cpuset. This ensures that newly forked zygote processes will end up in the corret cpuset. bug 23751126 Change-Id: I987a2828cf2504963f1317d17f0b51d26cf22a70 --- rootdir/init.zygote32.rc | 2 +- rootdir/init.zygote32_64.rc | 2 ++ rootdir/init.zygote64.rc | 2 +- rootdir/init.zygote64_32.rc | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/rootdir/init.zygote32.rc b/rootdir/init.zygote32.rc index 75961e6..ff25ac2 100644 --- a/rootdir/init.zygote32.rc +++ b/rootdir/init.zygote32.rc @@ -5,4 +5,4 @@ service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-sys onrestart write /sys/power/state on onrestart restart media onrestart restart netd - + writepid /dev/cpuset/foreground/tasks diff --git a/rootdir/init.zygote32_64.rc b/rootdir/init.zygote32_64.rc index 68c0668..29bb1cf 100644 --- a/rootdir/init.zygote32_64.rc +++ b/rootdir/init.zygote32_64.rc @@ -5,8 +5,10 @@ service zygote /system/bin/app_process32 -Xzygote /system/bin --zygote --start-s onrestart write /sys/power/state on onrestart restart media onrestart restart netd + writepid /dev/cpuset/foreground/tasks service zygote_secondary /system/bin/app_process64 -Xzygote /system/bin --zygote --socket-name=zygote_secondary class main socket zygote_secondary stream 660 root system onrestart restart zygote + writepid /dev/cpuset/foreground/tasks \ No newline at end of file diff --git a/rootdir/init.zygote64.rc b/rootdir/init.zygote64.rc index afb6d63..5497524 100644 --- a/rootdir/init.zygote64.rc +++ b/rootdir/init.zygote64.rc @@ -5,4 +5,4 @@ service zygote /system/bin/app_process64 -Xzygote /system/bin --zygote --start-s onrestart write /sys/power/state on onrestart restart media onrestart restart netd - + writepid /dev/cpuset/foreground/tasks diff --git a/rootdir/init.zygote64_32.rc b/rootdir/init.zygote64_32.rc index 979ab3b..8ed5e9e 100644 --- a/rootdir/init.zygote64_32.rc +++ b/rootdir/init.zygote64_32.rc @@ -5,8 +5,10 @@ service zygote /system/bin/app_process64 -Xzygote /system/bin --zygote --start-s onrestart write /sys/power/state on onrestart restart media onrestart restart netd + writepid /dev/cpuset/foreground/tasks service zygote_secondary /system/bin/app_process32 -Xzygote /system/bin --zygote --socket-name=zygote_secondary class main socket zygote_secondary stream 660 root system onrestart restart zygote + writepid /dev/cpuset/foreground/tasks \ No newline at end of file -- cgit v1.1