Merge "[NETD-BPF#34] Add a tag for bpf to specify the install folder" am: a9a5d36884
am: 9624d183f4
am: 7b49b608f6
am: 1a1604f9c6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1888356 Change-Id: Ic82782a7a0f56a34881961cdee2b4c82bff893e5
This commit is contained in:
@@ -1612,8 +1612,8 @@ func apexFileForRuntimeResourceOverlay(ctx android.BaseModuleContext, rro java.R
|
||||
return af
|
||||
}
|
||||
|
||||
func apexFileForBpfProgram(ctx android.BaseModuleContext, builtFile android.Path, bpfProgram bpf.BpfModule) apexFile {
|
||||
dirInApex := filepath.Join("etc", "bpf")
|
||||
func apexFileForBpfProgram(ctx android.BaseModuleContext, builtFile android.Path, apex_sub_dir string, bpfProgram bpf.BpfModule) apexFile {
|
||||
dirInApex := filepath.Join("etc", "bpf", apex_sub_dir)
|
||||
return newApexFile(ctx, builtFile, builtFile.Base(), dirInApex, etc, bpfProgram)
|
||||
}
|
||||
|
||||
@@ -1831,8 +1831,9 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
case bpfTag:
|
||||
if bpfProgram, ok := child.(bpf.BpfModule); ok {
|
||||
filesToCopy, _ := bpfProgram.OutputFiles("")
|
||||
apex_sub_dir := bpfProgram.SubDir()
|
||||
for _, bpfFile := range filesToCopy {
|
||||
filesInfo = append(filesInfo, apexFileForBpfProgram(ctx, bpfFile, bpfProgram))
|
||||
filesInfo = append(filesInfo, apexFileForBpfProgram(ctx, bpfFile, apex_sub_dir, bpfProgram))
|
||||
}
|
||||
} else {
|
||||
ctx.PropertyErrorf("bpfs", "%q is not a bpf module", depName)
|
||||
|
@@ -623,7 +623,7 @@ func TestDefaults(t *testing.T) {
|
||||
java_libs: ["myjar"],
|
||||
apps: ["AppFoo"],
|
||||
rros: ["rro"],
|
||||
bpfs: ["bpf"],
|
||||
bpfs: ["bpf", "netd_test"],
|
||||
updatable: false,
|
||||
}
|
||||
|
||||
@@ -676,6 +676,12 @@ func TestDefaults(t *testing.T) {
|
||||
srcs: ["bpf.c", "bpf2.c"],
|
||||
}
|
||||
|
||||
bpf {
|
||||
name: "netd_test",
|
||||
srcs: ["netd_test.c"],
|
||||
sub_dir: "netd",
|
||||
}
|
||||
|
||||
`)
|
||||
ensureExactContents(t, ctx, "myapex", "android_common_myapex_image", []string{
|
||||
"etc/myetc",
|
||||
@@ -685,6 +691,7 @@ func TestDefaults(t *testing.T) {
|
||||
"overlay/blue/rro.apk",
|
||||
"etc/bpf/bpf.o",
|
||||
"etc/bpf/bpf2.o",
|
||||
"etc/bpf/netd/netd_test.o",
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user