Merge "Load the persistent properties after decrypting the /data partition" into honeycomb-mr1

This commit is contained in:
Ken Sumrall 2011-03-10 19:32:27 -08:00 committed by Android (Google) Code Review
commit 5db0897c65
6 changed files with 29 additions and 1 deletions

View File

@ -286,7 +286,6 @@ int do_mount(int nargs, char **args)
unsigned flags = 0;
int n, i;
int wait = 0;
char *prop;
for (n = 4; n < nargs; n++) {
for (i = 0; mount_flags[i].name; i++) {
@ -416,6 +415,8 @@ exit_success:
* unencrypted, and also trigger the action for a nonencrypted system.
*/
if (!strcmp(target, DATA_MNT_POINT)) {
const char *prop;
prop = property_get("ro.crypto.state");
if (! prop) {
prop = "notset";
@ -631,6 +632,14 @@ int do_loglevel(int nargs, char **args) {
return -1;
}
int do_load_persist_props(int nargs, char **args) {
if (nargs == 1) {
load_persist_props();
return 0;
}
return -1;
}
int do_wait(int nargs, char **args)
{
if (nargs == 2) {

View File

@ -113,6 +113,7 @@ int lookup_keyword(const char *s)
break;
case 'l':
if (!strcmp(s, "oglevel")) return K_loglevel;
if (!strcmp(s, "oad_persist_props")) return K_load_persist_props;
break;
case 'm':
if (!strcmp(s, "kdir")) return K_mkdir;

View File

@ -30,6 +30,7 @@ int do_copy(int nargs, char **args);
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_wait(int nargs, char **args);
#define __MAKE_KEYWORD_ENUM__
#define KEYWORD(symbol, flags, nargs, func) K_##symbol,
@ -81,6 +82,7 @@ enum {
KEYWORD(chown, COMMAND, 2, do_chown)
KEYWORD(chmod, COMMAND, 2, do_chmod)
KEYWORD(loglevel, COMMAND, 1, do_loglevel)
KEYWORD(load_persist_props, COMMAND, 0, do_load_persist_props)
KEYWORD(ioprio, OPTION, 0, 0)
#ifdef __MAKE_KEYWORD_ENUM__
KEYWORD_COUNT,

View File

@ -515,6 +515,18 @@ int properties_inited(void)
return property_area_inited;
}
/* When booting an encrypted system, /data is not mounted when the
* property service is started, so any properties stored there are
* not loaded. Vold triggers init to load these properties once it
* has mounted /data.
*/
void load_persist_props(void)
{
load_properties_from_file(PROP_PATH_LOCAL_OVERRIDE);
/* Read persistent properties after all default values have been loaded. */
load_persistent_properties();
}
void start_property_service(void)
{
int fd;

View File

@ -19,6 +19,7 @@
extern void handle_property_set_fd(void);
extern void property_init(void);
extern void load_persist_props(void);
extern void start_property_service(void);
void get_property_workspace(int *fd, int *sz);
extern const char* property_get(const char *name);

View File

@ -307,6 +307,9 @@ on nonencrypted
on property:vold.decrypt=trigger_reset_main
class_reset main
on property:vold.decrypt=trigger_load_persist_props
load_persist_props
on property:vold.decrypt=trigger_post_fs_data
trigger post-fs-data