diff options
Diffstat (limited to 'filesystem')
-rw-r--r-- | filesystem/avb_add_hash_footer.go | 7 | ||||
-rw-r--r-- | filesystem/filesystem.go | 4 | ||||
-rw-r--r-- | filesystem/filesystem_test.go | 23 | ||||
-rw-r--r-- | filesystem/system_other.go | 7 |
4 files changed, 35 insertions, 6 deletions
diff --git a/filesystem/avb_add_hash_footer.go b/filesystem/avb_add_hash_footer.go index 327a41fda..c7760120d 100644 --- a/filesystem/avb_add_hash_footer.go +++ b/filesystem/avb_add_hash_footer.go @@ -70,7 +70,7 @@ type avbAddHashFooterProperties struct { Props []avbProp // The index used to prevent rollback of the image on device. - Rollback_index *int64 + Rollback_index proptools.Configurable[int64] `android:"replace_instead_of_append"` // Include descriptors from images Include_descriptors_from_images []string `android:"path,arch_variant"` @@ -134,8 +134,9 @@ func (a *avbAddHashFooter) GenerateAndroidBuildActions(ctx android.ModuleContext addAvbProp(ctx, cmd, prop) } - if a.properties.Rollback_index != nil { - rollbackIndex := proptools.Int(a.properties.Rollback_index) + rollbackIndex := a.properties.Rollback_index.Get(ctx) + if rollbackIndex.IsPresent() { + rollbackIndex := rollbackIndex.Get() if rollbackIndex < 0 { ctx.PropertyErrorf("rollback_index", "Rollback index must be non-negative") } diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go index 411770be9..e86ebf4fa 100644 --- a/filesystem/filesystem.go +++ b/filesystem/filesystem.go @@ -1569,7 +1569,7 @@ func (f *filesystem) getLibsForLinkerConfig(ctx android.ModuleContext) ([]androi deps := f.gatherFilteredPackagingSpecs(ctx) ctx.WalkDepsProxy(func(child, parent android.ModuleProxy) bool { - if !android.OtherModuleProviderOrDefault(ctx, child, android.CommonModuleInfoProvider).Enabled { + if !android.OtherModulePointerProviderOrDefault(ctx, child, android.CommonModuleInfoProvider).Enabled { return false } for _, ps := range android.OtherModuleProviderOrDefault( @@ -1590,7 +1590,7 @@ func (f *filesystem) getLibsForLinkerConfig(ctx android.ModuleContext) ([]androi var requireModules []android.ModuleProxy ctx.WalkDepsProxy(func(child, parent android.ModuleProxy) bool { - if !android.OtherModuleProviderOrDefault(ctx, child, android.CommonModuleInfoProvider).Enabled { + if !android.OtherModulePointerProviderOrDefault(ctx, child, android.CommonModuleInfoProvider).Enabled { return false } _, parentInPackage := modulesInPackageByModule[parent] diff --git a/filesystem/filesystem_test.go b/filesystem/filesystem_test.go index 6d0b49016..bf7f5b64b 100644 --- a/filesystem/filesystem_test.go +++ b/filesystem/filesystem_test.go @@ -723,26 +723,47 @@ cc_library { // override_android_* modules implicitly override their base module. // If both of these are listed in `deps`, the base module should not be installed. +// Also, required deps should be updated too. func TestOverrideModulesInDeps(t *testing.T) { result := fixture.RunTestWithBp(t, ` + cc_library_shared { + name: "libfoo", + stl: "none", + system_shared_libs: [], + } + cc_library_shared { + name: "libbar", + stl: "none", + system_shared_libs: [], + } android_filesystem { name: "myfilesystem", + deps: ["myapp"], + } + android_filesystem { + name: "myfilesystem_overridden", deps: ["myapp", "myoverrideapp"], } android_app { name: "myapp", platform_apis: true, + required: ["libfoo"], } override_android_app { name: "myoverrideapp", base: "myapp", + required: ["libbar"], } `) partition := result.ModuleForTests(t, "myfilesystem", "android_common") fileList := android.ContentFromFileRuleForTests(t, result.TestContext, partition.Output("fileList")) - android.AssertStringEquals(t, "filesystem with override app", "app/myoverrideapp/myoverrideapp.apk\n", fileList) + android.AssertStringEquals(t, "filesystem without override app", "app/myapp/myapp.apk\nlib64/libfoo.so\n", fileList) + + overriddenPartition := result.ModuleForTests(t, "myfilesystem_overridden", "android_common") + overriddenFileList := android.ContentFromFileRuleForTests(t, result.TestContext, overriddenPartition.Output("fileList")) + android.AssertStringEquals(t, "filesystem with override app", "app/myoverrideapp/myoverrideapp.apk\nlib64/libbar.so\n", overriddenFileList) } func TestRamdiskPartitionSetsDevNodes(t *testing.T) { diff --git a/filesystem/system_other.go b/filesystem/system_other.go index 348c01035..32a6cc784 100644 --- a/filesystem/system_other.go +++ b/filesystem/system_other.go @@ -120,8 +120,11 @@ func (m *systemOtherImage) GenerateAndroidBuildActions(ctx android.ModuleContext // TOOD: CopySpecsToDir only exists on PackagingBase, but doesn't use any fields from it. Clean this up. (&android.PackagingBase{}).CopySpecsToDir(ctx, builder, specs, stagingDir) + fullInstallPaths := []string{} if len(m.properties.Preinstall_dexpreopt_files_from) > 0 { builder.Command().Textf("touch %s", filepath.Join(stagingDir.String(), "system-other-odex-marker")) + installPath := android.PathForModuleInPartitionInstall(ctx, "system_other", "system-other-odex-marker") + fullInstallPaths = append(fullInstallPaths, installPath.String()) } builder.Command().Textf("touch").Output(stagingDirTimestamp) builder.Build("assemble_filesystem_staging_dir", "Assemble filesystem staging dir") @@ -186,6 +189,10 @@ func (m *systemOtherImage) GenerateAndroidBuildActions(ctx android.ModuleContext ctx.SetOutputFiles(android.Paths{output}, "") ctx.CheckbuildFile(output) + + // Dump compliance metadata + complianceMetadataInfo := ctx.ComplianceMetadataInfo() + complianceMetadataInfo.SetFilesContained(fullInstallPaths) } func (s *systemOtherImage) generateFilesystemConfig(ctx android.ModuleContext, stagingDir, stagingDirTimestamp android.Path) android.Path { |