From 640816eb42046b5c2c1fc6a277cf3ce3f5cf0ddb Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Tue, 11 Dec 2018 09:38:17 -0800 Subject: [PATCH] fs_config: remove empty fs_config_* automation. The code to manage citing empty /etc/fs_config_{files|dirs} content by specifically setting the file(s) to access mode 00000 is bitrotted and ill-suited for multiple partitions and was written for a more paranoid time when DAC and MAC rules were not nearly as mature. Striking out the complications as it affected deterministic results. Test: compile and boot Bug: 119310326 Change-Id: Iec02e0c1194eaa799ab95adff4ff0951a24652a4 --- tools/fs_config/fs_config_generate.c | 17 +---------------- tools/fs_config/fs_config_generator.py | 22 ---------------------- 2 files changed, 1 insertion(+), 38 deletions(-) diff --git a/tools/fs_config/fs_config_generate.c b/tools/fs_config/fs_config_generate.c index 0f0603b23..dddd33174 100644 --- a/tools/fs_config/fs_config_generate.c +++ b/tools/fs_config/fs_config_generate.c @@ -41,22 +41,7 @@ static const struct fs_path_config android_device_dirs[] = { }; #endif #ifdef NO_ANDROID_FILESYSTEM_CONFIG_DEVICE_FILES -static const struct fs_path_config android_device_files[] = { -#ifdef NO_ANDROID_FILESYSTEM_CONFIG_DEVICE_DIRS - {0000, AID_ROOT, AID_ROOT, 0, "system/etc/fs_config_dirs"}, - {0000, AID_ROOT, AID_ROOT, 0, "vendor/etc/fs_config_dirs"}, - {0000, AID_ROOT, AID_ROOT, 0, "oem/etc/fs_config_dirs"}, - {0000, AID_ROOT, AID_ROOT, 0, "odm/etc/fs_config_dirs"}, - {0000, AID_ROOT, AID_ROOT, 0, "product/etc/fs_config_dirs"}, - {0000, AID_ROOT, AID_ROOT, 0, "product_services/etc/fs_config_dirs"}, -#endif - {0000, AID_ROOT, AID_ROOT, 0, "system/etc/fs_config_files"}, - {0000, AID_ROOT, AID_ROOT, 0, "vendor/etc/fs_config_files"}, - {0000, AID_ROOT, AID_ROOT, 0, "oem/etc/fs_config_files"}, - {0000, AID_ROOT, AID_ROOT, 0, "odm/etc/fs_config_files"}, - {0000, AID_ROOT, AID_ROOT, 0, "product/etc/fs_config_files"}, - {0000, AID_ROOT, AID_ROOT, 0, "product_services/etc/fs_config_files"}, -}; +static const struct fs_path_config android_device_files[] = { }; #endif static void usage() { diff --git a/tools/fs_config/fs_config_generator.py b/tools/fs_config/fs_config_generator.py index f7e3eb2c1..db484a09b 100755 --- a/tools/fs_config/fs_config_generator.py +++ b/tools/fs_config/fs_config_generator.py @@ -909,22 +909,6 @@ class FSConfigGen(BaseGenerator): '#warning No device-supplied android_filesystem_config.h,' ' using empty default.') - # Long names. - # pylint: disable=invalid-name - _NO_ANDROID_FILESYSTEM_CONFIG_DEVICE_DIRS_ENTRY = ( - '{ 00000, AID_ROOT, AID_ROOT, 0,' - '"system/etc/fs_config_dirs" },') - - _NO_ANDROID_FILESYSTEM_CONFIG_DEVICE_FILES_ENTRY = ( - '{ 00000, AID_ROOT, AID_ROOT, 0,' - '"system/etc/fs_config_files" },') - - _IFDEF_ANDROID_FILESYSTEM_CONFIG_DEVICE_DIRS = ( - '#ifdef NO_ANDROID_FILESYSTEM_CONFIG_DEVICE_DIRS') - # pylint: enable=invalid-name - - _ENDIF = '#endif' - _OPEN_FILE_STRUCT = ( 'static const struct fs_path_config android_device_files[] = {') @@ -1082,12 +1066,6 @@ class FSConfigGen(BaseGenerator): for fs_config in files: self._to_fs_entry(fs_config) - if not are_dirs: - print FSConfigGen._IFDEF_ANDROID_FILESYSTEM_CONFIG_DEVICE_DIRS - print( - ' ' + - FSConfigGen._NO_ANDROID_FILESYSTEM_CONFIG_DEVICE_DIRS_ENTRY) - print FSConfigGen._ENDIF print FSConfigGen._CLOSE_FILE_STRUCT if are_dirs: