Merge "Make bpfs properties overridable"
This commit is contained in:
@@ -117,9 +117,6 @@ type apexBundleProperties struct {
|
||||
// List of platform_compat_config files that are embedded inside this APEX bundle.
|
||||
Compat_configs []string
|
||||
|
||||
// List of BPF programs inside this APEX bundle.
|
||||
Bpfs []string
|
||||
|
||||
// List of filesystem images that are embedded inside this APEX bundle.
|
||||
Filesystems []string
|
||||
|
||||
@@ -297,6 +294,9 @@ type overridableProperties struct {
|
||||
// List of runtime resource overlays (RROs) that are embedded inside this APEX.
|
||||
Rros []string
|
||||
|
||||
// List of BPF programs inside this APEX bundle.
|
||||
Bpfs []string
|
||||
|
||||
// Names of modules to be overridden. Listed modules can only be other binaries (in Make or
|
||||
// Soong). This does not completely prevent installation of the overridden binaries, but if
|
||||
// both binaries would be installed by default (in PRODUCT_PACKAGES) the other binary will
|
||||
@@ -780,7 +780,6 @@ func (a *apexBundle) DepsMutator(ctx android.BottomUpMutatorContext) {
|
||||
ctx.AddFarVariationDependencies(commonVariation, bcpfTag, a.properties.Bootclasspath_fragments...)
|
||||
ctx.AddFarVariationDependencies(commonVariation, sscpfTag, a.properties.Systemserverclasspath_fragments...)
|
||||
ctx.AddFarVariationDependencies(commonVariation, javaLibTag, a.properties.Java_libs...)
|
||||
ctx.AddFarVariationDependencies(commonVariation, bpfTag, a.properties.Bpfs...)
|
||||
ctx.AddFarVariationDependencies(commonVariation, fsTag, a.properties.Filesystems...)
|
||||
ctx.AddFarVariationDependencies(commonVariation, compatConfigTag, a.properties.Compat_configs...)
|
||||
|
||||
@@ -813,6 +812,7 @@ func (a *apexBundle) OverridablePropertiesDepsMutator(ctx android.BottomUpMutato
|
||||
|
||||
commonVariation := ctx.Config().AndroidCommonTarget.Variations()
|
||||
ctx.AddFarVariationDependencies(commonVariation, androidAppTag, a.overridableProperties.Apps...)
|
||||
ctx.AddFarVariationDependencies(commonVariation, bpfTag, a.overridableProperties.Bpfs...)
|
||||
ctx.AddFarVariationDependencies(commonVariation, rroTag, a.overridableProperties.Rros...)
|
||||
|
||||
// Dependencies for signing
|
||||
|
@@ -6073,6 +6073,7 @@ func TestOverrideApex(t *testing.T) {
|
||||
name: "myapex",
|
||||
key: "myapex.key",
|
||||
apps: ["app"],
|
||||
bpfs: ["bpf"],
|
||||
overrides: ["oldapex"],
|
||||
updatable: false,
|
||||
}
|
||||
@@ -6081,6 +6082,7 @@ func TestOverrideApex(t *testing.T) {
|
||||
name: "override_myapex",
|
||||
base: "myapex",
|
||||
apps: ["override_app"],
|
||||
bpfs: ["override_bpf"],
|
||||
overrides: ["unknownapex"],
|
||||
logging_parent: "com.foo.bar",
|
||||
package_name: "test.overridden.package",
|
||||
@@ -6119,6 +6121,16 @@ func TestOverrideApex(t *testing.T) {
|
||||
base: "app",
|
||||
package_name: "bar",
|
||||
}
|
||||
|
||||
bpf {
|
||||
name: "bpf",
|
||||
srcs: ["bpf.c"],
|
||||
}
|
||||
|
||||
bpf {
|
||||
name: "override_bpf",
|
||||
srcs: ["override_bpf.c"],
|
||||
}
|
||||
`, withManifestPackageNameOverrides([]string{"myapex:com.android.myapex"}))
|
||||
|
||||
originalVariant := ctx.ModuleForTests("myapex", "android_common_myapex_image").Module().(android.OverridableModule)
|
||||
@@ -6137,6 +6149,9 @@ func TestOverrideApex(t *testing.T) {
|
||||
ensureNotContains(t, copyCmds, "image.apex/app/app/app.apk")
|
||||
ensureContains(t, copyCmds, "image.apex/app/override_app/override_app.apk")
|
||||
|
||||
ensureNotContains(t, copyCmds, "image.apex/etc/bpf/bpf.o")
|
||||
ensureContains(t, copyCmds, "image.apex/etc/bpf/override_bpf.o")
|
||||
|
||||
apexBundle := module.Module().(*apexBundle)
|
||||
name := apexBundle.Name()
|
||||
if name != "override_myapex" {
|
||||
@@ -6159,10 +6174,12 @@ func TestOverrideApex(t *testing.T) {
|
||||
data.Custom(&builder, name, "TARGET_", "", data)
|
||||
androidMk := builder.String()
|
||||
ensureContains(t, androidMk, "LOCAL_MODULE := override_app.override_myapex")
|
||||
ensureContains(t, androidMk, "LOCAL_MODULE := override_bpf.o.override_myapex")
|
||||
ensureContains(t, androidMk, "LOCAL_MODULE := apex_manifest.pb.override_myapex")
|
||||
ensureContains(t, androidMk, "LOCAL_MODULE_STEM := override_myapex.apex")
|
||||
ensureContains(t, androidMk, "LOCAL_OVERRIDES_MODULES := unknownapex myapex")
|
||||
ensureNotContains(t, androidMk, "LOCAL_MODULE := app.myapex")
|
||||
ensureNotContains(t, androidMk, "LOCAL_MODULE := bpf.myapex")
|
||||
ensureNotContains(t, androidMk, "LOCAL_MODULE := override_app.myapex")
|
||||
ensureNotContains(t, androidMk, "LOCAL_MODULE := apex_manifest.pb.myapex")
|
||||
ensureNotContains(t, androidMk, "LOCAL_MODULE_STEM := myapex.apex")
|
||||
|
Reference in New Issue
Block a user