aboutsummaryrefslogtreecommitdiff
path: root/kernel/prebuilt_kernel_modules.go
diff options
context:
space:
mode:
authormosimchah <mosimchah@gmail.com>2025-12-02 09:27:38 -0500
committermosimchah <mosimchah@gmail.com>2025-12-02 09:27:38 -0500
commitc7bade461dc55726f62997d13a48582f7c4b4655 (patch)
treeea0588da76060a2038f54f67efd046ca77634b10 /kernel/prebuilt_kernel_modules.go
parent0f5414d19317805e8bbbe7c4db5f0fd78769bad5 (diff)
parent89d78cff8b00d3b20a90074635c3fe5a2ee49474 (diff)
Merge branch 'lineage-23.1' of https://github.com/LineageOS/android_build_soong into HEADw16.1
* 'lineage-23.1' of https://github.com/LineageOS/android_build_soong: (528 commits) Revert "install_symlink: Make symlink target configurable" Reapply "Clear as much of cc.Module as possible after GenerateBuildActions" Revert "rust: config: Fix missing CPU variant LD flags in Rust" Rename build-flag in outdir Revert^4 "cipd: Default CIPD proxy server to on, add opt-out" Convert check-vintf-all to phony with actions Create a partial implementation of check-vintf-all for soong-only Configure RBE rust pool based on build variant Revert^3 "Add sdk version check to arr" Add jdk.internal.invoke to the allowlist Make droid always depend on symbols zip Import Device and Odm skus Don't install gob_gen in Soong Remove bazel reference from run_integration_tests.sh Fix bootstrap_test.sh Don't panic in aconfig libraries when AllowMissingDependencies is set Avoid returning nil paths from PathForModuleSrc Revert "Flag controled clang version" Rework module target dependencies on required deps Revert^2 "Add sdk version check to arr" ... Change-Id: I6e9a63fa14fda917a42e426e5dcebbad7f67e1de
Diffstat (limited to 'kernel/prebuilt_kernel_modules.go')
-rw-r--r--kernel/prebuilt_kernel_modules.go62
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 (