Lines Matching refs:f
165 func (f *filesystem) DepsMutator(ctx android.BottomUpMutatorContext) {
166 f.AddDeps(ctx, dependencyTag)
178 func (f *filesystem) fsType(ctx android.ModuleContext) fsType {
179 typeStr := proptools.StringDefault(f.properties.Type, "ext4")
193 func (f *filesystem) installFileName() string {
194 return f.BaseModuleName() + ".img"
197 func (f *filesystem) partitionName() string {
198 return proptools.StringDefault(f.properties.Partition_name, f.Name())
201 func (f *filesystem) filterInstallablePackagingSpec(ps android.PackagingSpec) bool {
209 func (f *filesystem) GenerateAndroidBuildActions(ctx android.ModuleContext) {
210 validatePartitionType(ctx, f)
211 switch f.fsType(ctx) {
213 f.output = f.buildImageUsingBuildImage(ctx)
215 f.output = f.buildCpioImage(ctx, true)
217 f.output = f.buildCpioImage(ctx, false)
222 f.installDir = android.PathForModuleInstall(ctx, "etc")
223 ctx.InstallFile(f.installDir, f.installFileName(), f.output)
225 ctx.SetOutputFiles([]android.Path{f.output}, "")
246 func (f *filesystem) buildNonDepsFiles(ctx android.ModuleContext, builder *android.RuleBuilder, roo…
248 for _, dir := range f.properties.Dirs.GetOrDefault(ctx, nil) {
253 for _, symlink := range f.properties.Symlinks {
275 if f.buildExtraFiles != nil {
277 extraFiles := f.buildExtraFiles(ctx, rootForExtraFiles)
278 for _, f := range extraFiles {
279 rel, err := filepath.Rel(rootForExtraFiles.String(), f.String())
281 ctx.ModuleErrorf("can't make %q relative to %q", f, rootForExtraFiles)
293 func (f *filesystem) buildImageUsingBuildImage(ctx android.ModuleContext) android.OutputPath {
296 if f.properties.Base_dir != nil {
297 rebasedDir = rootDir.Join(ctx, *f.properties.Base_dir)
302 specs := f.gatherFilteredPackagingSpecs(ctx)
303 f.entries = f.CopySpecsToDir(ctx, builder, specs, rebasedDir)
305 f.buildNonDepsFiles(ctx, builder, rootDir)
306 f.addMakeBuiltFiles(ctx, builder, rootDir)
307 f.buildFsverityMetadataFiles(ctx, builder, specs, rootDir, rebasedDir)
308 f.buildEventLogtagsFile(ctx, builder, rebasedDir)
309 f.buildAconfigFlagsFiles(ctx, builder, specs, rebasedDir)
319 propFile, toolDeps := f.buildPropFile(ctx)
320 output := android.PathForModuleOut(ctx, f.installFileName()).OutputPath
329 builder.Build("build_filesystem_image", fmt.Sprintf("Creating filesystem %s", f.BaseModuleName()))
334 func (f *filesystem) buildFileContexts(ctx android.ModuleContext) android.OutputPath {
339 Input(android.PathForModuleSrc(ctx, proptools.String(f.properties.File_contexts)))
340 …system_file_contexts", fmt.Sprintf("Creating filesystem file contexts for %s", f.BaseModuleName()))
345 func (f *filesystem) salt() string {
346 return sha1sum(f.entries)
349 func (f *filesystem) buildPropFile(ctx android.ModuleContext) (propFile android.OutputPath, toolDep…
373 addStr("fs_type", fsTypeStr(f.fsType(ctx)))
374 addStr("mount_point", proptools.StringDefault(f.properties.Mount_point, "/"))
382 if proptools.Bool(f.properties.Use_avb) {
385 algorithm := proptools.StringDefault(f.properties.Avb_algorithm, "SHA256_RSA4096")
387 key := android.PathForModuleSrc(ctx, proptools.String(f.properties.Avb_private_key))
389 addStr("partition_name", f.partitionName())
391 if hashAlgorithm := proptools.String(f.properties.Avb_hash_algorithm); hashAlgorithm != "" {
394 if f.properties.Rollback_index != nil {
395 rollbackIndex := proptools.Int(f.properties.Rollback_index)
401 securityPatchKey := "com.android.build." + f.partitionName() + ".security_patch"
405 addStr("avb_salt", f.salt())
408 if proptools.String(f.properties.File_contexts) != "" {
409 addPath("selinux_fc", f.buildFileContexts(ctx))
411 if timestamp := proptools.String(f.properties.Fake_timestamp); timestamp != "" {
414 if uuid := proptools.String(f.properties.Uuid); uuid != "" {
423 func (f *filesystem) buildCpioImage(ctx android.ModuleContext, compressed bool) android.OutputPath {
424 if proptools.Bool(f.properties.Use_avb) {
429 if proptools.String(f.properties.File_contexts) != "" {
433 if f.properties.Include_make_built_files != "" {
439 if f.properties.Base_dir != nil {
440 rebasedDir = rootDir.Join(ctx, *f.properties.Base_dir)
445 specs := f.gatherFilteredPackagingSpecs(ctx)
446 f.entries = f.CopySpecsToDir(ctx, builder, specs, rebasedDir)
448 f.buildNonDepsFiles(ctx, builder, rootDir)
449 f.buildFsverityMetadataFiles(ctx, builder, specs, rootDir, rebasedDir)
450 f.buildEventLogtagsFile(ctx, builder, rebasedDir)
451 f.buildAconfigFlagsFiles(ctx, builder, specs, rebasedDir)
453 output := android.PathForModuleOut(ctx, f.installFileName()).OutputPath
469 builder.Build("build_cpio_image", fmt.Sprintf("Creating filesystem %s", f.BaseModuleName()))
488 func (f *filesystem) addMakeBuiltFiles(ctx android.ModuleContext, builder *android.RuleBuilder, roo…
489 partition := f.properties.Include_make_built_files
509 func (f *filesystem) buildEventLogtagsFile(ctx android.ModuleContext, builder *android.RuleBuilder,…
510 if !proptools.Bool(f.properties.Build_logtags) {
544 func (f *filesystem) PartitionType() string {
545 return proptools.StringDefault(f.properties.Partition_type, "system")
553 func (f *filesystem) AndroidMkEntries() []android.AndroidMkEntries {
556 OutputFile: android.OptionalPathForPath(f.output),
559 entries.SetString("LOCAL_MODULE_PATH", f.installDir.String())
560 entries.SetString("LOCAL_INSTALLED_MODULE_STEM", f.installFileName())
579 func (f *filesystem) OutputPath() android.Path {
580 return f.output
583 func (f *filesystem) SignedOutputPath() android.Path {
584 if proptools.Bool(f.properties.Use_avb) {
585 return f.OutputPath()
593 func (f *filesystem) gatherFilteredPackagingSpecs(ctx android.ModuleContext) map[string]android.Pac…
594 specs := f.PackagingBase.GatherPackagingSpecsWithFilter(ctx, f.filterPackagingSpec)
638 func (f *filesystemDefaults) PartitionType() string {
639 return proptools.StringDefault(f.properties.Partition_type, "system")
644 func (f *filesystemDefaults) GenerateAndroidBuildActions(ctx android.ModuleContext) {
645 validatePartitionType(ctx, f)