libcutils: fs_config() add check /odm/etc/fs_config_*
Add reading of vendor file-system config files
/odm/etc/fs_config_dirs and /odm/etc/fs_config_files.
Order of interpretation (for dirs and files respectively):
- /system/etc/fs_config_dirs or /system/etc/fs_config_files
- /vendor/etc/fs_config_dirs or /vendor/etc/fs_config_files
- /oem/etc/fs_config_dirs or /oem/etc/fs_config_files
- /odm/etc/fs_config_dirs or /odm/etc/fs_config_files
- internal android_dirs[] or android_files[] structures.
No restrictions are placed on the odm file-system config files,
although the developer is advised to restrict the scope to the /odm
file-system since the intent is to provide support only for
customized portions of odm.img.
Test: full build and install smoke test and inspection
Bug: 36071012
Change-Id: Ic3afb5bb4ea20b15bd5df728be9f16045bf5b039
diff --git a/libcutils/fs_config.c b/libcutils/fs_config.c
index f99519a..f833af6 100644
--- a/libcutils/fs_config.c
+++ b/libcutils/fs_config.c
@@ -116,16 +116,21 @@
* although the developer is advised to restrict the scope to the /vendor or
* oem/ file-system since the intent is to provide support for customized
* portions of a separate vendor.img or oem.img. Has to remain open so that
- * customization can also land on /system/vendor or /system/orm. We expect
- * build-time checking or filtering when constructing the associated
- * fs_config_* files.
+ * customization can also land on /system/vendor, /system/oem or /system/odm.
+ * We expect build-time checking or filtering when constructing the associated
+ * fs_config_* files (see build/tools/fs_config/fs_config_generate.c)
*/
static const char ven_conf_dir[] = "/vendor/etc/fs_config_dirs";
static const char ven_conf_file[] = "/vendor/etc/fs_config_files";
static const char oem_conf_dir[] = "/oem/etc/fs_config_dirs";
static const char oem_conf_file[] = "/oem/etc/fs_config_files";
+static const char odm_conf_dir[] = "/odm/etc/fs_config_dirs";
+static const char odm_conf_file[] = "/odm/etc/fs_config_files";
static const char* conf[][2] = {
- {sys_conf_file, sys_conf_dir}, {ven_conf_file, ven_conf_dir}, {oem_conf_file, oem_conf_dir},
+ {sys_conf_file, sys_conf_dir},
+ {ven_conf_file, ven_conf_dir},
+ {oem_conf_file, oem_conf_dir},
+ {odm_conf_file, odm_conf_dir},
};
static const struct fs_path_config android_files[] = {
@@ -142,6 +147,8 @@
{ 00600, AID_ROOT, AID_ROOT, 0, "default.prop" },
{ 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 },
+ { 00444, AID_ROOT, AID_ROOT, 0, odm_conf_file + 1 },
{ 00444, AID_ROOT, AID_ROOT, 0, oem_conf_dir + 1 },
{ 00444, AID_ROOT, AID_ROOT, 0, oem_conf_file + 1 },
{ 00750, AID_ROOT, AID_SHELL, 0, "sbin/fs_mgr" },