Make fsverity props configurable
Bug: 381019944
Test: build
Change-Id: I7389131a944ce477d5d49d01acbcacae2e6fecfe
diff --git a/filesystem/fsverity_metadata.go b/filesystem/fsverity_metadata.go
index ef46067..b9a4026 100644
--- a/filesystem/fsverity_metadata.go
+++ b/filesystem/fsverity_metadata.go
@@ -20,6 +20,8 @@
"strings"
"android/soong/android"
+
+ "github.com/google/blueprint/proptools"
)
type fsverityProperties struct {
@@ -27,10 +29,10 @@
// will be generated and included to the filesystem image.
// etc/security/fsverity/BuildManifest.apk will also be generated which contains information
// about generated .fsv_meta files.
- Inputs []string
+ Inputs proptools.Configurable[[]string]
// APK libraries to link against, for etc/security/fsverity/BuildManifest.apk
- Libs []string `android:"path"`
+ Libs proptools.Configurable[[]string] `android:"path"`
}
func (f *filesystem) writeManifestGeneratorListFile(ctx android.ModuleContext, outputPath android.WritablePath, matchedSpecs []android.PackagingSpec, rebasedDir android.OutputPath) {
@@ -44,7 +46,7 @@
func (f *filesystem) buildFsverityMetadataFiles(ctx android.ModuleContext, builder *android.RuleBuilder, specs map[string]android.PackagingSpec, rootDir android.OutputPath, rebasedDir android.OutputPath) {
match := func(path string) bool {
- for _, pattern := range f.properties.Fsverity.Inputs {
+ for _, pattern := range f.properties.Fsverity.Inputs.GetOrDefault(ctx, nil) {
if matched, err := filepath.Match(pattern, path); matched {
return true
} else if err != nil {
@@ -112,7 +114,7 @@
apkPath := rebasedDir.Join(ctx, "etc", "security", "fsverity", fmt.Sprintf("BuildManifest%s.apk", apkNameSuffix))
idsigPath := rebasedDir.Join(ctx, "etc", "security", "fsverity", fmt.Sprintf("BuildManifest%s.apk.idsig", apkNameSuffix))
manifestTemplatePath := android.PathForSource(ctx, "system/security/fsverity/AndroidManifest.xml")
- libs := android.PathsForModuleSrc(ctx, f.properties.Fsverity.Libs)
+ libs := android.PathsForModuleSrc(ctx, f.properties.Fsverity.Libs.GetOrDefault(ctx, nil))
minSdkVersion := ctx.Config().PlatformSdkCodename()
if minSdkVersion == "REL" {