Include bpf program in APEXes
bpf program is put to an APEX via 'bpfs' property. It is
placed under etc/bpf directory in it.
Fix: 167530625
Test: m
Change-Id: Ia36b486f0cffb619ecc4f7a318cde881abc5baf4
diff --git a/bpf/bpf.go b/bpf/bpf.go
index 4cdfb31..297e13a 100644
--- a/bpf/bpf.go
+++ b/bpf/bpf.go
@@ -26,7 +26,7 @@
)
func init() {
- android.RegisterModuleType("bpf", bpfFactory)
+ android.RegisterModuleType("bpf", BpfFactory)
pctx.Import("android/soong/cc/config")
}
@@ -43,6 +43,13 @@
"ccCmd", "cFlags")
)
+// BpfModule interface is used by the apex package to gather information from a bpf module.
+type BpfModule interface {
+ android.Module
+
+ OutputFiles(tag string) (android.Paths, error)
+}
+
type BpfProperties struct {
Srcs []string `android:"path"`
Cflags []string
@@ -141,7 +148,7 @@
var _ android.OutputFileProducer = (*bpf)(nil)
-func bpfFactory() android.Module {
+func BpfFactory() android.Module {
module := &bpf{}
module.AddProperties(&module.properties)
diff --git a/bpf/bpf_test.go b/bpf/bpf_test.go
index eeca057..d06d7d1 100644
--- a/bpf/bpf_test.go
+++ b/bpf/bpf_test.go
@@ -59,7 +59,7 @@
func testContext(config android.Config) *android.TestContext {
ctx := cc.CreateTestContext()
- ctx.RegisterModuleType("bpf", bpfFactory)
+ ctx.RegisterModuleType("bpf", BpfFactory)
ctx.Register(config)
return ctx