diff options
author | 2021-08-27 04:57:10 +0000 | |
---|---|---|
committer | 2021-08-27 04:57:10 +0000 | |
commit | 60dc5c0db29aed77aee195d0e5db608361a98d75 (patch) | |
tree | 0ce6b649399416ce383054d4f7f08c29cd3c7d3a | |
parent | 5edc77d06c7ad17f8bcc0421f3d1d4cd09961029 (diff) | |
parent | 7c803b87466cc93efcf1827f1459bb2bf57c0731 (diff) |
Merge "Make bpfs properties overridable"
-rw-r--r-- | apex/apex.go | 8 | ||||
-rw-r--r-- | apex/apex_test.go | 17 |
2 files changed, 21 insertions, 4 deletions
diff --git a/apex/apex.go b/apex/apex.go index e1fca67ad..6bafcae52 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -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 diff --git a/apex/apex_test.go b/apex/apex_test.go index 600f6c217..b9285ae4c 100644 --- a/apex/apex_test.go +++ b/apex/apex_test.go @@ -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") |