2018-04-10 12:07:10 +08:00
|
|
|
// Copyright 2016 Google Inc. All rights reserved.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
2020-06-02 01:45:49 +08:00
|
|
|
package etc
|
2018-04-10 12:07:10 +08:00
|
|
|
|
2020-06-02 01:45:49 +08:00
|
|
|
import (
|
|
|
|
"strconv"
|
|
|
|
|
|
|
|
"github.com/google/blueprint/proptools"
|
|
|
|
|
|
|
|
"android/soong/android"
|
|
|
|
)
|
|
|
|
|
|
|
|
var pctx = android.NewPackageContext("android/soong/etc")
|
2018-04-10 12:07:10 +08:00
|
|
|
|
2019-02-13 21:50:33 +08:00
|
|
|
// TODO(jungw): Now that it handles more than the ones in etc/, consider renaming this file.
|
2018-04-10 12:07:10 +08:00
|
|
|
|
|
|
|
func init() {
|
2020-06-02 01:45:49 +08:00
|
|
|
pctx.Import("android/soong/android")
|
2020-08-26 21:11:53 +08:00
|
|
|
RegisterPrebuiltEtcBuildComponents(android.InitRegistrationContext)
|
|
|
|
}
|
2020-06-02 01:45:49 +08:00
|
|
|
|
2020-08-26 21:11:53 +08:00
|
|
|
func RegisterPrebuiltEtcBuildComponents(ctx android.RegistrationContext) {
|
|
|
|
ctx.RegisterModuleType("prebuilt_etc", PrebuiltEtcFactory)
|
|
|
|
ctx.RegisterModuleType("prebuilt_etc_host", PrebuiltEtcHostFactory)
|
|
|
|
ctx.RegisterModuleType("prebuilt_usr_share", PrebuiltUserShareFactory)
|
|
|
|
ctx.RegisterModuleType("prebuilt_usr_share_host", PrebuiltUserShareHostFactory)
|
|
|
|
ctx.RegisterModuleType("prebuilt_font", PrebuiltFontFactory)
|
|
|
|
ctx.RegisterModuleType("prebuilt_firmware", PrebuiltFirmwareFactory)
|
|
|
|
ctx.RegisterModuleType("prebuilt_dsp", PrebuiltDSPFactory)
|
2018-04-10 12:07:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
type prebuiltEtcProperties struct {
|
|
|
|
// Source file of this prebuilt.
|
2019-03-05 14:35:41 +08:00
|
|
|
Src *string `android:"path,arch_variant"`
|
2018-04-10 12:07:10 +08:00
|
|
|
|
2020-06-27 01:12:36 +08:00
|
|
|
// optional subdirectory under which this file is installed into, cannot be specified with relative_install_path, prefer relative_install_path
|
2018-04-10 12:07:10 +08:00
|
|
|
Sub_dir *string `android:"arch_variant"`
|
2018-08-15 13:20:22 +08:00
|
|
|
|
2020-06-27 01:12:36 +08:00
|
|
|
// optional subdirectory under which this file is installed into, cannot be specified with sub_dir
|
|
|
|
Relative_install_path *string `android:"arch_variant"`
|
|
|
|
|
2018-10-26 20:49:39 +08:00
|
|
|
// optional name for the installed file. If unspecified, name of the module is used as the file name
|
|
|
|
Filename *string `android:"arch_variant"`
|
|
|
|
|
2018-11-13 10:59:12 +08:00
|
|
|
// when set to true, and filename property is not set, the name for the installed file
|
|
|
|
// is the same as the file name of the source file.
|
|
|
|
Filename_from_src *bool `android:"arch_variant"`
|
|
|
|
|
2020-01-22 07:53:22 +08:00
|
|
|
// Make this module available when building for ramdisk.
|
|
|
|
Ramdisk_available *bool
|
|
|
|
|
2020-10-22 06:17:56 +08:00
|
|
|
// Make this module available when building for vendor ramdisk.
|
|
|
|
Vendor_ramdisk_available *bool
|
|
|
|
|
2018-08-15 13:20:22 +08:00
|
|
|
// Make this module available when building for recovery.
|
|
|
|
Recovery_available *bool
|
|
|
|
|
2018-10-31 21:49:57 +08:00
|
|
|
// Whether this module is directly installable to one of the partitions. Default: true.
|
|
|
|
Installable *bool
|
2020-05-27 17:56:39 +08:00
|
|
|
|
|
|
|
// Install symlinks to the installed file.
|
|
|
|
Symlinks []string `android:"arch_variant"`
|
2018-04-10 12:07:10 +08:00
|
|
|
}
|
|
|
|
|
2019-11-06 15:53:07 +08:00
|
|
|
type PrebuiltEtcModule interface {
|
2020-06-02 01:45:49 +08:00
|
|
|
android.Module
|
2020-08-26 21:11:53 +08:00
|
|
|
BaseDir() string
|
2019-11-06 15:53:07 +08:00
|
|
|
SubDir() string
|
2020-06-02 01:45:49 +08:00
|
|
|
OutputFile() android.OutputPath
|
2019-11-06 15:53:07 +08:00
|
|
|
}
|
|
|
|
|
2018-04-25 21:57:34 +08:00
|
|
|
type PrebuiltEtc struct {
|
2020-06-02 01:45:49 +08:00
|
|
|
android.ModuleBase
|
2018-04-10 12:07:10 +08:00
|
|
|
|
|
|
|
properties prebuiltEtcProperties
|
|
|
|
|
2020-06-02 01:45:49 +08:00
|
|
|
sourceFilePath android.Path
|
|
|
|
outputFilePath android.OutputPath
|
2019-02-13 21:50:33 +08:00
|
|
|
// The base install location, e.g. "etc" for prebuilt_etc, "usr/share" for prebuilt_usr_share.
|
2019-06-04 06:29:27 +08:00
|
|
|
installDirBase string
|
|
|
|
// The base install location when soc_specific property is set to true, e.g. "firmware" for prebuilt_firmware.
|
|
|
|
socInstallDirBase string
|
2020-06-02 01:45:49 +08:00
|
|
|
installDirPath android.InstallPath
|
|
|
|
additionalDependencies *android.Paths
|
2018-04-10 12:07:10 +08:00
|
|
|
}
|
|
|
|
|
2020-01-22 07:53:22 +08:00
|
|
|
func (p *PrebuiltEtc) inRamdisk() bool {
|
|
|
|
return p.ModuleBase.InRamdisk() || p.ModuleBase.InstallInRamdisk()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PrebuiltEtc) onlyInRamdisk() bool {
|
|
|
|
return p.ModuleBase.InstallInRamdisk()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PrebuiltEtc) InstallInRamdisk() bool {
|
|
|
|
return p.inRamdisk()
|
|
|
|
}
|
|
|
|
|
2020-10-22 06:17:56 +08:00
|
|
|
func (p *PrebuiltEtc) inVendorRamdisk() bool {
|
|
|
|
return p.ModuleBase.InVendorRamdisk() || p.ModuleBase.InstallInVendorRamdisk()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PrebuiltEtc) onlyInVendorRamdisk() bool {
|
|
|
|
return p.ModuleBase.InstallInVendorRamdisk()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PrebuiltEtc) InstallInVendorRamdisk() bool {
|
|
|
|
return p.inVendorRamdisk()
|
|
|
|
}
|
|
|
|
|
2018-08-15 13:20:22 +08:00
|
|
|
func (p *PrebuiltEtc) inRecovery() bool {
|
2019-11-19 08:00:16 +08:00
|
|
|
return p.ModuleBase.InRecovery() || p.ModuleBase.InstallInRecovery()
|
2018-08-15 13:20:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PrebuiltEtc) onlyInRecovery() bool {
|
|
|
|
return p.ModuleBase.InstallInRecovery()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PrebuiltEtc) InstallInRecovery() bool {
|
|
|
|
return p.inRecovery()
|
|
|
|
}
|
|
|
|
|
2020-06-02 01:45:49 +08:00
|
|
|
var _ android.ImageInterface = (*PrebuiltEtc)(nil)
|
2019-11-19 08:00:16 +08:00
|
|
|
|
2020-06-02 01:45:49 +08:00
|
|
|
func (p *PrebuiltEtc) ImageMutatorBegin(ctx android.BaseModuleContext) {}
|
2019-11-19 08:00:16 +08:00
|
|
|
|
2020-06-02 01:45:49 +08:00
|
|
|
func (p *PrebuiltEtc) CoreVariantNeeded(ctx android.BaseModuleContext) bool {
|
2020-10-22 06:17:56 +08:00
|
|
|
return !p.ModuleBase.InstallInRecovery() && !p.ModuleBase.InstallInRamdisk() &&
|
|
|
|
!p.ModuleBase.InstallInVendorRamdisk()
|
2020-01-22 07:53:22 +08:00
|
|
|
}
|
|
|
|
|
2020-06-02 01:45:49 +08:00
|
|
|
func (p *PrebuiltEtc) RamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
|
|
|
|
return proptools.Bool(p.properties.Ramdisk_available) || p.ModuleBase.InstallInRamdisk()
|
2019-11-19 08:00:16 +08:00
|
|
|
}
|
|
|
|
|
2020-10-22 06:17:56 +08:00
|
|
|
func (p *PrebuiltEtc) VendorRamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
|
|
|
|
return proptools.Bool(p.properties.Vendor_ramdisk_available) || p.ModuleBase.InstallInVendorRamdisk()
|
|
|
|
}
|
|
|
|
|
2020-06-02 01:45:49 +08:00
|
|
|
func (p *PrebuiltEtc) RecoveryVariantNeeded(ctx android.BaseModuleContext) bool {
|
|
|
|
return proptools.Bool(p.properties.Recovery_available) || p.ModuleBase.InstallInRecovery()
|
2019-11-19 08:00:16 +08:00
|
|
|
}
|
|
|
|
|
2020-06-02 01:45:49 +08:00
|
|
|
func (p *PrebuiltEtc) ExtraImageVariations(ctx android.BaseModuleContext) []string {
|
2019-11-19 08:00:16 +08:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2020-06-02 01:45:49 +08:00
|
|
|
func (p *PrebuiltEtc) SetImageVariation(ctx android.BaseModuleContext, variation string, module android.Module) {
|
2019-11-19 08:00:16 +08:00
|
|
|
}
|
|
|
|
|
2020-06-02 01:45:49 +08:00
|
|
|
func (p *PrebuiltEtc) DepsMutator(ctx android.BottomUpMutatorContext) {
|
2018-04-25 21:57:34 +08:00
|
|
|
if p.properties.Src == nil {
|
|
|
|
ctx.PropertyErrorf("src", "missing prebuilt source file")
|
2018-04-10 12:07:10 +08:00
|
|
|
}
|
2018-04-25 21:57:34 +08:00
|
|
|
}
|
|
|
|
|
2020-06-02 01:45:49 +08:00
|
|
|
func (p *PrebuiltEtc) SourceFilePath(ctx android.ModuleContext) android.Path {
|
|
|
|
return android.PathForModuleSrc(ctx, android.String(p.properties.Src))
|
2018-04-10 12:07:10 +08:00
|
|
|
}
|
|
|
|
|
2020-06-02 01:45:49 +08:00
|
|
|
func (p *PrebuiltEtc) InstallDirPath() android.InstallPath {
|
2019-07-22 14:48:36 +08:00
|
|
|
return p.installDirPath
|
|
|
|
}
|
|
|
|
|
2018-04-25 21:57:34 +08:00
|
|
|
// This allows other derivative modules (e.g. prebuilt_etc_xml) to perform
|
|
|
|
// additional steps (like validating the src) before the file is installed.
|
2020-06-02 01:45:49 +08:00
|
|
|
func (p *PrebuiltEtc) SetAdditionalDependencies(paths android.Paths) {
|
2018-04-25 21:57:34 +08:00
|
|
|
p.additionalDependencies = &paths
|
|
|
|
}
|
|
|
|
|
2020-06-02 01:45:49 +08:00
|
|
|
func (p *PrebuiltEtc) OutputFile() android.OutputPath {
|
2018-10-04 19:27:15 +08:00
|
|
|
return p.outputFilePath
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PrebuiltEtc) SubDir() string {
|
2020-06-27 01:12:36 +08:00
|
|
|
if subDir := proptools.String(p.properties.Sub_dir); subDir != "" {
|
|
|
|
return subDir
|
|
|
|
}
|
|
|
|
return proptools.String(p.properties.Relative_install_path)
|
2018-10-04 19:27:15 +08:00
|
|
|
}
|
|
|
|
|
2020-08-26 21:11:53 +08:00
|
|
|
func (p *PrebuiltEtc) BaseDir() string {
|
2020-09-21 10:02:57 +08:00
|
|
|
return p.installDirBase
|
2020-08-26 21:11:53 +08:00
|
|
|
}
|
|
|
|
|
2018-10-31 21:49:57 +08:00
|
|
|
func (p *PrebuiltEtc) Installable() bool {
|
2020-06-02 01:45:49 +08:00
|
|
|
return p.properties.Installable == nil || android.Bool(p.properties.Installable)
|
2018-10-31 21:49:57 +08:00
|
|
|
}
|
|
|
|
|
2020-06-02 01:45:49 +08:00
|
|
|
func (p *PrebuiltEtc) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
|
|
|
p.sourceFilePath = android.PathForModuleSrc(ctx, android.String(p.properties.Src))
|
|
|
|
filename := android.String(p.properties.Filename)
|
|
|
|
filename_from_src := android.Bool(p.properties.Filename_from_src)
|
2018-10-26 20:49:39 +08:00
|
|
|
if filename == "" {
|
2018-11-13 10:59:12 +08:00
|
|
|
if filename_from_src {
|
|
|
|
filename = p.sourceFilePath.Base()
|
|
|
|
} else {
|
|
|
|
filename = ctx.ModuleName()
|
|
|
|
}
|
|
|
|
} else if filename_from_src {
|
|
|
|
ctx.PropertyErrorf("filename_from_src", "filename is set. filename_from_src can't be true")
|
|
|
|
return
|
2018-10-26 20:49:39 +08:00
|
|
|
}
|
2020-06-02 01:45:49 +08:00
|
|
|
p.outputFilePath = android.PathForModuleOut(ctx, filename).OutputPath
|
2019-06-04 06:29:27 +08:00
|
|
|
|
2020-06-27 01:12:36 +08:00
|
|
|
if p.properties.Sub_dir != nil && p.properties.Relative_install_path != nil {
|
|
|
|
ctx.PropertyErrorf("sub_dir", "relative_install_path is set. Cannot set sub_dir")
|
|
|
|
}
|
|
|
|
|
2020-09-21 10:02:57 +08:00
|
|
|
// If soc install dir was specified and SOC specific is set, set the installDirPath to the specified
|
|
|
|
// socInstallDirBase.
|
|
|
|
installBaseDir := p.installDirBase
|
|
|
|
if p.SocSpecific() && p.socInstallDirBase != "" {
|
|
|
|
installBaseDir = p.socInstallDirBase
|
|
|
|
}
|
|
|
|
p.installDirPath = android.PathForModuleInstall(ctx, installBaseDir, p.SubDir())
|
2018-10-04 19:27:15 +08:00
|
|
|
|
2019-01-26 08:04:11 +08:00
|
|
|
// This ensures that outputFilePath has the correct name for others to
|
|
|
|
// use, as the source file may have a different name.
|
2020-06-02 01:45:49 +08:00
|
|
|
ctx.Build(pctx, android.BuildParams{
|
|
|
|
Rule: android.Cp,
|
2018-10-04 19:27:15 +08:00
|
|
|
Output: p.outputFilePath,
|
|
|
|
Input: p.sourceFilePath,
|
|
|
|
})
|
2020-09-29 19:15:08 +08:00
|
|
|
|
|
|
|
if p.Installable() {
|
|
|
|
installPath := ctx.InstallFile(p.installDirPath, p.outputFilePath.Base(), p.outputFilePath)
|
|
|
|
for _, sl := range p.properties.Symlinks {
|
|
|
|
ctx.InstallSymlink(p.installDirPath, sl, installPath)
|
|
|
|
}
|
|
|
|
}
|
2018-04-10 12:07:10 +08:00
|
|
|
}
|
|
|
|
|
2020-06-02 01:45:49 +08:00
|
|
|
func (p *PrebuiltEtc) AndroidMkEntries() []android.AndroidMkEntries {
|
2019-04-04 06:47:29 +08:00
|
|
|
nameSuffix := ""
|
2020-01-22 07:53:22 +08:00
|
|
|
if p.inRamdisk() && !p.onlyInRamdisk() {
|
|
|
|
nameSuffix = ".ramdisk"
|
|
|
|
}
|
2020-10-22 06:17:56 +08:00
|
|
|
if p.inVendorRamdisk() && !p.onlyInVendorRamdisk() {
|
|
|
|
nameSuffix = ".vendor_ramdisk"
|
|
|
|
}
|
2019-04-04 06:47:29 +08:00
|
|
|
if p.inRecovery() && !p.onlyInRecovery() {
|
|
|
|
nameSuffix = ".recovery"
|
|
|
|
}
|
2020-06-02 01:45:49 +08:00
|
|
|
return []android.AndroidMkEntries{android.AndroidMkEntries{
|
2019-04-04 06:47:29 +08:00
|
|
|
Class: "ETC",
|
|
|
|
SubName: nameSuffix,
|
2020-06-02 01:45:49 +08:00
|
|
|
OutputFile: android.OptionalPathForPath(p.outputFilePath),
|
|
|
|
ExtraEntries: []android.AndroidMkExtraEntriesFunc{
|
|
|
|
func(entries *android.AndroidMkEntries) {
|
2019-08-28 08:33:16 +08:00
|
|
|
entries.SetString("LOCAL_MODULE_TAGS", "optional")
|
2019-10-03 07:01:35 +08:00
|
|
|
entries.SetString("LOCAL_MODULE_PATH", p.installDirPath.ToMakePath().String())
|
2019-08-28 08:33:16 +08:00
|
|
|
entries.SetString("LOCAL_INSTALLED_MODULE_STEM", p.outputFilePath.Base())
|
2020-05-27 17:56:39 +08:00
|
|
|
if len(p.properties.Symlinks) > 0 {
|
|
|
|
entries.AddStrings("LOCAL_MODULE_SYMLINKS", p.properties.Symlinks...)
|
|
|
|
}
|
2019-08-28 08:33:16 +08:00
|
|
|
entries.SetString("LOCAL_UNINSTALLABLE_MODULE", strconv.FormatBool(!p.Installable()))
|
|
|
|
if p.additionalDependencies != nil {
|
|
|
|
for _, path := range *p.additionalDependencies {
|
2020-05-27 17:56:39 +08:00
|
|
|
entries.AddStrings("LOCAL_ADDITIONAL_DEPENDENCIES", path.String())
|
2019-08-28 08:33:16 +08:00
|
|
|
}
|
2018-04-25 21:57:34 +08:00
|
|
|
}
|
2019-08-28 08:33:16 +08:00
|
|
|
},
|
2018-04-10 12:07:10 +08:00
|
|
|
},
|
2019-12-03 12:24:29 +08:00
|
|
|
}}
|
2018-04-10 12:07:10 +08:00
|
|
|
}
|
|
|
|
|
2019-07-22 14:48:36 +08:00
|
|
|
func InitPrebuiltEtcModule(p *PrebuiltEtc, dirBase string) {
|
|
|
|
p.installDirBase = dirBase
|
2018-04-25 21:57:34 +08:00
|
|
|
p.AddProperties(&p.properties)
|
|
|
|
}
|
2018-04-10 12:07:10 +08:00
|
|
|
|
2019-03-12 06:58:50 +08:00
|
|
|
// prebuilt_etc is for a prebuilt artifact that is installed in
|
|
|
|
// <partition>/etc/<sub_dir> directory.
|
2020-06-02 01:45:49 +08:00
|
|
|
func PrebuiltEtcFactory() android.Module {
|
2019-07-22 14:48:36 +08:00
|
|
|
module := &PrebuiltEtc{}
|
|
|
|
InitPrebuiltEtcModule(module, "etc")
|
2018-04-25 21:57:34 +08:00
|
|
|
// This module is device-only
|
2020-06-02 01:45:49 +08:00
|
|
|
android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
|
2018-04-10 12:07:10 +08:00
|
|
|
return module
|
|
|
|
}
|
2018-08-15 13:20:22 +08:00
|
|
|
|
2019-03-12 06:58:50 +08:00
|
|
|
// prebuilt_etc_host is for a host prebuilt artifact that is installed in
|
|
|
|
// $(HOST_OUT)/etc/<sub_dir> directory.
|
2020-06-02 01:45:49 +08:00
|
|
|
func PrebuiltEtcHostFactory() android.Module {
|
2019-07-22 14:48:36 +08:00
|
|
|
module := &PrebuiltEtc{}
|
|
|
|
InitPrebuiltEtcModule(module, "etc")
|
2019-02-05 06:34:10 +08:00
|
|
|
// This module is host-only
|
2020-06-02 01:45:49 +08:00
|
|
|
android.InitAndroidArchModule(module, android.HostSupported, android.MultilibCommon)
|
2019-02-05 06:34:10 +08:00
|
|
|
return module
|
2019-02-13 21:50:33 +08:00
|
|
|
}
|
|
|
|
|
2019-03-12 06:58:50 +08:00
|
|
|
// prebuilt_usr_share is for a prebuilt artifact that is installed in
|
|
|
|
// <partition>/usr/share/<sub_dir> directory.
|
2020-06-02 01:45:49 +08:00
|
|
|
func PrebuiltUserShareFactory() android.Module {
|
2019-07-22 14:48:36 +08:00
|
|
|
module := &PrebuiltEtc{}
|
|
|
|
InitPrebuiltEtcModule(module, "usr/share")
|
2019-02-13 21:50:33 +08:00
|
|
|
// This module is device-only
|
2020-06-02 01:45:49 +08:00
|
|
|
android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
|
2019-02-13 21:50:33 +08:00
|
|
|
return module
|
2019-02-23 07:47:57 +08:00
|
|
|
}
|
|
|
|
|
2019-03-12 06:58:50 +08:00
|
|
|
// prebuild_usr_share_host is for a host prebuilt artifact that is installed in
|
|
|
|
// $(HOST_OUT)/usr/share/<sub_dir> directory.
|
2020-06-02 01:45:49 +08:00
|
|
|
func PrebuiltUserShareHostFactory() android.Module {
|
2019-07-22 14:48:36 +08:00
|
|
|
module := &PrebuiltEtc{}
|
|
|
|
InitPrebuiltEtcModule(module, "usr/share")
|
2019-02-23 07:47:57 +08:00
|
|
|
// This module is host-only
|
2020-06-02 01:45:49 +08:00
|
|
|
android.InitAndroidArchModule(module, android.HostSupported, android.MultilibCommon)
|
2019-02-23 07:47:57 +08:00
|
|
|
return module
|
2019-02-05 06:34:10 +08:00
|
|
|
}
|
|
|
|
|
2019-05-14 23:20:45 +08:00
|
|
|
// prebuilt_font installs a font in <partition>/fonts directory.
|
2020-06-02 01:45:49 +08:00
|
|
|
func PrebuiltFontFactory() android.Module {
|
2019-07-22 14:48:36 +08:00
|
|
|
module := &PrebuiltEtc{}
|
|
|
|
InitPrebuiltEtcModule(module, "fonts")
|
2019-05-14 23:20:45 +08:00
|
|
|
// This module is device-only
|
2020-06-02 01:45:49 +08:00
|
|
|
android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
|
2019-05-14 23:20:45 +08:00
|
|
|
return module
|
|
|
|
}
|
2019-06-04 06:29:27 +08:00
|
|
|
|
|
|
|
// prebuilt_firmware installs a firmware file to <partition>/etc/firmware directory for system image.
|
|
|
|
// If soc_specific property is set to true, the firmware file is installed to the vendor <partition>/firmware
|
|
|
|
// directory for vendor image.
|
2020-06-02 01:45:49 +08:00
|
|
|
func PrebuiltFirmwareFactory() android.Module {
|
2019-07-22 14:48:36 +08:00
|
|
|
module := &PrebuiltEtc{}
|
|
|
|
module.socInstallDirBase = "firmware"
|
|
|
|
InitPrebuiltEtcModule(module, "etc/firmware")
|
2019-06-04 06:29:27 +08:00
|
|
|
// This module is device-only
|
2020-06-02 01:45:49 +08:00
|
|
|
android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
|
2019-06-04 06:29:27 +08:00
|
|
|
return module
|
|
|
|
}
|
2020-06-09 05:40:25 +08:00
|
|
|
|
|
|
|
// prebuilt_dsp installs a DSP related file to <partition>/etc/dsp directory for system image.
|
|
|
|
// If soc_specific property is set to true, the DSP related file is installed to the vendor <partition>/dsp
|
|
|
|
// directory for vendor image.
|
|
|
|
func PrebuiltDSPFactory() android.Module {
|
|
|
|
module := &PrebuiltEtc{}
|
|
|
|
module.socInstallDirBase = "dsp"
|
|
|
|
InitPrebuiltEtcModule(module, "etc/dsp")
|
|
|
|
// This module is device-only
|
|
|
|
android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
|
|
|
|
return module
|
|
|
|
}
|