blob: d04b2d1f101d505244071df65ecc3864db5f68b5 [file] [log] [blame]
Jiyong Parkc678ad32018-04-10 13:07:10 +09001// Copyright 2016 Google Inc. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
Jaewoong Jung4b79e982020-06-01 10:45:49 -070015package etc
Jiyong Parkc678ad32018-04-10 13:07:10 +090016
Yo Chiang803c40d2020-11-16 20:32:51 +080017// This file implements module types that install prebuilt artifacts.
18//
19// There exist two classes of prebuilt modules in the Android tree. The first class are the ones
20// based on `android.Prebuilt`, such as `cc_prebuilt_library` and `java_import`. This kind of
21// modules may exist both as prebuilts and source at the same time, though only one would be
22// installed and the other would be marked disabled. The `prebuilt_postdeps` mutator would select
23// the actual modules to be installed. More details in android/prebuilt.go.
24//
25// The second class is described in this file. Unlike `android.Prebuilt` based module types,
26// `prebuilt_etc` exist only as prebuilts and cannot have a same-named source module counterpart.
27// This makes the logic of `prebuilt_etc` to be much simpler as they don't need to go through the
28// various `prebuilt_*` mutators.
Jaewoong Jung4b79e982020-06-01 10:45:49 -070029
Yo Chiang803c40d2020-11-16 20:32:51 +080030import (
Jiyong Park76a42f52021-02-16 06:50:37 +090031 "fmt"
Kiyoung Kimae11c232021-07-19 11:38:04 +090032 "path/filepath"
Inseob Kim27408bf2021-04-06 21:00:17 +090033 "strings"
Jiyong Park76a42f52021-02-16 06:50:37 +090034
Jaewoong Jung4b79e982020-06-01 10:45:49 -070035 "github.com/google/blueprint/proptools"
36
37 "android/soong/android"
38)
39
40var pctx = android.NewPackageContext("android/soong/etc")
Jiyong Parkc678ad32018-04-10 13:07:10 +090041
Jaewoong Jungc3fcdb42019-02-13 05:50:33 -080042// TODO(jungw): Now that it handles more than the ones in etc/, consider renaming this file.
Jiyong Parkc678ad32018-04-10 13:07:10 +090043
44func init() {
Jaewoong Jung4b79e982020-06-01 10:45:49 -070045 pctx.Import("android/soong/android")
Jooyung Han0703fd82020-08-26 22:11:53 +090046 RegisterPrebuiltEtcBuildComponents(android.InitRegistrationContext)
47}
Jaewoong Jung4b79e982020-06-01 10:45:49 -070048
Jooyung Han0703fd82020-08-26 22:11:53 +090049func RegisterPrebuiltEtcBuildComponents(ctx android.RegistrationContext) {
50 ctx.RegisterModuleType("prebuilt_etc", PrebuiltEtcFactory)
51 ctx.RegisterModuleType("prebuilt_etc_host", PrebuiltEtcHostFactory)
Miguel32b02802022-12-01 18:38:26 +000052 ctx.RegisterModuleType("prebuilt_etc_cacerts", PrebuiltEtcCaCertsFactory)
Nelson Li1fb94b22024-07-09 17:04:52 +080053 ctx.RegisterModuleType("prebuilt_avb", PrebuiltAvbFactory)
Inseob Kim27408bf2021-04-06 21:00:17 +090054 ctx.RegisterModuleType("prebuilt_root", PrebuiltRootFactory)
Liz Kammere9ecddc2022-01-04 17:27:52 -050055 ctx.RegisterModuleType("prebuilt_root_host", PrebuiltRootHostFactory)
Jooyung Han0703fd82020-08-26 22:11:53 +090056 ctx.RegisterModuleType("prebuilt_usr_share", PrebuiltUserShareFactory)
57 ctx.RegisterModuleType("prebuilt_usr_share_host", PrebuiltUserShareHostFactory)
yangbill63c5e192024-03-27 09:02:12 +000058 ctx.RegisterModuleType("prebuilt_usr_hyphendata", PrebuiltUserHyphenDataFactory)
yangbill85527e62024-04-30 08:24:50 +000059 ctx.RegisterModuleType("prebuilt_usr_keylayout", PrebuiltUserKeyLayoutFactory)
60 ctx.RegisterModuleType("prebuilt_usr_keychars", PrebuiltUserKeyCharsFactory)
61 ctx.RegisterModuleType("prebuilt_usr_idc", PrebuiltUserIdcFactory)
Jooyung Han0703fd82020-08-26 22:11:53 +090062 ctx.RegisterModuleType("prebuilt_font", PrebuiltFontFactory)
Kevin93f7cd82024-05-02 12:37:59 +020063 ctx.RegisterModuleType("prebuilt_overlay", PrebuiltOverlayFactory)
Jooyung Han0703fd82020-08-26 22:11:53 +090064 ctx.RegisterModuleType("prebuilt_firmware", PrebuiltFirmwareFactory)
65 ctx.RegisterModuleType("prebuilt_dsp", PrebuiltDSPFactory)
Colin Cross83ebf232021-04-09 09:41:23 -070066 ctx.RegisterModuleType("prebuilt_rfsa", PrebuiltRFSAFactory)
Colin Crossf17e2b52023-10-30 15:17:25 -070067 ctx.RegisterModuleType("prebuilt_renderscript_bitcode", PrebuiltRenderScriptBitcodeFactory)
Inseob Kim1e27a142021-05-06 11:46:11 +000068
69 ctx.RegisterModuleType("prebuilt_defaults", defaultsFactory)
Rupert Shuttleworth378fc1b2021-07-28 08:03:16 -040070
Jiyong Parkc678ad32018-04-10 13:07:10 +090071}
72
Paul Duffin1172fed2021-03-08 11:28:18 +000073var PrepareForTestWithPrebuiltEtc = android.FixtureRegisterWithContext(RegisterPrebuiltEtcBuildComponents)
74
Jiyong Parkc678ad32018-04-10 13:07:10 +090075type prebuiltEtcProperties struct {
Yo Chiang803c40d2020-11-16 20:32:51 +080076 // Source file of this prebuilt. Can reference a genrule type module with the ":module" syntax.
Thiébaud Weksteen00e8b312024-03-18 14:06:00 +110077 // Mutually exclusive with srcs.
Cole Faustfdec8722024-05-22 11:38:29 -070078 Src proptools.Configurable[string] `android:"path,arch_variant,replace_instead_of_append"`
Jiyong Parkc678ad32018-04-10 13:07:10 +090079
Thiébaud Weksteen00e8b312024-03-18 14:06:00 +110080 // Source files of this prebuilt. Can reference a genrule type module with the ":module" syntax.
81 // Mutually exclusive with src. When used, filename_from_src is set to true.
Cole Faustfdec8722024-05-22 11:38:29 -070082 Srcs proptools.Configurable[[]string] `android:"path,arch_variant"`
Thiébaud Weksteen00e8b312024-03-18 14:06:00 +110083
Yo Chiangf0e19fe2020-11-18 15:28:42 +080084 // Optional name for the installed file. If unspecified, name of the module is used as the file
Thiébaud Weksteen00e8b312024-03-18 14:06:00 +110085 // name. Only available when using a single source (src).
Jiyong Park139a2e62018-10-26 21:49:39 +090086 Filename *string `android:"arch_variant"`
87
Yo Chiangf0e19fe2020-11-18 15:28:42 +080088 // When set to true, and filename property is not set, the name for the installed file
Jiyong Park1a7cf082018-11-13 11:59:12 +090089 // is the same as the file name of the source file.
90 Filename_from_src *bool `android:"arch_variant"`
91
Yifan Hong1b3348d2020-01-21 15:53:22 -080092 // Make this module available when building for ramdisk.
Yifan Hong39143a92020-10-26 12:43:12 -070093 // On device without a dedicated recovery partition, the module is only
94 // available after switching root into
95 // /first_stage_ramdisk. To expose the module before switching root, install
96 // the recovery variant instead.
Yifan Hong1b3348d2020-01-21 15:53:22 -080097 Ramdisk_available *bool
98
Yifan Hong60e0cfb2020-10-21 15:17:56 -070099 // Make this module available when building for vendor ramdisk.
Yifan Hong39143a92020-10-26 12:43:12 -0700100 // On device without a dedicated recovery partition, the module is only
101 // available after switching root into
102 // /first_stage_ramdisk. To expose the module before switching root, install
103 // the recovery variant instead.
Yifan Hong60e0cfb2020-10-21 15:17:56 -0700104 Vendor_ramdisk_available *bool
105
Inseob Kim08758f02021-04-08 21:13:22 +0900106 // Make this module available when building for debug ramdisk.
107 Debug_ramdisk_available *bool
108
Tao Bao0ba5c942018-08-14 22:20:22 -0700109 // Make this module available when building for recovery.
110 Recovery_available *bool
111
Jiyong Parkad9ce042018-10-31 22:49:57 +0900112 // Whether this module is directly installable to one of the partitions. Default: true.
113 Installable *bool
Yo Chiang3d64d492020-05-27 17:56:39 +0800114
115 // Install symlinks to the installed file.
116 Symlinks []string `android:"arch_variant"`
Jiyong Parkc678ad32018-04-10 13:07:10 +0900117}
118
Inseob Kim27408bf2021-04-06 21:00:17 +0900119type prebuiltSubdirProperties struct {
120 // Optional subdirectory under which this file is installed into, cannot be specified with
121 // relative_install_path, prefer relative_install_path.
122 Sub_dir *string `android:"arch_variant"`
123
124 // Optional subdirectory under which this file is installed into, cannot be specified with
125 // sub_dir.
126 Relative_install_path *string `android:"arch_variant"`
127}
128
Jooyung Han39edb6c2019-11-06 16:53:07 +0900129type PrebuiltEtcModule interface {
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700130 android.Module
Yo Chiangf0e19fe2020-11-18 15:28:42 +0800131
132 // Returns the base install directory, such as "etc", "usr/share".
Jooyung Han0703fd82020-08-26 22:11:53 +0900133 BaseDir() string
Yo Chiangf0e19fe2020-11-18 15:28:42 +0800134
135 // Returns the sub install directory relative to BaseDir().
Jooyung Han39edb6c2019-11-06 16:53:07 +0900136 SubDir() string
Jooyung Han39edb6c2019-11-06 16:53:07 +0900137}
138
Jiyong Park5a8d1be2018-04-25 22:57:34 +0900139type PrebuiltEtc struct {
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700140 android.ModuleBase
Inseob Kim1e27a142021-05-06 11:46:11 +0000141 android.DefaultableModuleBase
Jiyong Parkc678ad32018-04-10 13:07:10 +0900142
Inseob Kim27408bf2021-04-06 21:00:17 +0900143 properties prebuiltEtcProperties
144 subdirProperties prebuiltSubdirProperties
Jiyong Parkc678ad32018-04-10 13:07:10 +0900145
Thiébaud Weksteen00e8b312024-03-18 14:06:00 +1100146 sourceFilePaths android.Paths
147 outputFilePaths android.OutputPaths
Jaewoong Jungc3fcdb42019-02-13 05:50:33 -0800148 // The base install location, e.g. "etc" for prebuilt_etc, "usr/share" for prebuilt_usr_share.
Colin Cross2f634572023-11-13 12:12:06 -0800149 installDirBase string
150 installDirBase64 string
151 installAvoidMultilibConflict bool
Yo Chiangf0e19fe2020-11-18 15:28:42 +0800152 // The base install location when soc_specific property is set to true, e.g. "firmware" for
153 // prebuilt_firmware.
Patrice Arruda057a8b12019-06-03 15:29:27 -0700154 socInstallDirBase string
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700155 installDirPath android.InstallPath
156 additionalDependencies *android.Paths
Colin Crossf17e2b52023-10-30 15:17:25 -0700157
Cole Faustfdec8722024-05-22 11:38:29 -0700158 usedSrcsProperty bool
Nelson Li1fb94b22024-07-09 17:04:52 +0800159 // installInRoot is used to return the value of the InstallInRoot() method. The default value is false.
160 // Currently, only prebuilt_avb can be set to true.
161 installInRoot bool
Cole Faustfdec8722024-05-22 11:38:29 -0700162
Colin Crossf17e2b52023-10-30 15:17:25 -0700163 makeClass string
Jiyong Parkc678ad32018-04-10 13:07:10 +0900164}
165
Inseob Kim1e27a142021-05-06 11:46:11 +0000166type Defaults struct {
167 android.ModuleBase
168 android.DefaultsModuleBase
169}
170
Yifan Hong1b3348d2020-01-21 15:53:22 -0800171func (p *PrebuiltEtc) inRamdisk() bool {
172 return p.ModuleBase.InRamdisk() || p.ModuleBase.InstallInRamdisk()
173}
174
175func (p *PrebuiltEtc) onlyInRamdisk() bool {
176 return p.ModuleBase.InstallInRamdisk()
177}
178
179func (p *PrebuiltEtc) InstallInRamdisk() bool {
180 return p.inRamdisk()
181}
182
Yifan Hong60e0cfb2020-10-21 15:17:56 -0700183func (p *PrebuiltEtc) inVendorRamdisk() bool {
184 return p.ModuleBase.InVendorRamdisk() || p.ModuleBase.InstallInVendorRamdisk()
185}
186
187func (p *PrebuiltEtc) onlyInVendorRamdisk() bool {
188 return p.ModuleBase.InstallInVendorRamdisk()
189}
190
191func (p *PrebuiltEtc) InstallInVendorRamdisk() bool {
192 return p.inVendorRamdisk()
193}
194
Inseob Kim08758f02021-04-08 21:13:22 +0900195func (p *PrebuiltEtc) inDebugRamdisk() bool {
196 return p.ModuleBase.InDebugRamdisk() || p.ModuleBase.InstallInDebugRamdisk()
197}
198
199func (p *PrebuiltEtc) onlyInDebugRamdisk() bool {
200 return p.ModuleBase.InstallInDebugRamdisk()
201}
202
203func (p *PrebuiltEtc) InstallInDebugRamdisk() bool {
204 return p.inDebugRamdisk()
205}
206
Kiyoung Kimae11c232021-07-19 11:38:04 +0900207func (p *PrebuiltEtc) InRecovery() bool {
Colin Cross7228ecd2019-11-18 16:00:16 -0800208 return p.ModuleBase.InRecovery() || p.ModuleBase.InstallInRecovery()
Tao Bao0ba5c942018-08-14 22:20:22 -0700209}
210
211func (p *PrebuiltEtc) onlyInRecovery() bool {
212 return p.ModuleBase.InstallInRecovery()
213}
214
215func (p *PrebuiltEtc) InstallInRecovery() bool {
Kiyoung Kimae11c232021-07-19 11:38:04 +0900216 return p.InRecovery()
Tao Bao0ba5c942018-08-14 22:20:22 -0700217}
218
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700219var _ android.ImageInterface = (*PrebuiltEtc)(nil)
Colin Cross7228ecd2019-11-18 16:00:16 -0800220
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700221func (p *PrebuiltEtc) ImageMutatorBegin(ctx android.BaseModuleContext) {}
Colin Cross7228ecd2019-11-18 16:00:16 -0800222
Jihoon Kang47e91842024-06-19 00:51:16 +0000223func (p *PrebuiltEtc) VendorVariantNeeded(ctx android.BaseModuleContext) bool {
224 return false
225}
226
227func (p *PrebuiltEtc) ProductVariantNeeded(ctx android.BaseModuleContext) bool {
228 return false
229}
230
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700231func (p *PrebuiltEtc) CoreVariantNeeded(ctx android.BaseModuleContext) bool {
Yifan Hong60e0cfb2020-10-21 15:17:56 -0700232 return !p.ModuleBase.InstallInRecovery() && !p.ModuleBase.InstallInRamdisk() &&
Inseob Kim08758f02021-04-08 21:13:22 +0900233 !p.ModuleBase.InstallInVendorRamdisk() && !p.ModuleBase.InstallInDebugRamdisk()
Yifan Hong1b3348d2020-01-21 15:53:22 -0800234}
235
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700236func (p *PrebuiltEtc) RamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
237 return proptools.Bool(p.properties.Ramdisk_available) || p.ModuleBase.InstallInRamdisk()
Colin Cross7228ecd2019-11-18 16:00:16 -0800238}
239
Yifan Hong60e0cfb2020-10-21 15:17:56 -0700240func (p *PrebuiltEtc) VendorRamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
241 return proptools.Bool(p.properties.Vendor_ramdisk_available) || p.ModuleBase.InstallInVendorRamdisk()
242}
243
Inseob Kim08758f02021-04-08 21:13:22 +0900244func (p *PrebuiltEtc) DebugRamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
245 return proptools.Bool(p.properties.Debug_ramdisk_available) || p.ModuleBase.InstallInDebugRamdisk()
246}
247
Nelson Li1fb94b22024-07-09 17:04:52 +0800248func (p *PrebuiltEtc) InstallInRoot() bool {
249 return p.installInRoot
250}
251
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700252func (p *PrebuiltEtc) RecoveryVariantNeeded(ctx android.BaseModuleContext) bool {
253 return proptools.Bool(p.properties.Recovery_available) || p.ModuleBase.InstallInRecovery()
Colin Cross7228ecd2019-11-18 16:00:16 -0800254}
255
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700256func (p *PrebuiltEtc) ExtraImageVariations(ctx android.BaseModuleContext) []string {
Colin Cross7228ecd2019-11-18 16:00:16 -0800257 return nil
258}
259
Jihoon Kang7583e832024-06-13 21:25:45 +0000260func (p *PrebuiltEtc) SetImageVariation(ctx android.BaseModuleContext, variation string) {
Colin Cross7228ecd2019-11-18 16:00:16 -0800261}
262
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700263func (p *PrebuiltEtc) SourceFilePath(ctx android.ModuleContext) android.Path {
Cole Faustfdec8722024-05-22 11:38:29 -0700264 if len(p.properties.Srcs.GetOrDefault(ctx, nil)) > 0 {
Thiébaud Weksteen00e8b312024-03-18 14:06:00 +1100265 panic(fmt.Errorf("SourceFilePath not available on multi-source prebuilt %q", p.Name()))
266 }
Cole Faustfdec8722024-05-22 11:38:29 -0700267 return android.PathForModuleSrc(ctx, p.properties.Src.GetOrDefault(ctx, ""))
Jiyong Park5a8d1be2018-04-25 22:57:34 +0900268}
269
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700270func (p *PrebuiltEtc) InstallDirPath() android.InstallPath {
Jooyung Hana0171822019-07-22 15:48:36 +0900271 return p.installDirPath
272}
273
Jiyong Park5a8d1be2018-04-25 22:57:34 +0900274// This allows other derivative modules (e.g. prebuilt_etc_xml) to perform
275// additional steps (like validating the src) before the file is installed.
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700276func (p *PrebuiltEtc) SetAdditionalDependencies(paths android.Paths) {
Jiyong Park5a8d1be2018-04-25 22:57:34 +0900277 p.additionalDependencies = &paths
278}
279
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700280func (p *PrebuiltEtc) OutputFile() android.OutputPath {
Cole Faustfdec8722024-05-22 11:38:29 -0700281 if p.usedSrcsProperty {
Thiébaud Weksteen00e8b312024-03-18 14:06:00 +1100282 panic(fmt.Errorf("OutputFile not available on multi-source prebuilt %q", p.Name()))
283 }
284 return p.outputFilePaths[0]
Jiyong Parkc43e0ac2018-10-04 20:27:15 +0900285}
286
287func (p *PrebuiltEtc) SubDir() string {
Inseob Kim27408bf2021-04-06 21:00:17 +0900288 if subDir := proptools.String(p.subdirProperties.Sub_dir); subDir != "" {
Liz Kammer0449a632020-06-26 10:12:36 -0700289 return subDir
290 }
Inseob Kim27408bf2021-04-06 21:00:17 +0900291 return proptools.String(p.subdirProperties.Relative_install_path)
Jiyong Parkc43e0ac2018-10-04 20:27:15 +0900292}
293
Jooyung Han0703fd82020-08-26 22:11:53 +0900294func (p *PrebuiltEtc) BaseDir() string {
Jooyung Han8e5685d2020-09-21 11:02:57 +0900295 return p.installDirBase
Jooyung Han0703fd82020-08-26 22:11:53 +0900296}
297
Jiyong Parkad9ce042018-10-31 22:49:57 +0900298func (p *PrebuiltEtc) Installable() bool {
Yo Chiangf0e19fe2020-11-18 15:28:42 +0800299 return p.properties.Installable == nil || proptools.Bool(p.properties.Installable)
Jiyong Parkad9ce042018-10-31 22:49:57 +0900300}
301
Kiyoung Kimae11c232021-07-19 11:38:04 +0900302func (p *PrebuiltEtc) InVendor() bool {
303 return p.ModuleBase.InstallInVendor()
304}
305
Thiébaud Weksteen00e8b312024-03-18 14:06:00 +1100306func (p *PrebuiltEtc) installBaseDir(ctx android.ModuleContext) string {
Yo Chiangf0e19fe2020-11-18 15:28:42 +0800307 // If soc install dir was specified and SOC specific is set, set the installDirPath to the
308 // specified socInstallDirBase.
Jooyung Han8e5685d2020-09-21 11:02:57 +0900309 installBaseDir := p.installDirBase
Colin Crossf17e2b52023-10-30 15:17:25 -0700310 if p.Target().Arch.ArchType.Multilib == "lib64" && p.installDirBase64 != "" {
311 installBaseDir = p.installDirBase64
312 }
Jooyung Han8e5685d2020-09-21 11:02:57 +0900313 if p.SocSpecific() && p.socInstallDirBase != "" {
314 installBaseDir = p.socInstallDirBase
315 }
Colin Cross2f634572023-11-13 12:12:06 -0800316 if p.installAvoidMultilibConflict && !ctx.Host() && ctx.Config().HasMultilibConflict(ctx.Arch().ArchType) {
317 installBaseDir = filepath.Join(installBaseDir, ctx.Arch().ArchType.String())
318 }
Thiébaud Weksteen00e8b312024-03-18 14:06:00 +1100319 return installBaseDir
320}
Colin Cross2f634572023-11-13 12:12:06 -0800321
Thiébaud Weksteen00e8b312024-03-18 14:06:00 +1100322func (p *PrebuiltEtc) GenerateAndroidBuildActions(ctx android.ModuleContext) {
323 var installs []installProperties
Jiyong Parkc43e0ac2018-10-04 20:27:15 +0900324
Cole Faustfdec8722024-05-22 11:38:29 -0700325 srcProperty := p.properties.Src.Get(ctx)
326 srcsProperty := p.properties.Srcs.GetOrDefault(ctx, nil)
327 if srcProperty.IsPresent() && len(srcsProperty) > 0 {
Thiébaud Weksteen00e8b312024-03-18 14:06:00 +1100328 ctx.PropertyErrorf("src", "src is set. Cannot set srcs")
Spandan Das756d3402023-06-05 22:49:50 +0000329 }
Thiébaud Weksteen00e8b312024-03-18 14:06:00 +1100330
331 // Check that `sub_dir` and `relative_install_path` are not set at the same time.
332 if p.subdirProperties.Sub_dir != nil && p.subdirProperties.Relative_install_path != nil {
333 ctx.PropertyErrorf("sub_dir", "relative_install_path is set. Cannot set sub_dir")
334 }
335 p.installDirPath = android.PathForModuleInstall(ctx, p.installBaseDir(ctx), p.SubDir())
336
337 filename := proptools.String(p.properties.Filename)
338 filenameFromSrc := proptools.Bool(p.properties.Filename_from_src)
Cole Faustfdec8722024-05-22 11:38:29 -0700339 if srcProperty.IsPresent() {
340 p.sourceFilePaths = android.PathsForModuleSrc(ctx, []string{srcProperty.Get()})
Thiébaud Weksteen00e8b312024-03-18 14:06:00 +1100341 // If the source was not found, set a fake source path to
342 // support AllowMissingDependencies executions.
343 if len(p.sourceFilePaths) == 0 {
344 p.sourceFilePaths = android.Paths{android.PathForModuleSrc(ctx)}
345 }
346
347 // Determine the output file basename.
348 // If Filename is set, use the name specified by the property.
349 // If Filename_from_src is set, use the source file name.
350 // Otherwise use the module name.
351 if filename != "" {
352 if filenameFromSrc {
353 ctx.PropertyErrorf("filename_from_src", "filename is set. filename_from_src can't be true")
354 return
355 }
356 } else if filenameFromSrc {
357 filename = p.sourceFilePaths[0].Base()
358 } else {
359 filename = ctx.ModuleName()
360 }
361 if strings.Contains(filename, "/") {
362 ctx.PropertyErrorf("filename", "filename cannot contain separator '/'")
363 return
364 }
365 p.outputFilePaths = android.OutputPaths{android.PathForModuleOut(ctx, filename).OutputPath}
366
367 ip := installProperties{
368 filename: filename,
369 sourceFilePath: p.sourceFilePaths[0],
370 outputFilePath: p.outputFilePaths[0],
371 installDirPath: p.installDirPath,
372 symlinks: p.properties.Symlinks,
373 }
374 installs = append(installs, ip)
Cole Faustfdec8722024-05-22 11:38:29 -0700375 } else if len(srcsProperty) > 0 {
376 p.usedSrcsProperty = true
Thiébaud Weksteen00e8b312024-03-18 14:06:00 +1100377 if filename != "" {
378 ctx.PropertyErrorf("filename", "filename cannot be set when using srcs")
379 }
380 if len(p.properties.Symlinks) > 0 {
381 ctx.PropertyErrorf("symlinks", "symlinks cannot be set when using srcs")
382 }
383 if p.properties.Filename_from_src != nil {
384 ctx.PropertyErrorf("filename_from_src", "filename_from_src is implicitly set to true when using srcs")
385 }
Cole Faustfdec8722024-05-22 11:38:29 -0700386 p.sourceFilePaths = android.PathsForModuleSrc(ctx, srcsProperty)
Thiébaud Weksteen00e8b312024-03-18 14:06:00 +1100387 for _, src := range p.sourceFilePaths {
388 filename := src.Base()
389 output := android.PathForModuleOut(ctx, filename).OutputPath
390 ip := installProperties{
391 filename: filename,
392 sourceFilePath: src,
393 outputFilePath: output,
394 installDirPath: p.installDirPath,
395 }
396 p.outputFilePaths = append(p.outputFilePaths, output)
397 installs = append(installs, ip)
398 }
399 } else if ctx.Config().AllowMissingDependencies() {
400 // If no srcs was set and AllowMissingDependencies is enabled then
401 // mark the module as missing dependencies and set a fake source path
402 // and file name.
403 ctx.AddMissingDependencies([]string{"MISSING_PREBUILT_SRC_FILE"})
404 p.sourceFilePaths = android.Paths{android.PathForModuleSrc(ctx)}
405 if filename == "" {
406 filename = ctx.ModuleName()
407 }
408 p.outputFilePaths = android.OutputPaths{android.PathForModuleOut(ctx, filename).OutputPath}
409 ip := installProperties{
410 filename: filename,
411 sourceFilePath: p.sourceFilePaths[0],
412 outputFilePath: p.outputFilePaths[0],
413 installDirPath: p.installDirPath,
414 }
415 installs = append(installs, ip)
416 } else {
417 ctx.PropertyErrorf("src", "missing prebuilt source file")
418 return
419 }
420
421 // Call InstallFile even when uninstallable to make the module included in the package.
422 if !p.Installable() {
423 p.SkipInstall()
424 }
425 for _, ip := range installs {
426 ip.addInstallRules(ctx)
427 }
mrziwang89371762024-06-11 12:42:24 -0700428
429 ctx.SetOutputFiles(p.outputFilePaths.Paths(), "")
Spandan Das756d3402023-06-05 22:49:50 +0000430}
Jiyong Parkf9f68052020-09-29 20:15:08 +0900431
Spandan Das756d3402023-06-05 22:49:50 +0000432type installProperties struct {
Spandan Das756d3402023-06-05 22:49:50 +0000433 filename string
434 sourceFilePath android.Path
Thiébaud Weksteen00e8b312024-03-18 14:06:00 +1100435 outputFilePath android.OutputPath
436 installDirPath android.InstallPath
Spandan Das756d3402023-06-05 22:49:50 +0000437 symlinks []string
438}
439
440// utility function to add install rules to the build graph.
441// Reduces code duplication between Soong and Mixed build analysis
Thiébaud Weksteen00e8b312024-03-18 14:06:00 +1100442func (ip *installProperties) addInstallRules(ctx android.ModuleContext) {
Spandan Das756d3402023-06-05 22:49:50 +0000443 // Copy the file from src to a location in out/ with the correct `filename`
444 // This ensures that outputFilePath has the correct name for others to
445 // use, as the source file may have a different name.
Spandan Das756d3402023-06-05 22:49:50 +0000446 ctx.Build(pctx, android.BuildParams{
447 Rule: android.Cp,
Thiébaud Weksteen00e8b312024-03-18 14:06:00 +1100448 Output: ip.outputFilePath,
Spandan Das756d3402023-06-05 22:49:50 +0000449 Input: ip.sourceFilePath,
450 })
451
Thiébaud Weksteen00e8b312024-03-18 14:06:00 +1100452 installPath := ctx.InstallFile(ip.installDirPath, ip.filename, ip.outputFilePath)
Spandan Das756d3402023-06-05 22:49:50 +0000453 for _, sl := range ip.symlinks {
Thiébaud Weksteen00e8b312024-03-18 14:06:00 +1100454 ctx.InstallSymlink(ip.installDirPath, sl, installPath)
Jiyong Parkf9f68052020-09-29 20:15:08 +0900455 }
Jiyong Parkc678ad32018-04-10 13:07:10 +0900456}
457
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700458func (p *PrebuiltEtc) AndroidMkEntries() []android.AndroidMkEntries {
Jaewoong Jung9aa3ab12019-04-03 15:47:29 -0700459 nameSuffix := ""
Yifan Hong1b3348d2020-01-21 15:53:22 -0800460 if p.inRamdisk() && !p.onlyInRamdisk() {
461 nameSuffix = ".ramdisk"
462 }
Yifan Hong60e0cfb2020-10-21 15:17:56 -0700463 if p.inVendorRamdisk() && !p.onlyInVendorRamdisk() {
464 nameSuffix = ".vendor_ramdisk"
465 }
Inseob Kim08758f02021-04-08 21:13:22 +0900466 if p.inDebugRamdisk() && !p.onlyInDebugRamdisk() {
467 nameSuffix = ".debug_ramdisk"
468 }
Kiyoung Kimae11c232021-07-19 11:38:04 +0900469 if p.InRecovery() && !p.onlyInRecovery() {
Jaewoong Jung9aa3ab12019-04-03 15:47:29 -0700470 nameSuffix = ".recovery"
471 }
Colin Crossf17e2b52023-10-30 15:17:25 -0700472
473 class := p.makeClass
474 if class == "" {
475 class = "ETC"
476 }
477
Thiébaud Weksteen00e8b312024-03-18 14:06:00 +1100478 return []android.AndroidMkEntries{{
Colin Crossf17e2b52023-10-30 15:17:25 -0700479 Class: class,
Jaewoong Jung9aa3ab12019-04-03 15:47:29 -0700480 SubName: nameSuffix,
Thiébaud Weksteen00e8b312024-03-18 14:06:00 +1100481 OutputFile: android.OptionalPathForPath(p.outputFilePaths[0]),
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700482 ExtraEntries: []android.AndroidMkExtraEntriesFunc{
Colin Crossaa255532020-07-03 13:18:24 -0700483 func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) {
Jaewoong Junge0dc8df2019-08-27 17:33:16 -0700484 entries.SetString("LOCAL_MODULE_TAGS", "optional")
Colin Crossc68db4b2021-11-11 18:59:15 -0800485 entries.SetString("LOCAL_MODULE_PATH", p.installDirPath.String())
Thiébaud Weksteen00e8b312024-03-18 14:06:00 +1100486 entries.SetString("LOCAL_INSTALLED_MODULE_STEM", p.outputFilePaths[0].Base())
Yo Chiang3d64d492020-05-27 17:56:39 +0800487 if len(p.properties.Symlinks) > 0 {
488 entries.AddStrings("LOCAL_MODULE_SYMLINKS", p.properties.Symlinks...)
489 }
Yo Chiang803c40d2020-11-16 20:32:51 +0800490 entries.SetBoolIfTrue("LOCAL_UNINSTALLABLE_MODULE", !p.Installable())
Jaewoong Junge0dc8df2019-08-27 17:33:16 -0700491 if p.additionalDependencies != nil {
Yo Chiang803c40d2020-11-16 20:32:51 +0800492 entries.AddStrings("LOCAL_ADDITIONAL_DEPENDENCIES", p.additionalDependencies.Strings()...)
Jiyong Park5a8d1be2018-04-25 22:57:34 +0900493 }
Jaewoong Junge0dc8df2019-08-27 17:33:16 -0700494 },
Jiyong Parkc678ad32018-04-10 13:07:10 +0900495 },
Jiyong Park0b0e1b92019-12-03 13:24:29 +0900496 }}
Jiyong Parkc678ad32018-04-10 13:07:10 +0900497}
498
LaMont Jonesafe7baf2024-01-09 22:47:39 +0000499func (p *PrebuiltEtc) AndroidModuleBase() *android.ModuleBase {
500 return &p.ModuleBase
501}
502
Jooyung Hana0171822019-07-22 15:48:36 +0900503func InitPrebuiltEtcModule(p *PrebuiltEtc, dirBase string) {
504 p.installDirBase = dirBase
Nelson Li1fb94b22024-07-09 17:04:52 +0800505 p.installInRoot = false
Jiyong Park5a8d1be2018-04-25 22:57:34 +0900506 p.AddProperties(&p.properties)
Inseob Kim27408bf2021-04-06 21:00:17 +0900507 p.AddProperties(&p.subdirProperties)
508}
509
510func InitPrebuiltRootModule(p *PrebuiltEtc) {
511 p.installDirBase = "."
Nelson Li1fb94b22024-07-09 17:04:52 +0800512 p.installInRoot = false
513 p.AddProperties(&p.properties)
514}
515
516func InitPrebuiltAvbModule(p *PrebuiltEtc) {
517 p.installDirBase = "avb"
518 p.installInRoot = true
Inseob Kim27408bf2021-04-06 21:00:17 +0900519 p.AddProperties(&p.properties)
Jiyong Park5a8d1be2018-04-25 22:57:34 +0900520}
Jiyong Parkc678ad32018-04-10 13:07:10 +0900521
Patrice Arruda9e14b962019-03-11 15:58:50 -0700522// prebuilt_etc is for a prebuilt artifact that is installed in
523// <partition>/etc/<sub_dir> directory.
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700524func PrebuiltEtcFactory() android.Module {
Jooyung Hana0171822019-07-22 15:48:36 +0900525 module := &PrebuiltEtc{}
526 InitPrebuiltEtcModule(module, "etc")
Jiyong Park5a8d1be2018-04-25 22:57:34 +0900527 // This module is device-only
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700528 android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
Inseob Kim1e27a142021-05-06 11:46:11 +0000529 android.InitDefaultableModule(module)
530 return module
531}
532
533func defaultsFactory() android.Module {
534 return DefaultsFactory()
535}
536
537func DefaultsFactory(props ...interface{}) android.Module {
538 module := &Defaults{}
539
540 module.AddProperties(props...)
541 module.AddProperties(
542 &prebuiltEtcProperties{},
543 &prebuiltSubdirProperties{},
544 )
545
546 android.InitDefaultsModule(module)
547
Jiyong Parkc678ad32018-04-10 13:07:10 +0900548 return module
549}
Tao Bao0ba5c942018-08-14 22:20:22 -0700550
Patrice Arruda9e14b962019-03-11 15:58:50 -0700551// prebuilt_etc_host is for a host prebuilt artifact that is installed in
552// $(HOST_OUT)/etc/<sub_dir> directory.
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700553func PrebuiltEtcHostFactory() android.Module {
Jooyung Hana0171822019-07-22 15:48:36 +0900554 module := &PrebuiltEtc{}
555 InitPrebuiltEtcModule(module, "etc")
Jaewoong Jung24788182019-02-04 14:34:10 -0800556 // This module is host-only
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700557 android.InitAndroidArchModule(module, android.HostSupported, android.MultilibCommon)
Martin Stjernholmdc6525e2021-10-14 00:42:59 +0100558 android.InitDefaultableModule(module)
Jaewoong Jung24788182019-02-04 14:34:10 -0800559 return module
560}
561
Miguel32b02802022-12-01 18:38:26 +0000562// prebuilt_etc_host is for a host prebuilt artifact that is installed in
563// <partition>/etc/<sub_dir> directory.
564func PrebuiltEtcCaCertsFactory() android.Module {
565 module := &PrebuiltEtc{}
566 InitPrebuiltEtcModule(module, "cacerts")
567 // This module is device-only
568 android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
Miguel32b02802022-12-01 18:38:26 +0000569 return module
570}
571
Nelson Li1fb94b22024-07-09 17:04:52 +0800572// Generally, a <partition> directory will contain a `system` subdirectory, but the <partition> of
573// `prebuilt_avb` will not have a `system` subdirectory.
574// Ultimately, prebuilt_avb will install the prebuilt artifact to the `avb` subdirectory under the
575// root directory of the partition: <partition_root>/avb.
576// prebuilt_avb does not allow adding any other subdirectories.
577func PrebuiltAvbFactory() android.Module {
578 module := &PrebuiltEtc{}
579 InitPrebuiltAvbModule(module)
580 // This module is device-only
581 android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
582 android.InitDefaultableModule(module)
583 return module
584}
585
Inseob Kim27408bf2021-04-06 21:00:17 +0900586// prebuilt_root is for a prebuilt artifact that is installed in
587// <partition>/ directory. Can't have any sub directories.
588func PrebuiltRootFactory() android.Module {
589 module := &PrebuiltEtc{}
590 InitPrebuiltRootModule(module)
591 // This module is device-only
592 android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
Martin Stjernholmdc6525e2021-10-14 00:42:59 +0100593 android.InitDefaultableModule(module)
Inseob Kim27408bf2021-04-06 21:00:17 +0900594 return module
595}
596
Liz Kammere9ecddc2022-01-04 17:27:52 -0500597// prebuilt_root_host is for a host prebuilt artifact that is installed in $(HOST_OUT)/<sub_dir>
598// directory.
599func PrebuiltRootHostFactory() android.Module {
600 module := &PrebuiltEtc{}
601 InitPrebuiltEtcModule(module, ".")
602 // This module is host-only
603 android.InitAndroidArchModule(module, android.HostSupported, android.MultilibCommon)
604 android.InitDefaultableModule(module)
605 return module
606}
607
Patrice Arruda9e14b962019-03-11 15:58:50 -0700608// prebuilt_usr_share is for a prebuilt artifact that is installed in
609// <partition>/usr/share/<sub_dir> directory.
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700610func PrebuiltUserShareFactory() android.Module {
Jooyung Hana0171822019-07-22 15:48:36 +0900611 module := &PrebuiltEtc{}
612 InitPrebuiltEtcModule(module, "usr/share")
Jaewoong Jungc3fcdb42019-02-13 05:50:33 -0800613 // This module is device-only
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700614 android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
Martin Stjernholmdc6525e2021-10-14 00:42:59 +0100615 android.InitDefaultableModule(module)
Jaewoong Jungc3fcdb42019-02-13 05:50:33 -0800616 return module
617}
618
Patrice Arruda9e14b962019-03-11 15:58:50 -0700619// prebuild_usr_share_host is for a host prebuilt artifact that is installed in
620// $(HOST_OUT)/usr/share/<sub_dir> directory.
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700621func PrebuiltUserShareHostFactory() android.Module {
Jooyung Hana0171822019-07-22 15:48:36 +0900622 module := &PrebuiltEtc{}
623 InitPrebuiltEtcModule(module, "usr/share")
Patrice Arruda300cef92019-02-22 15:47:57 -0800624 // This module is host-only
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700625 android.InitAndroidArchModule(module, android.HostSupported, android.MultilibCommon)
Martin Stjernholmdc6525e2021-10-14 00:42:59 +0100626 android.InitDefaultableModule(module)
Patrice Arruda300cef92019-02-22 15:47:57 -0800627 return module
628}
629
yangbill63c5e192024-03-27 09:02:12 +0000630// prebuilt_usr_hyphendata is for a prebuilt artifact that is installed in
631// <partition>/usr/hyphen-data/<sub_dir> directory.
632func PrebuiltUserHyphenDataFactory() android.Module {
633 module := &PrebuiltEtc{}
634 InitPrebuiltEtcModule(module, "usr/hyphen-data")
635 // This module is device-only
636 android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
637 android.InitDefaultableModule(module)
638 return module
639}
640
yangbill85527e62024-04-30 08:24:50 +0000641// prebuilt_usr_keylayout is for a prebuilt artifact that is installed in
642// <partition>/usr/keylayout/<sub_dir> directory.
643func PrebuiltUserKeyLayoutFactory() android.Module {
644 module := &PrebuiltEtc{}
645 InitPrebuiltEtcModule(module, "usr/keylayout")
646 // This module is device-only
647 android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
648 android.InitDefaultableModule(module)
649 return module
650}
651
652// prebuilt_usr_keychars is for a prebuilt artifact that is installed in
653// <partition>/usr/keychars/<sub_dir> directory.
654func PrebuiltUserKeyCharsFactory() android.Module {
655 module := &PrebuiltEtc{}
656 InitPrebuiltEtcModule(module, "usr/keychars")
657 // This module is device-only
658 android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
659 android.InitDefaultableModule(module)
660 return module
661}
662
663// prebuilt_usr_idc is for a prebuilt artifact that is installed in
664// <partition>/usr/idc/<sub_dir> directory.
665func PrebuiltUserIdcFactory() android.Module {
666 module := &PrebuiltEtc{}
667 InitPrebuiltEtcModule(module, "usr/idc")
668 // This module is device-only
669 android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
670 android.InitDefaultableModule(module)
671 return module
672}
673
Patrice Arruda61583eb2019-05-14 08:20:45 -0700674// prebuilt_font installs a font in <partition>/fonts directory.
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700675func PrebuiltFontFactory() android.Module {
Jooyung Hana0171822019-07-22 15:48:36 +0900676 module := &PrebuiltEtc{}
677 InitPrebuiltEtcModule(module, "fonts")
Patrice Arruda61583eb2019-05-14 08:20:45 -0700678 // This module is device-only
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700679 android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
Martin Stjernholmdc6525e2021-10-14 00:42:59 +0100680 android.InitDefaultableModule(module)
Patrice Arruda61583eb2019-05-14 08:20:45 -0700681 return module
682}
Patrice Arruda057a8b12019-06-03 15:29:27 -0700683
Kevin93f7cd82024-05-02 12:37:59 +0200684// prebuilt_overlay is for a prebuilt artifact in <partition>/overlay directory.
685func PrebuiltOverlayFactory() android.Module {
686 module := &PrebuiltEtc{}
687 InitPrebuiltEtcModule(module, "overlay")
688 // This module is device-only
689 android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
690 return module
691}
692
Yo Chiangf0e19fe2020-11-18 15:28:42 +0800693// prebuilt_firmware installs a firmware file to <partition>/etc/firmware directory for system
694// image.
695// If soc_specific property is set to true, the firmware file is installed to the
696// vendor <partition>/firmware directory for vendor image.
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700697func PrebuiltFirmwareFactory() android.Module {
Jooyung Hana0171822019-07-22 15:48:36 +0900698 module := &PrebuiltEtc{}
699 module.socInstallDirBase = "firmware"
700 InitPrebuiltEtcModule(module, "etc/firmware")
Patrice Arruda057a8b12019-06-03 15:29:27 -0700701 // This module is device-only
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700702 android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
Martin Stjernholmdc6525e2021-10-14 00:42:59 +0100703 android.InitDefaultableModule(module)
Patrice Arruda057a8b12019-06-03 15:29:27 -0700704 return module
705}
Patrice Arruda0f688002020-06-08 21:40:25 +0000706
707// prebuilt_dsp installs a DSP related file to <partition>/etc/dsp directory for system image.
Yo Chiangf0e19fe2020-11-18 15:28:42 +0800708// If soc_specific property is set to true, the DSP related file is installed to the
709// vendor <partition>/dsp directory for vendor image.
Patrice Arruda0f688002020-06-08 21:40:25 +0000710func PrebuiltDSPFactory() android.Module {
711 module := &PrebuiltEtc{}
712 module.socInstallDirBase = "dsp"
713 InitPrebuiltEtcModule(module, "etc/dsp")
714 // This module is device-only
715 android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
Martin Stjernholmdc6525e2021-10-14 00:42:59 +0100716 android.InitDefaultableModule(module)
Patrice Arruda0f688002020-06-08 21:40:25 +0000717 return module
718}
Colin Cross83ebf232021-04-09 09:41:23 -0700719
Colin Crossf17e2b52023-10-30 15:17:25 -0700720// prebuilt_renderscript_bitcode installs a *.bc file into /system/lib or /system/lib64.
721func PrebuiltRenderScriptBitcodeFactory() android.Module {
722 module := &PrebuiltEtc{}
723 module.makeClass = "RENDERSCRIPT_BITCODE"
724 module.installDirBase64 = "lib64"
Colin Cross2f634572023-11-13 12:12:06 -0800725 module.installAvoidMultilibConflict = true
Colin Crossf17e2b52023-10-30 15:17:25 -0700726 InitPrebuiltEtcModule(module, "lib")
727 // This module is device-only
728 android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibBoth)
729 android.InitDefaultableModule(module)
730 return module
731}
732
Colin Cross83ebf232021-04-09 09:41:23 -0700733// prebuilt_rfsa installs a firmware file that will be available through Qualcomm's RFSA
734// to the <partition>/lib/rfsa directory.
735func PrebuiltRFSAFactory() android.Module {
736 module := &PrebuiltEtc{}
737 // Ideally these would go in /vendor/dsp, but the /vendor/lib/rfsa paths are hardcoded in too
738 // many places outside of the application processor. They could be moved to /vendor/dsp once
739 // that is cleaned up.
740 InitPrebuiltEtcModule(module, "lib/rfsa")
741 // This module is device-only
742 android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
Martin Stjernholmdc6525e2021-10-14 00:42:59 +0100743 android.InitDefaultableModule(module)
Colin Cross83ebf232021-04-09 09:41:23 -0700744 return module
745}