Merge "Add a new file for the boot image."

This commit is contained in:
Nicolas Geoffray
2022-07-12 07:59:01 +00:00
committed by Gerrit Code Review

View File

@@ -785,24 +785,26 @@ func bootImageProfileRule(ctx android.ModuleContext, image *bootImageConfig) and
} }
defaultProfile := "frameworks/base/config/boot-image-profile.txt" defaultProfile := "frameworks/base/config/boot-image-profile.txt"
extraProfile := "frameworks/base/config/boot-image-profile-extra.txt"
rule := android.NewRuleBuilder(pctx, ctx) rule := android.NewRuleBuilder(pctx, ctx)
var bootImageProfile android.Path var profiles android.Paths
if len(global.BootImageProfiles) > 1 { if len(global.BootImageProfiles) > 0 {
combinedBootImageProfile := image.dir.Join(ctx, "boot-image-profile.txt") profiles = append(profiles, global.BootImageProfiles...)
rule.Command().Text("cat").Inputs(global.BootImageProfiles).Text(">").Output(combinedBootImageProfile)
bootImageProfile = combinedBootImageProfile
} else if len(global.BootImageProfiles) == 1 {
bootImageProfile = global.BootImageProfiles[0]
} else if path := android.ExistentPathForSource(ctx, defaultProfile); path.Valid() { } else if path := android.ExistentPathForSource(ctx, defaultProfile); path.Valid() {
bootImageProfile = path.Path() profiles = append(profiles, path.Path())
} else { } else {
// No profile (not even a default one, which is the case on some branches // No profile (not even a default one, which is the case on some branches
// like master-art-host that don't have frameworks/base). // like master-art-host that don't have frameworks/base).
// Return nil and continue without profile. // Return nil and continue without profile.
return nil return nil
} }
if path := android.ExistentPathForSource(ctx, extraProfile); path.Valid() {
profiles = append(profiles, path.Path())
}
bootImageProfile := image.dir.Join(ctx, "boot-image-profile.txt")
rule.Command().Text("cat").Inputs(profiles).Text(">").Output(bootImageProfile)
profile := image.dir.Join(ctx, "boot.prof") profile := image.dir.Join(ctx, "boot.prof")