Merge "fs_mgr: Adding logs when failing to wait for a device file" am: 4ca2a30368
am: 694985721f
Change-Id: I86f7cf743e1e9f2466eb7675ebc1de61ae9ab3ec
diff --git a/init/property_service.cpp b/init/property_service.cpp
index 0af6c21..b7907e5 100644
--- a/init/property_service.cpp
+++ b/init/property_service.cpp
@@ -517,7 +517,7 @@
}
}
-static void load_properties_from_file(const char *, const char *);
+static bool load_properties_from_file(const char *, const char *);
/*
* Filter is used to decide which properties to load: NULL loads all keys,
@@ -581,17 +581,18 @@
// Filter is used to decide which properties to load: NULL loads all keys,
// "ro.foo.*" is a prefix match, and "ro.foo.bar" is an exact match.
-static void load_properties_from_file(const char* filename, const char* filter) {
+static bool load_properties_from_file(const char* filename, const char* filter) {
Timer t;
std::string data;
std::string err;
if (!ReadFile(filename, &data, &err)) {
PLOG(WARNING) << "Couldn't load property file: " << err;
- return;
+ return false;
}
data.push_back('\n');
load_properties(&data[0], filter);
LOG(VERBOSE) << "(Loading properties from " << filename << " took " << t << ".)";
+ return true;
}
static void load_persistent_properties() {
@@ -666,7 +667,13 @@
}
void property_load_boot_defaults() {
- load_properties_from_file("/default.prop", NULL);
+ if (!load_properties_from_file("/system/etc/prop.default", NULL)) {
+ // Try recovery path
+ if (!load_properties_from_file("/prop.default", NULL)) {
+ // Try legacy path
+ load_properties_from_file("/default.prop", NULL);
+ }
+ }
load_properties_from_file("/odm/default.prop", NULL);
load_properties_from_file("/vendor/default.prop", NULL);
diff --git a/libcutils/fs_config.cpp b/libcutils/fs_config.cpp
index a1dbd78..cc96ff8 100644
--- a/libcutils/fs_config.cpp
+++ b/libcutils/fs_config.cpp
@@ -134,7 +134,8 @@
{ 00640, AID_ROOT, AID_SHELL, 0, "data/nativetest64/tests.txt" },
{ 00750, AID_ROOT, AID_SHELL, 0, "data/nativetest/*" },
{ 00750, AID_ROOT, AID_SHELL, 0, "data/nativetest64/*" },
- { 00600, AID_ROOT, AID_ROOT, 0, "default.prop" },
+ { 00600, AID_ROOT, AID_ROOT, 0, "default.prop" }, // legacy
+ { 00600, AID_ROOT, AID_ROOT, 0, "system/etc/prop.default" },
{ 00600, AID_ROOT, AID_ROOT, 0, "odm/build.prop" },
{ 00600, AID_ROOT, AID_ROOT, 0, "odm/default.prop" },
{ 00444, AID_ROOT, AID_ROOT, 0, odm_conf_dir + 1 },