From 62c701e1740847afab640b3610fc44c1d8eeb5e9 Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Tue, 21 Mar 2017 08:09:52 -0700 Subject: [PATCH] libcutils: fs_config() add check /oem/etc/fs_config_* Add reading of vendor file-system config files /oem/etc/fs_config_dirs and /oem/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 - internal android_dirs[] or android_files[] structures. No restrictions are placed on the oem file-system config files, although the developer is advised to restrict the scope to the /oem file-system since the intent is to provide support only for customized portions of oem.img. Test: full build and install smoke test and inspection Bug: 36071012 Change-Id: I56f3fed5efa44d622a9a110937dbc949083d44ae --- libcutils/fs_config.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/libcutils/fs_config.c b/libcutils/fs_config.c index 7a2301d0c..f99519aed 100644 --- a/libcutils/fs_config.c +++ b/libcutils/fs_config.c @@ -112,17 +112,20 @@ static const struct fs_path_config android_dirs[] = { */ static const char sys_conf_dir[] = "/system/etc/fs_config_dirs"; static const char sys_conf_file[] = "/system/etc/fs_config_files"; -/* No restrictions are placed on the vendor file-system config files, - * although the developer is advised to restrict the scope to the /vendor - * file-system since the intent is to provide support for customized - * portions of a separate vendor.img. Has to remain open so that - * customization can also land on /system/vendor. We expect build-time - * checking or filtering when constructing /vendor/etc/fs_config_* files. +/* No restrictions are placed on the vendor and oem file-system config files, + * 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. */ 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* conf[][2] = { - {sys_conf_file, sys_conf_dir}, {ven_conf_file, ven_conf_dir}, + {sys_conf_file, sys_conf_dir}, {ven_conf_file, ven_conf_dir}, {oem_conf_file, oem_conf_dir}, }; static const struct fs_path_config android_files[] = { @@ -139,6 +142,8 @@ static const struct fs_path_config android_files[] = { { 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, oem_conf_dir + 1 }, + { 00444, AID_ROOT, AID_ROOT, 0, oem_conf_file + 1 }, { 00750, AID_ROOT, AID_SHELL, 0, "sbin/fs_mgr" }, { 00755, AID_ROOT, AID_SHELL, 0, "system/bin/crash_dump32" }, { 00755, AID_ROOT, AID_SHELL, 0, "system/bin/crash_dump64" },