summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--init/property_service.cpp34
-rw-r--r--libcutils/fs_config.cpp15
2 files changed, 17 insertions, 32 deletions
diff --git a/init/property_service.cpp b/init/property_service.cpp
index 7fa37c8a9..18e47e3df 100644
--- a/init/property_service.cpp
+++ b/init/property_service.cpp
@@ -443,7 +443,7 @@ static void handle_property_set_fd() {
443 } 443 }
444} 444}
445 445
446static bool load_properties_from_file(const char *, const char *); 446static void load_properties_from_file(const char *, const char *);
447 447
448/* 448/*
449 * Filter is used to decide which properties to load: NULL loads all keys, 449 * Filter is used to decide which properties to load: NULL loads all keys,
@@ -507,18 +507,17 @@ static void load_properties(char *data, const char *filter)
507 507
508// Filter is used to decide which properties to load: NULL loads all keys, 508// Filter is used to decide which properties to load: NULL loads all keys,
509// "ro.foo.*" is a prefix match, and "ro.foo.bar" is an exact match. 509// "ro.foo.*" is a prefix match, and "ro.foo.bar" is an exact match.
510static bool load_properties_from_file(const char* filename, const char* filter) { 510static void load_properties_from_file(const char* filename, const char* filter) {
511 Timer t; 511 Timer t;
512 std::string data; 512 std::string data;
513 std::string err; 513 std::string err;
514 if (!ReadFile(filename, &data, &err)) { 514 if (!ReadFile(filename, &data, &err)) {
515 PLOG(WARNING) << "Couldn't load property file: " << filename << ": " << err; 515 PLOG(WARNING) << "Couldn't load property file: " << err;
516 return false; 516 return;
517 } 517 }
518 data.push_back('\n'); 518 data.push_back('\n');
519 load_properties(&data[0], filter); 519 load_properties(&data[0], filter);
520 LOG(VERBOSE) << "(Loading properties from " << filename << " took " << t << ".)"; 520 LOG(VERBOSE) << "(Loading properties from " << filename << " took " << t << ".)";
521 return true;
522} 521}
523 522
524static void load_persistent_properties() { 523static void load_persistent_properties() {
@@ -593,21 +592,16 @@ static void update_sys_usb_config() {
593} 592}
594 593
595void property_load_boot_defaults() { 594void property_load_boot_defaults() {
596 if (!load_properties_from_file("/system/etc/prop.default", nullptr)) { 595 load_properties_from_file("/default.prop", NULL);
597 // for legacy devices 596 load_properties_from_file("/odm/default.prop", NULL);
598 if (!load_properties_from_file("/default.prop", nullptr)) { 597 load_properties_from_file("/vendor/default.prop", NULL);
599 PLOG(ERROR) << "Failed to load default prop";
600 }
601 }
602 load_properties_from_file("/odm/etc/prop.default", nullptr);
603 load_properties_from_file("/vendor/etc/prop.default", nullptr);
604 598
605 update_sys_usb_config(); 599 update_sys_usb_config();
606} 600}
607 601
608static void load_override_properties() { 602static void load_override_properties() {
609 if (ALLOW_LOCAL_PROP_OVERRIDE) { 603 if (ALLOW_LOCAL_PROP_OVERRIDE) {
610 load_properties_from_file("/data/local.prop", nullptr); 604 load_properties_from_file("/data/local.prop", NULL);
611 } 605 }
612} 606}
613 607
@@ -655,15 +649,9 @@ void load_recovery_id_prop() {
655} 649}
656 650
657void load_system_props() { 651void load_system_props() {
658 if (!load_properties_from_file("/system/etc/prop.build", nullptr)) { 652 load_properties_from_file("/system/build.prop", NULL);
659 // for legacy devices 653 load_properties_from_file("/odm/build.prop", NULL);
660 load_properties_from_file("/system/build.prop", nullptr); 654 load_properties_from_file("/vendor/build.prop", NULL);
661 }
662 load_properties_from_file("/odm/etc/prop.build", nullptr);
663 if (!load_properties_from_file("/vendor/etc/prop.build", nullptr)) {
664 // for legacy devices
665 load_properties_from_file("/vendor/build.prop", nullptr);
666 }
667 load_properties_from_file("/factory/factory.prop", "ro.*"); 655 load_properties_from_file("/factory/factory.prop", "ro.*");
668 load_recovery_id_prop(); 656 load_recovery_id_prop();
669} 657}
diff --git a/libcutils/fs_config.cpp b/libcutils/fs_config.cpp
index dd1ad3a38..919b65bc3 100644
--- a/libcutils/fs_config.cpp
+++ b/libcutils/fs_config.cpp
@@ -134,10 +134,9 @@ static const struct fs_path_config android_files[] = {
134 { 00640, AID_ROOT, AID_SHELL, 0, "data/nativetest64/tests.txt" }, 134 { 00640, AID_ROOT, AID_SHELL, 0, "data/nativetest64/tests.txt" },
135 { 00750, AID_ROOT, AID_SHELL, 0, "data/nativetest/*" }, 135 { 00750, AID_ROOT, AID_SHELL, 0, "data/nativetest/*" },
136 { 00750, AID_ROOT, AID_SHELL, 0, "data/nativetest64/*" }, 136 { 00750, AID_ROOT, AID_SHELL, 0, "data/nativetest64/*" },
137 { 00600, AID_ROOT, AID_ROOT, 0, "default.prop" }, // legacy 137 { 00600, AID_ROOT, AID_ROOT, 0, "default.prop" },
138 { 00600, AID_ROOT, AID_ROOT, 0, "system/etc/prop.default" }, 138 { 00600, AID_ROOT, AID_ROOT, 0, "odm/build.prop" },
139 { 00600, AID_ROOT, AID_ROOT, 0, "odm/etc/prop.build" }, 139 { 00600, AID_ROOT, AID_ROOT, 0, "odm/default.prop" },
140 { 00600, AID_ROOT, AID_ROOT, 0, "odm/etc/prop.default" },
141 { 00444, AID_ROOT, AID_ROOT, 0, odm_conf_dir + 1 }, 140 { 00444, AID_ROOT, AID_ROOT, 0, odm_conf_dir + 1 },
142 { 00444, AID_ROOT, AID_ROOT, 0, odm_conf_file + 1 }, 141 { 00444, AID_ROOT, AID_ROOT, 0, odm_conf_file + 1 },
143 { 00444, AID_ROOT, AID_ROOT, 0, oem_conf_dir + 1 }, 142 { 00444, AID_ROOT, AID_ROOT, 0, oem_conf_dir + 1 },
@@ -149,8 +148,7 @@ static const struct fs_path_config android_files[] = {
149 { 00750, AID_ROOT, AID_ROOT, 0, "system/bin/install-recovery.sh" }, 148 { 00750, AID_ROOT, AID_ROOT, 0, "system/bin/install-recovery.sh" },
150 { 00700, AID_ROOT, AID_ROOT, 0, "system/bin/secilc" }, 149 { 00700, AID_ROOT, AID_ROOT, 0, "system/bin/secilc" },
151 { 00750, AID_ROOT, AID_ROOT, 0, "system/bin/uncrypt" }, 150 { 00750, AID_ROOT, AID_ROOT, 0, "system/bin/uncrypt" },
152 { 00600, AID_ROOT, AID_ROOT, 0, "system/build.prop" }, // legacy 151 { 00600, AID_ROOT, AID_ROOT, 0, "system/build.prop" },
153 { 00600, AID_ROOT, AID_ROOT, 0, "system/etc/prop.build" },
154 { 00444, AID_ROOT, AID_ROOT, 0, sys_conf_dir + 1 }, 152 { 00444, AID_ROOT, AID_ROOT, 0, sys_conf_dir + 1 },
155 { 00444, AID_ROOT, AID_ROOT, 0, sys_conf_file + 1 }, 153 { 00444, AID_ROOT, AID_ROOT, 0, sys_conf_file + 1 },
156 { 00440, AID_ROOT, AID_SHELL, 0, "system/etc/init.goldfish.rc" }, 154 { 00440, AID_ROOT, AID_SHELL, 0, "system/etc/init.goldfish.rc" },
@@ -159,9 +157,8 @@ static const struct fs_path_config android_files[] = {
159 { 00555, AID_ROOT, AID_ROOT, 0, "system/etc/ppp/*" }, 157 { 00555, AID_ROOT, AID_ROOT, 0, "system/etc/ppp/*" },
160 { 00555, AID_ROOT, AID_ROOT, 0, "system/etc/rc.*" }, 158 { 00555, AID_ROOT, AID_ROOT, 0, "system/etc/rc.*" },
161 { 00440, AID_ROOT, AID_ROOT, 0, "system/etc/recovery.img" }, 159 { 00440, AID_ROOT, AID_ROOT, 0, "system/etc/recovery.img" },
162 { 00600, AID_ROOT, AID_ROOT, 0, "vendor/build.prop" }, // legacy 160 { 00600, AID_ROOT, AID_ROOT, 0, "vendor/build.prop" },
163 { 00600, AID_ROOT, AID_ROOT, 0, "vendor/etc/prop.build" }, 161 { 00600, AID_ROOT, AID_ROOT, 0, "vendor/default.prop" },
164 { 00600, AID_ROOT, AID_ROOT, 0, "vendor/etc/prop.default" },
165 { 00444, AID_ROOT, AID_ROOT, 0, ven_conf_dir + 1 }, 162 { 00444, AID_ROOT, AID_ROOT, 0, ven_conf_dir + 1 },
166 { 00444, AID_ROOT, AID_ROOT, 0, ven_conf_file + 1 }, 163 { 00444, AID_ROOT, AID_ROOT, 0, ven_conf_file + 1 },
167 164