Merge "Remove Base_dir from non system non recovery filesystem" into main

This commit is contained in:
Spandan Das 2024-12-06 18:18:10 +00:00 committed by Gerrit Code Review
commit b72c6a74f2
3 changed files with 7 additions and 9 deletions

View file

@ -457,7 +457,7 @@ func (f *filesystem) validateVintfFragments(ctx android.ModuleContext) {
}
func (f *filesystem) appendToEntry(ctx android.ModuleContext, installedFile android.Path) {
partitionBaseDir := android.PathForModuleOut(ctx, "root", f.partitionName()).String() + "/"
partitionBaseDir := android.PathForModuleOut(ctx, "root", proptools.String(f.properties.Base_dir)).String() + "/"
relPath, inTargetPartition := strings.CutPrefix(installedFile.String(), partitionBaseDir)
if inTargetPartition {

View file

@ -244,7 +244,7 @@ func TestFileSystemGathersItemsOnlyInSystemPartition(t *testing.T) {
`)
module := result.ModuleForTests("myfilesystem", "android_common").Module().(*systemImage)
android.AssertDeepEquals(t, "entries should have foo only", []string{"components/foo"}, module.entries)
android.AssertDeepEquals(t, "entries should have foo and not bar", []string{"components/foo", "etc/linker.config.pb"}, module.entries)
}
func TestAvbGenVbmetaImage(t *testing.T) {

View file

@ -343,6 +343,7 @@ func partitionSpecificFsProps(ctx android.EarlyModuleContext, fsProps *filesyste
Name: proptools.StringPtr("vendor_dlkm/etc"),
},
}
fsProps.Base_dir = proptools.StringPtr("system")
fsProps.Dirs = proptools.NewSimpleConfigurable([]string{
// From generic_rootdirs in build/make/target/product/generic/Android.bp
"acct",
@ -394,11 +395,11 @@ func partitionSpecificFsProps(ctx android.EarlyModuleContext, fsProps *filesyste
fsProps.Symlinks = []filesystem.SymlinkDefinition{
filesystem.SymlinkDefinition{
Target: proptools.StringPtr("/odm"),
Name: proptools.StringPtr("vendor/odm"),
Name: proptools.StringPtr("odm"),
},
filesystem.SymlinkDefinition{
Target: proptools.StringPtr("/vendor_dlkm/lib/modules"),
Name: proptools.StringPtr("vendor/lib/modules"),
Name: proptools.StringPtr("lib/modules"),
},
}
fsProps.Android_filesystem_deps.System = proptools.StringPtr(generatedModuleNameForPartition(ctx.Config(), "system"))
@ -409,7 +410,7 @@ func partitionSpecificFsProps(ctx android.EarlyModuleContext, fsProps *filesyste
fsProps.Symlinks = []filesystem.SymlinkDefinition{
filesystem.SymlinkDefinition{
Target: proptools.StringPtr("/odm_dlkm/lib/modules"),
Name: proptools.StringPtr("odm/lib/modules"),
Name: proptools.StringPtr("lib/modules"),
},
}
case "userdata":
@ -452,6 +453,7 @@ func partitionSpecificFsProps(ctx android.EarlyModuleContext, fsProps *filesyste
Name: proptools.StringPtr("default.prop"),
},
}
fsProps.Base_dir = proptools.StringPtr("recovery")
}
}
@ -798,10 +800,6 @@ func generateFsProps(ctx android.EarlyModuleContext, partitionType string) (*fil
fsProps.Precompiled_file_contexts = proptools.StringPtr(":file_contexts_bin_gen")
}
if !strings.Contains(partitionType, "ramdisk") {
fsProps.Base_dir = proptools.StringPtr(partitionType)
}
fsProps.Is_auto_generated = proptools.BoolPtr(true)
partitionSpecificFsProps(ctx, fsProps, partitionVars, partitionType)