Loading fsgen/filesystem_creator.go +19 −29 Original line number Diff line number Diff line Loading @@ -231,39 +231,29 @@ func (f *filesystemCreator) createPartition(ctx android.LoadHookContext, partiti } // createPrebuiltKernelModules creates `prebuilt_kernel_modules`. These modules will be added to deps of the // autogenerated *_dlkm filsystem modules. // The input `kernelModules` is a space separated list of .ko files in the workspace. This will be partitioned per directory // and a `prebuilt_kernel_modules` will be created per partition. // These autogenerated modules will be subsequently added to the deps of the top level *_dlkm android_filesystem // autogenerated *_dlkm filsystem modules. Each _dlkm partition should have a single prebuilt_kernel_modules dependency. // This ensures that the depmod artifacts (modules.* installed in /lib/modules/) are generated with a complete view. // The input `kernelModules` is a space separated list of .ko files in the workspace. func (f *filesystemCreator) createPrebuiltKernelModules(ctx android.LoadHookContext, partitionType string, kernelModules []string) { // Partition the files per directory dirToFiles := map[string][]string{} for _, kernelModule := range kernelModules { dir := filepath.Dir(kernelModule) base := filepath.Base(kernelModule) dirToFiles[dir] = append(dirToFiles[dir], base) } // Create a prebuilt_kernel_modules module per partition fsGenState := ctx.Config().Get(fsGenStateOnceKey).(*FsGenState) for index, dir := range android.SortedKeys(dirToFiles) { name := generatedModuleName(ctx.Config(), fmt.Sprintf("%s-kernel-modules-%s", partitionType, strconv.Itoa(index))) name := generatedModuleName(ctx.Config(), fmt.Sprintf("%s-kernel-modules", partitionType)) props := &struct { Name *string Srcs []string }{ Name: proptools.StringPtr(name), Srcs: dirToFiles[dir], Srcs: kernelModules, } kernelModule := ctx.CreateModuleInDirectory( kernel.PrebuiltKernelModulesFactory, dir, ".", // create in root directory for now props, ) kernelModule.HideFromMake() // Add to deps (*fsGenState.fsDeps[partitionType])[name] = defaultDepCandidateProps(ctx.Config()) } } // Create a build_prop and android_info module. This will be used to create /vendor/build.prop func (f *filesystemCreator) createVendorBuildProp(ctx android.LoadHookContext) { Loading Loading
fsgen/filesystem_creator.go +19 −29 Original line number Diff line number Diff line Loading @@ -231,39 +231,29 @@ func (f *filesystemCreator) createPartition(ctx android.LoadHookContext, partiti } // createPrebuiltKernelModules creates `prebuilt_kernel_modules`. These modules will be added to deps of the // autogenerated *_dlkm filsystem modules. // The input `kernelModules` is a space separated list of .ko files in the workspace. This will be partitioned per directory // and a `prebuilt_kernel_modules` will be created per partition. // These autogenerated modules will be subsequently added to the deps of the top level *_dlkm android_filesystem // autogenerated *_dlkm filsystem modules. Each _dlkm partition should have a single prebuilt_kernel_modules dependency. // This ensures that the depmod artifacts (modules.* installed in /lib/modules/) are generated with a complete view. // The input `kernelModules` is a space separated list of .ko files in the workspace. func (f *filesystemCreator) createPrebuiltKernelModules(ctx android.LoadHookContext, partitionType string, kernelModules []string) { // Partition the files per directory dirToFiles := map[string][]string{} for _, kernelModule := range kernelModules { dir := filepath.Dir(kernelModule) base := filepath.Base(kernelModule) dirToFiles[dir] = append(dirToFiles[dir], base) } // Create a prebuilt_kernel_modules module per partition fsGenState := ctx.Config().Get(fsGenStateOnceKey).(*FsGenState) for index, dir := range android.SortedKeys(dirToFiles) { name := generatedModuleName(ctx.Config(), fmt.Sprintf("%s-kernel-modules-%s", partitionType, strconv.Itoa(index))) name := generatedModuleName(ctx.Config(), fmt.Sprintf("%s-kernel-modules", partitionType)) props := &struct { Name *string Srcs []string }{ Name: proptools.StringPtr(name), Srcs: dirToFiles[dir], Srcs: kernelModules, } kernelModule := ctx.CreateModuleInDirectory( kernel.PrebuiltKernelModulesFactory, dir, ".", // create in root directory for now props, ) kernelModule.HideFromMake() // Add to deps (*fsGenState.fsDeps[partitionType])[name] = defaultDepCandidateProps(ctx.Config()) } } // Create a build_prop and android_info module. This will be used to create /vendor/build.prop func (f *filesystemCreator) createVendorBuildProp(ctx android.LoadHookContext) { Loading