From a70cea57a98a03374bb9cafd2b7dbc0800b42e1c Mon Sep 17 00:00:00 2001 From: Jooyung Han Date: Mon, 21 Sep 2020 19:37:05 +0900 Subject: [PATCH] fs_config: add bin paths of flattened apexes Added missing partitions (/product and /vendor). APEXes can be put in /system, /system_ext, /product, and /vendor. Binaries within "flattened" apexes should be marked as executable. Bug: 167383491 Bug: 169025459 Test: OVERRIDE_TARGET_FLATTEN_APEX=true m vendorimage with a vendor apex simg2img $OUT/vendor.img vendor.img debugfs -R 'ls -l /vendor/apex/com.android.foo/bin' vendor.img => check if binaries are executable Change-Id: I67284166d70c98a2a184b47e7052ade8b9039df9 --- libcutils/fs_config.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libcutils/fs_config.cpp b/libcutils/fs_config.cpp index b9fc82eae..31e1679db 100644 --- a/libcutils/fs_config.cpp +++ b/libcutils/fs_config.cpp @@ -80,6 +80,7 @@ static const struct fs_path_config android_dirs[] = { { 00771, AID_SYSTEM, AID_SYSTEM, 0, "data" }, { 00755, AID_ROOT, AID_SYSTEM, 0, "mnt" }, { 00751, AID_ROOT, AID_SHELL, 0, "product/bin" }, + { 00751, AID_ROOT, AID_SHELL, 0, "product/apex/*/bin" }, { 00777, AID_ROOT, AID_ROOT, 0, "sdcard" }, { 00751, AID_ROOT, AID_SDCARD_R, 0, "storage" }, { 00751, AID_ROOT, AID_SHELL, 0, "system/bin" }, @@ -90,6 +91,7 @@ static const struct fs_path_config android_dirs[] = { { 00751, AID_ROOT, AID_SHELL, 0, "system_ext/bin" }, { 00751, AID_ROOT, AID_SHELL, 0, "system_ext/apex/*/bin" }, { 00751, AID_ROOT, AID_SHELL, 0, "vendor/bin" }, + { 00751, AID_ROOT, AID_SHELL, 0, "vendor/apex/*/bin" }, { 00755, AID_ROOT, AID_SHELL, 0, "vendor" }, { 00755, AID_ROOT, AID_ROOT, 0, 0 }, // clang-format on @@ -210,12 +212,14 @@ static const struct fs_path_config android_files[] = { { 00750, AID_ROOT, AID_SHELL, 0, "init*" }, { 00755, AID_ROOT, AID_SHELL, 0, "odm/bin/*" }, { 00755, AID_ROOT, AID_SHELL, 0, "product/bin/*" }, + { 00755, AID_ROOT, AID_SHELL, 0, "product/apex/*bin/*" }, { 00755, AID_ROOT, AID_SHELL, 0, "system/bin/*" }, { 00755, AID_ROOT, AID_SHELL, 0, "system/xbin/*" }, { 00755, AID_ROOT, AID_SHELL, 0, "system/apex/*/bin/*" }, { 00755, AID_ROOT, AID_SHELL, 0, "system_ext/bin/*" }, { 00755, AID_ROOT, AID_SHELL, 0, "system_ext/apex/*/bin/*" }, { 00755, AID_ROOT, AID_SHELL, 0, "vendor/bin/*" }, + { 00755, AID_ROOT, AID_SHELL, 0, "vendor/apex/*bin/*" }, { 00755, AID_ROOT, AID_SHELL, 0, "vendor/xbin/*" }, { 00644, AID_ROOT, AID_ROOT, 0, 0 }, // clang-format on