Refactor selinux_policy_nonsystem to separate phonies for vendor/odm
As part of the mk->bp migration, we are currently using heuristics to
classify the packages in `PRODUCT_PACKAGES` to deps of the different
android_filesystem modules. To aid such heuristics, separate phony
targets will be created for selinux_policy_vendor and
selinux_policy_odm. The former wil be added to deps of the autogenerated
vendor module and the latter will be added to deps of the autogenerated
odm module
Test: verified that the soong build vendor.img and odm.img have the same
files as the kati vendor.img and odm.img for aosp_cf_x86_64_phone
Bug: 376755916
Change-Id: Icba06fd978e44d7c8d293ba3d85853df04f907dd
diff --git a/Android.bp b/Android.bp
index f68e7fa..db1ea27 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1046,6 +1046,18 @@
phony {
name: "selinux_policy_nonsystem",
required: [
+ "selinux_policy_system_ext",
+ "selinux_policy_product",
+ "selinux_policy_vendor",
+ "selinux_policy_odm",
+ // Builds an additional userdebug sepolicy into the debug ramdisk.
+ "userdebug_plat_sepolicy.cil",
+ ],
+}
+
+phony {
+ name: "selinux_policy_vendor",
+ required: [
"plat_pub_versioned.cil",
"vendor_sepolicy.cil",
"plat_sepolicy_vers.txt",
@@ -1063,6 +1075,13 @@
"vendor_bug_map",
"vndservice_contexts",
"vndservice_contexts_test",
+ ],
+ vendor: true,
+}
+
+phony {
+ name: "selinux_policy_odm",
+ required: [
"odm_sepolicy.cil",
"odm_file_contexts",
"odm_file_contexts_test",
@@ -1074,10 +1093,6 @@
"odm_hwservice_contexts",
"odm_hwservice_contexts_test",
"odm_mac_permissions.xml",
- "selinux_policy_system_ext",
- "selinux_policy_product",
- // Builds an additional userdebug sepolicy into the debug ramdisk.
- "userdebug_plat_sepolicy.cil",
] + select(soong_config_variable("ANDROID", "PRODUCT_PRECOMPILED_SEPOLICY"), {
true: [
"precompiled_sepolicy",
@@ -1087,7 +1102,7 @@
],
default: [],
}),
- vendor: true,
+ device_specific: true,
}
phony {