diff options
Diffstat (limited to 'kernel/prebuilt_kernel_modules.go')
| -rw-r--r-- | kernel/prebuilt_kernel_modules.go | 62 |
1 files changed, 49 insertions, 13 deletions
diff --git a/kernel/prebuilt_kernel_modules.go b/kernel/prebuilt_kernel_modules.go index 1225da0f2..1ba4f8889 100644 --- a/kernel/prebuilt_kernel_modules.go +++ b/kernel/prebuilt_kernel_modules.go @@ -47,6 +47,11 @@ type prebuiltKernelModulesProperties struct { // List or filegroup of prebuilt kernel module files. Should have .ko suffix. Srcs []string `android:"path,arch_variant"` + // List or filegroup of prebuilt kernel module files for 16k. Should have .ko suffix. + // These files will be installed in lib/modules/16k-mode/ + // These files are ONLY loaded during the Second Boot Stage when the device is in 16k mode. + Srcs_16k []string `android:"path,arch_variant"` + // List of system_dlkm kernel modules that the local kernel modules depend on. // The deps will be assembled into intermediates directory for running depmod // but will not be added to the current module's installed files. @@ -120,45 +125,76 @@ func (pkm *prebuiltKernelModules) GenerateAndroidBuildActions(ctx android.Module installDir = installDir.Join(ctx, pkm.KernelVersion()) } + dests := []string{} for _, m := range modules { - ctx.InstallFile(installDir, filepath.Base(m.String()), m) + installPath := ctx.InstallFile(installDir, filepath.Base(m.String()), m) + dests = append(dests, installPath.String()) + } + installDir16k := installDir.Join(ctx, "16k-mode") + for _, m := range android.PathsForModuleSrc(ctx, pkm.properties.Srcs_16k) { + installPath := ctx.InstallFile(installDir16k, filepath.Base(m.String()), m) + dests = append(dests, installPath.String()) } - ctx.InstallFile(installDir, "modules.load", depmodOut.modulesLoad) - ctx.InstallFile(installDir, "modules.dep", depmodOut.modulesDep) - ctx.InstallFile(installDir, "modules.softdep", depmodOut.modulesSoftdep) - ctx.InstallFile(installDir, "modules.alias", depmodOut.modulesAlias) - pkm.installBlocklistFile(ctx, installDir) - pkm.installOptionsFile(ctx, installDir) + srcs := android.PathsForModuleSrc(ctx, pkm.properties.Srcs).Strings() + srcs = append(srcs, android.PathsForModuleSrc(ctx, pkm.properties.Srcs_16k).Strings()...) + // Use ANDROID-GEN to identify the source of module.* files which are generated in the build process. + // See the use of ANDROID-GEN in build/make/core/Makefile + androidGen := "ANDROID-GEN" + // Add ANDROID-GEN four time to match the number of "modules.*" files installed below. + srcs = append(srcs, androidGen, androidGen, androidGen, androidGen) + installPath := ctx.InstallFile(installDir, "modules.load", depmodOut.modulesLoad) + dests = append(dests, installPath.String()) + installPath = ctx.InstallFile(installDir, "modules.dep", depmodOut.modulesDep) + dests = append(dests, installPath.String()) + installPath = ctx.InstallFile(installDir, "modules.softdep", depmodOut.modulesSoftdep) + dests = append(dests, installPath.String()) + installPath = ctx.InstallFile(installDir, "modules.alias", depmodOut.modulesAlias) + dests = append(dests, installPath.String()) + + pkm.installBlocklistFile(ctx, installDir, &srcs, &dests) + pkm.installOptionsFile(ctx, installDir, &srcs, &dests) ctx.SetOutputFiles(modules, ".modules") + + android.SetProvider(ctx, android.PrebuiltKernelModulesComplianceMetadataProvider, + android.PrebuiltKernelModulesComplianceMetadata{ + Srcs: srcs, + Dests: dests, + }) } -func (pkm *prebuiltKernelModules) installBlocklistFile(ctx android.ModuleContext, installDir android.InstallPath) { +func (pkm *prebuiltKernelModules) installBlocklistFile(ctx android.ModuleContext, installDir android.InstallPath, srcs *[]string, dests *[]string) { if pkm.properties.Blocklist_file == nil { return } blocklistOut := android.PathForModuleOut(ctx, "modules.blocklist") + src := android.PathForModuleSrc(ctx, proptools.String(pkm.properties.Blocklist_file)) + *srcs = append(*srcs, src.String()) ctx.Build(pctx, android.BuildParams{ Rule: processBlocklistFile, - Input: android.PathForModuleSrc(ctx, proptools.String(pkm.properties.Blocklist_file)), + Input: src, Output: blocklistOut, }) - ctx.InstallFile(installDir, "modules.blocklist", blocklistOut) + installPath := ctx.InstallFile(installDir, "modules.blocklist", blocklistOut) + *dests = append(*dests, installPath.String()) } -func (pkm *prebuiltKernelModules) installOptionsFile(ctx android.ModuleContext, installDir android.InstallPath) { +func (pkm *prebuiltKernelModules) installOptionsFile(ctx android.ModuleContext, installDir android.InstallPath, srcs *[]string, dests *[]string) { if pkm.properties.Options_file == nil { return } optionsOut := android.PathForModuleOut(ctx, "modules.options") + src := android.PathForModuleSrc(ctx, proptools.String(pkm.properties.Options_file)) + *srcs = append(*srcs, src.String()) ctx.Build(pctx, android.BuildParams{ Rule: processOptionsFile, - Input: android.PathForModuleSrc(ctx, proptools.String(pkm.properties.Options_file)), + Input: src, Output: optionsOut, }) - ctx.InstallFile(installDir, "modules.options", optionsOut) + installPath := ctx.InstallFile(installDir, "modules.options", optionsOut) + *dests = append(*dests, installPath.String()) } var ( |
