diff options
author | 2024-10-03 14:38:37 -0700 | |
---|---|---|
committer | 2024-10-03 19:43:12 -0700 | |
commit | 2cf1bf5624c8048b960b9e0ec27a7677739049ae (patch) | |
tree | ed3aba3d01aa5c9a84f3ea7cecff03a4cea79f84 /filesystem/filesystem.go | |
parent | 323253721116cf9bd9f558ae7449494e3cebfcf6 (diff) |
Create soong-generated filesystem diff test
Running `m soong_generated_filesystem_tests` will diff the
soong-generated system image with the make-generated one.
Currently, this test fails, but we can start working on narrowing it
down now.
Bug: 371351099
Test: m soong_generated_filesystem_tests
Change-Id: I364677f09286652e4577bf9e0d16481998dfd258
Diffstat (limited to 'filesystem/filesystem.go')
-rw-r--r-- | filesystem/filesystem.go | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go index a26fac7fc..14501bb66 100644 --- a/filesystem/filesystem.go +++ b/filesystem/filesystem.go @@ -35,7 +35,7 @@ func init() { } func registerBuildComponents(ctx android.RegistrationContext) { - ctx.RegisterModuleType("android_filesystem", filesystemFactory) + ctx.RegisterModuleType("android_filesystem", FilesystemFactory) ctx.RegisterModuleType("android_filesystem_defaults", filesystemDefaultsFactory) ctx.RegisterModuleType("android_system_image", SystemImageFactory) ctx.RegisterModuleType("avb_add_hash_footer", avbAddHashFooterFactory) @@ -144,7 +144,7 @@ type FilesystemProperties struct { // modules in the filesystem image are built for the target device (i.e. Android, not Linux host). // The modules are placed in the filesystem image just like they are installed to the ordinary // partitions like system.img. For example, cc_library modules are placed under ./lib[64] directory. -func filesystemFactory() android.Module { +func FilesystemFactory() android.Module { module := &filesystem{} module.filterPackagingSpec = module.filterInstallablePackagingSpec initFilesystemModule(module, module) @@ -177,6 +177,13 @@ const ( unknown ) +type FilesystemInfo struct { + // A text file containing the list of paths installed on the partition. + FileListFile android.Path +} + +var FilesystemProvider = blueprint.NewProvider[FilesystemInfo]() + func (f *filesystem) fsType(ctx android.ModuleContext) fsType { typeStr := proptools.StringDefault(f.properties.Type, "ext4") switch typeStr { @@ -227,6 +234,10 @@ func (f *filesystem) GenerateAndroidBuildActions(ctx android.ModuleContext) { f.fileListFile = android.PathForModuleOut(ctx, "fileList").OutputPath android.WriteFileRule(ctx, f.fileListFile, f.installedFilesList()) + + android.SetProvider(ctx, FilesystemProvider, FilesystemInfo{ + FileListFile: f.fileListFile, + }) } func (f *filesystem) appendToEntry(ctx android.ModuleContext, installedFile android.OutputPath) { |