| Jiyong Park | c678ad3 | 2018-04-10 13:07:10 +0900 | [diff] [blame] | 1 | // 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 |  | 
|  | 15 | package android | 
|  | 16 |  | 
| Jaewoong Jung | 9aa3ab1 | 2019-04-03 15:47:29 -0700 | [diff] [blame] | 17 | import "strconv" | 
| Jiyong Park | c678ad3 | 2018-04-10 13:07:10 +0900 | [diff] [blame] | 18 |  | 
| Jaewoong Jung | c3fcdb4 | 2019-02-13 05:50:33 -0800 | [diff] [blame] | 19 | // TODO(jungw): Now that it handles more than the ones in etc/, consider renaming this file. | 
| Jiyong Park | c678ad3 | 2018-04-10 13:07:10 +0900 | [diff] [blame] | 20 |  | 
|  | 21 | func init() { | 
|  | 22 | RegisterModuleType("prebuilt_etc", PrebuiltEtcFactory) | 
| Jaewoong Jung | 4b44fcd | 2019-02-07 08:28:03 -0800 | [diff] [blame] | 23 | RegisterModuleType("prebuilt_etc_host", PrebuiltEtcHostFactory) | 
| Jaewoong Jung | c3fcdb4 | 2019-02-13 05:50:33 -0800 | [diff] [blame] | 24 | RegisterModuleType("prebuilt_usr_share", PrebuiltUserShareFactory) | 
| Patrice Arruda | 300cef9 | 2019-02-22 15:47:57 -0800 | [diff] [blame] | 25 | RegisterModuleType("prebuilt_usr_share_host", PrebuiltUserShareHostFactory) | 
| Patrice Arruda | 61583eb | 2019-05-14 08:20:45 -0700 | [diff] [blame] | 26 | RegisterModuleType("prebuilt_font", PrebuiltFontFactory) | 
| Patrice Arruda | 057a8b1 | 2019-06-03 15:29:27 -0700 | [diff] [blame] | 27 | RegisterModuleType("prebuilt_firmware", PrebuiltFirmwareFactory) | 
| Jiyong Park | c678ad3 | 2018-04-10 13:07:10 +0900 | [diff] [blame] | 28 | } | 
|  | 29 |  | 
|  | 30 | type prebuiltEtcProperties struct { | 
|  | 31 | // Source file of this prebuilt. | 
| Colin Cross | 27b922f | 2019-03-04 22:35:41 -0800 | [diff] [blame] | 32 | Src *string `android:"path,arch_variant"` | 
| Jiyong Park | c678ad3 | 2018-04-10 13:07:10 +0900 | [diff] [blame] | 33 |  | 
|  | 34 | // optional subdirectory under which this file is installed into | 
|  | 35 | Sub_dir *string `android:"arch_variant"` | 
| Tao Bao | 0ba5c94 | 2018-08-14 22:20:22 -0700 | [diff] [blame] | 36 |  | 
| Jiyong Park | 139a2e6 | 2018-10-26 21:49:39 +0900 | [diff] [blame] | 37 | // optional name for the installed file. If unspecified, name of the module is used as the file name | 
|  | 38 | Filename *string `android:"arch_variant"` | 
|  | 39 |  | 
| Jiyong Park | 1a7cf08 | 2018-11-13 11:59:12 +0900 | [diff] [blame] | 40 | // when set to true, and filename property is not set, the name for the installed file | 
|  | 41 | // is the same as the file name of the source file. | 
|  | 42 | Filename_from_src *bool `android:"arch_variant"` | 
|  | 43 |  | 
| Yifan Hong | 1b3348d | 2020-01-21 15:53:22 -0800 | [diff] [blame] | 44 | // Make this module available when building for ramdisk. | 
|  | 45 | Ramdisk_available *bool | 
|  | 46 |  | 
| Tao Bao | 0ba5c94 | 2018-08-14 22:20:22 -0700 | [diff] [blame] | 47 | // Make this module available when building for recovery. | 
|  | 48 | Recovery_available *bool | 
|  | 49 |  | 
| Jiyong Park | ad9ce04 | 2018-10-31 22:49:57 +0900 | [diff] [blame] | 50 | // Whether this module is directly installable to one of the partitions. Default: true. | 
|  | 51 | Installable *bool | 
| Yo Chiang | 3d64d49 | 2020-05-27 17:56:39 +0800 | [diff] [blame^] | 52 |  | 
|  | 53 | // Install symlinks to the installed file. | 
|  | 54 | Symlinks []string `android:"arch_variant"` | 
| Jiyong Park | c678ad3 | 2018-04-10 13:07:10 +0900 | [diff] [blame] | 55 | } | 
|  | 56 |  | 
| Jooyung Han | 39edb6c | 2019-11-06 16:53:07 +0900 | [diff] [blame] | 57 | type PrebuiltEtcModule interface { | 
|  | 58 | Module | 
|  | 59 | SubDir() string | 
|  | 60 | OutputFile() OutputPath | 
|  | 61 | } | 
|  | 62 |  | 
| Jiyong Park | 5a8d1be | 2018-04-25 22:57:34 +0900 | [diff] [blame] | 63 | type PrebuiltEtc struct { | 
| Jiyong Park | c678ad3 | 2018-04-10 13:07:10 +0900 | [diff] [blame] | 64 | ModuleBase | 
| Jiyong Park | c678ad3 | 2018-04-10 13:07:10 +0900 | [diff] [blame] | 65 |  | 
|  | 66 | properties prebuiltEtcProperties | 
|  | 67 |  | 
| Jaewoong Jung | c3fcdb4 | 2019-02-13 05:50:33 -0800 | [diff] [blame] | 68 | sourceFilePath Path | 
|  | 69 | outputFilePath OutputPath | 
|  | 70 | // The base install location, e.g. "etc" for prebuilt_etc, "usr/share" for prebuilt_usr_share. | 
| Patrice Arruda | 057a8b1 | 2019-06-03 15:29:27 -0700 | [diff] [blame] | 71 | installDirBase string | 
|  | 72 | // The base install location when soc_specific property is set to true, e.g. "firmware" for prebuilt_firmware. | 
|  | 73 | socInstallDirBase      string | 
| Colin Cross | 70dda7e | 2019-10-01 22:05:35 -0700 | [diff] [blame] | 74 | installDirPath         InstallPath | 
| Jiyong Park | 5a8d1be | 2018-04-25 22:57:34 +0900 | [diff] [blame] | 75 | additionalDependencies *Paths | 
| Jiyong Park | c678ad3 | 2018-04-10 13:07:10 +0900 | [diff] [blame] | 76 | } | 
|  | 77 |  | 
| Yifan Hong | 1b3348d | 2020-01-21 15:53:22 -0800 | [diff] [blame] | 78 | func (p *PrebuiltEtc) inRamdisk() bool { | 
|  | 79 | return p.ModuleBase.InRamdisk() || p.ModuleBase.InstallInRamdisk() | 
|  | 80 | } | 
|  | 81 |  | 
|  | 82 | func (p *PrebuiltEtc) onlyInRamdisk() bool { | 
|  | 83 | return p.ModuleBase.InstallInRamdisk() | 
|  | 84 | } | 
|  | 85 |  | 
|  | 86 | func (p *PrebuiltEtc) InstallInRamdisk() bool { | 
|  | 87 | return p.inRamdisk() | 
|  | 88 | } | 
|  | 89 |  | 
| Tao Bao | 0ba5c94 | 2018-08-14 22:20:22 -0700 | [diff] [blame] | 90 | func (p *PrebuiltEtc) inRecovery() bool { | 
| Colin Cross | 7228ecd | 2019-11-18 16:00:16 -0800 | [diff] [blame] | 91 | return p.ModuleBase.InRecovery() || p.ModuleBase.InstallInRecovery() | 
| Tao Bao | 0ba5c94 | 2018-08-14 22:20:22 -0700 | [diff] [blame] | 92 | } | 
|  | 93 |  | 
|  | 94 | func (p *PrebuiltEtc) onlyInRecovery() bool { | 
|  | 95 | return p.ModuleBase.InstallInRecovery() | 
|  | 96 | } | 
|  | 97 |  | 
|  | 98 | func (p *PrebuiltEtc) InstallInRecovery() bool { | 
|  | 99 | return p.inRecovery() | 
|  | 100 | } | 
|  | 101 |  | 
| Colin Cross | 7228ecd | 2019-11-18 16:00:16 -0800 | [diff] [blame] | 102 | var _ ImageInterface = (*PrebuiltEtc)(nil) | 
|  | 103 |  | 
|  | 104 | func (p *PrebuiltEtc) ImageMutatorBegin(ctx BaseModuleContext) {} | 
|  | 105 |  | 
|  | 106 | func (p *PrebuiltEtc) CoreVariantNeeded(ctx BaseModuleContext) bool { | 
| Yifan Hong | 1b3348d | 2020-01-21 15:53:22 -0800 | [diff] [blame] | 107 | return !p.ModuleBase.InstallInRecovery() && !p.ModuleBase.InstallInRamdisk() | 
|  | 108 | } | 
|  | 109 |  | 
|  | 110 | func (p *PrebuiltEtc) RamdiskVariantNeeded(ctx BaseModuleContext) bool { | 
|  | 111 | return Bool(p.properties.Ramdisk_available) || p.ModuleBase.InstallInRamdisk() | 
| Colin Cross | 7228ecd | 2019-11-18 16:00:16 -0800 | [diff] [blame] | 112 | } | 
|  | 113 |  | 
|  | 114 | func (p *PrebuiltEtc) RecoveryVariantNeeded(ctx BaseModuleContext) bool { | 
|  | 115 | return Bool(p.properties.Recovery_available) || p.ModuleBase.InstallInRecovery() | 
|  | 116 | } | 
|  | 117 |  | 
|  | 118 | func (p *PrebuiltEtc) ExtraImageVariations(ctx BaseModuleContext) []string { | 
|  | 119 | return nil | 
|  | 120 | } | 
|  | 121 |  | 
|  | 122 | func (p *PrebuiltEtc) SetImageVariation(ctx BaseModuleContext, variation string, module Module) { | 
|  | 123 | } | 
|  | 124 |  | 
| Jiyong Park | 5a8d1be | 2018-04-25 22:57:34 +0900 | [diff] [blame] | 125 | func (p *PrebuiltEtc) DepsMutator(ctx BottomUpMutatorContext) { | 
|  | 126 | if p.properties.Src == nil { | 
|  | 127 | ctx.PropertyErrorf("src", "missing prebuilt source file") | 
| Jiyong Park | c678ad3 | 2018-04-10 13:07:10 +0900 | [diff] [blame] | 128 | } | 
| Jiyong Park | c678ad3 | 2018-04-10 13:07:10 +0900 | [diff] [blame] | 129 | } | 
|  | 130 |  | 
| Jiyong Park | 5a8d1be | 2018-04-25 22:57:34 +0900 | [diff] [blame] | 131 | func (p *PrebuiltEtc) SourceFilePath(ctx ModuleContext) Path { | 
| Colin Cross | 8a49795 | 2019-03-05 22:25:09 -0800 | [diff] [blame] | 132 | return PathForModuleSrc(ctx, String(p.properties.Src)) | 
| Jiyong Park | 5a8d1be | 2018-04-25 22:57:34 +0900 | [diff] [blame] | 133 | } | 
|  | 134 |  | 
| Colin Cross | 70dda7e | 2019-10-01 22:05:35 -0700 | [diff] [blame] | 135 | func (p *PrebuiltEtc) InstallDirPath() InstallPath { | 
| Jooyung Han | a017182 | 2019-07-22 15:48:36 +0900 | [diff] [blame] | 136 | return p.installDirPath | 
|  | 137 | } | 
|  | 138 |  | 
| Jiyong Park | 5a8d1be | 2018-04-25 22:57:34 +0900 | [diff] [blame] | 139 | // This allows other derivative modules (e.g. prebuilt_etc_xml) to perform | 
|  | 140 | // additional steps (like validating the src) before the file is installed. | 
|  | 141 | func (p *PrebuiltEtc) SetAdditionalDependencies(paths Paths) { | 
|  | 142 | p.additionalDependencies = &paths | 
|  | 143 | } | 
|  | 144 |  | 
| Jiyong Park | c43e0ac | 2018-10-04 20:27:15 +0900 | [diff] [blame] | 145 | func (p *PrebuiltEtc) OutputFile() OutputPath { | 
|  | 146 | return p.outputFilePath | 
|  | 147 | } | 
|  | 148 |  | 
|  | 149 | func (p *PrebuiltEtc) SubDir() string { | 
|  | 150 | return String(p.properties.Sub_dir) | 
|  | 151 | } | 
|  | 152 |  | 
| Jiyong Park | ad9ce04 | 2018-10-31 22:49:57 +0900 | [diff] [blame] | 153 | func (p *PrebuiltEtc) Installable() bool { | 
|  | 154 | return p.properties.Installable == nil || Bool(p.properties.Installable) | 
|  | 155 | } | 
|  | 156 |  | 
| Jiyong Park | 5a8d1be | 2018-04-25 22:57:34 +0900 | [diff] [blame] | 157 | func (p *PrebuiltEtc) GenerateAndroidBuildActions(ctx ModuleContext) { | 
| Colin Cross | 8a49795 | 2019-03-05 22:25:09 -0800 | [diff] [blame] | 158 | p.sourceFilePath = PathForModuleSrc(ctx, String(p.properties.Src)) | 
| Jiyong Park | 139a2e6 | 2018-10-26 21:49:39 +0900 | [diff] [blame] | 159 | filename := String(p.properties.Filename) | 
| Jiyong Park | 1a7cf08 | 2018-11-13 11:59:12 +0900 | [diff] [blame] | 160 | filename_from_src := Bool(p.properties.Filename_from_src) | 
| Jiyong Park | 139a2e6 | 2018-10-26 21:49:39 +0900 | [diff] [blame] | 161 | if filename == "" { | 
| Jiyong Park | 1a7cf08 | 2018-11-13 11:59:12 +0900 | [diff] [blame] | 162 | if filename_from_src { | 
|  | 163 | filename = p.sourceFilePath.Base() | 
|  | 164 | } else { | 
|  | 165 | filename = ctx.ModuleName() | 
|  | 166 | } | 
|  | 167 | } else if filename_from_src { | 
|  | 168 | ctx.PropertyErrorf("filename_from_src", "filename is set. filename_from_src can't be true") | 
|  | 169 | return | 
| Jiyong Park | 139a2e6 | 2018-10-26 21:49:39 +0900 | [diff] [blame] | 170 | } | 
|  | 171 | p.outputFilePath = PathForModuleOut(ctx, filename).OutputPath | 
| Patrice Arruda | 057a8b1 | 2019-06-03 15:29:27 -0700 | [diff] [blame] | 172 |  | 
|  | 173 | // If soc install dir was specified and SOC specific is set, set the installDirPath to the specified | 
|  | 174 | // socInstallDirBase. | 
|  | 175 | installBaseDir := p.installDirBase | 
|  | 176 | if ctx.SocSpecific() && p.socInstallDirBase != "" { | 
|  | 177 | installBaseDir = p.socInstallDirBase | 
|  | 178 | } | 
|  | 179 | p.installDirPath = PathForModuleInstall(ctx, installBaseDir, String(p.properties.Sub_dir)) | 
| Jiyong Park | c43e0ac | 2018-10-04 20:27:15 +0900 | [diff] [blame] | 180 |  | 
| Dan Willemsen | b055267 | 2019-01-25 16:04:11 -0800 | [diff] [blame] | 181 | // This ensures that outputFilePath has the correct name for others to | 
|  | 182 | // use, as the source file may have a different name. | 
| Jiyong Park | c43e0ac | 2018-10-04 20:27:15 +0900 | [diff] [blame] | 183 | ctx.Build(pctx, BuildParams{ | 
|  | 184 | Rule:   Cp, | 
|  | 185 | Output: p.outputFilePath, | 
|  | 186 | Input:  p.sourceFilePath, | 
|  | 187 | }) | 
| Jiyong Park | c678ad3 | 2018-04-10 13:07:10 +0900 | [diff] [blame] | 188 | } | 
|  | 189 |  | 
| Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 190 | func (p *PrebuiltEtc) AndroidMkEntries() []AndroidMkEntries { | 
| Jaewoong Jung | 9aa3ab1 | 2019-04-03 15:47:29 -0700 | [diff] [blame] | 191 | nameSuffix := "" | 
| Yifan Hong | 1b3348d | 2020-01-21 15:53:22 -0800 | [diff] [blame] | 192 | if p.inRamdisk() && !p.onlyInRamdisk() { | 
|  | 193 | nameSuffix = ".ramdisk" | 
|  | 194 | } | 
| Jaewoong Jung | 9aa3ab1 | 2019-04-03 15:47:29 -0700 | [diff] [blame] | 195 | if p.inRecovery() && !p.onlyInRecovery() { | 
|  | 196 | nameSuffix = ".recovery" | 
|  | 197 | } | 
| Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 198 | return []AndroidMkEntries{AndroidMkEntries{ | 
| Jaewoong Jung | 9aa3ab1 | 2019-04-03 15:47:29 -0700 | [diff] [blame] | 199 | Class:      "ETC", | 
|  | 200 | SubName:    nameSuffix, | 
|  | 201 | OutputFile: OptionalPathForPath(p.outputFilePath), | 
| Jaewoong Jung | e0dc8df | 2019-08-27 17:33:16 -0700 | [diff] [blame] | 202 | ExtraEntries: []AndroidMkExtraEntriesFunc{ | 
|  | 203 | func(entries *AndroidMkEntries) { | 
|  | 204 | entries.SetString("LOCAL_MODULE_TAGS", "optional") | 
| Colin Cross | ff6c33d | 2019-10-02 16:01:35 -0700 | [diff] [blame] | 205 | entries.SetString("LOCAL_MODULE_PATH", p.installDirPath.ToMakePath().String()) | 
| Jaewoong Jung | e0dc8df | 2019-08-27 17:33:16 -0700 | [diff] [blame] | 206 | entries.SetString("LOCAL_INSTALLED_MODULE_STEM", p.outputFilePath.Base()) | 
| Yo Chiang | 3d64d49 | 2020-05-27 17:56:39 +0800 | [diff] [blame^] | 207 | if len(p.properties.Symlinks) > 0 { | 
|  | 208 | entries.AddStrings("LOCAL_MODULE_SYMLINKS", p.properties.Symlinks...) | 
|  | 209 | } | 
| Jaewoong Jung | e0dc8df | 2019-08-27 17:33:16 -0700 | [diff] [blame] | 210 | entries.SetString("LOCAL_UNINSTALLABLE_MODULE", strconv.FormatBool(!p.Installable())) | 
|  | 211 | if p.additionalDependencies != nil { | 
|  | 212 | for _, path := range *p.additionalDependencies { | 
| Yo Chiang | 3d64d49 | 2020-05-27 17:56:39 +0800 | [diff] [blame^] | 213 | entries.AddStrings("LOCAL_ADDITIONAL_DEPENDENCIES", path.String()) | 
| Jaewoong Jung | e0dc8df | 2019-08-27 17:33:16 -0700 | [diff] [blame] | 214 | } | 
| Jiyong Park | 5a8d1be | 2018-04-25 22:57:34 +0900 | [diff] [blame] | 215 | } | 
| Jaewoong Jung | e0dc8df | 2019-08-27 17:33:16 -0700 | [diff] [blame] | 216 | }, | 
| Jiyong Park | c678ad3 | 2018-04-10 13:07:10 +0900 | [diff] [blame] | 217 | }, | 
| Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 218 | }} | 
| Jiyong Park | c678ad3 | 2018-04-10 13:07:10 +0900 | [diff] [blame] | 219 | } | 
|  | 220 |  | 
| Jooyung Han | a017182 | 2019-07-22 15:48:36 +0900 | [diff] [blame] | 221 | func InitPrebuiltEtcModule(p *PrebuiltEtc, dirBase string) { | 
|  | 222 | p.installDirBase = dirBase | 
| Jiyong Park | 5a8d1be | 2018-04-25 22:57:34 +0900 | [diff] [blame] | 223 | p.AddProperties(&p.properties) | 
|  | 224 | } | 
| Jiyong Park | c678ad3 | 2018-04-10 13:07:10 +0900 | [diff] [blame] | 225 |  | 
| Patrice Arruda | 9e14b96 | 2019-03-11 15:58:50 -0700 | [diff] [blame] | 226 | // prebuilt_etc is for a prebuilt artifact that is installed in | 
|  | 227 | // <partition>/etc/<sub_dir> directory. | 
| Jiyong Park | 5a8d1be | 2018-04-25 22:57:34 +0900 | [diff] [blame] | 228 | func PrebuiltEtcFactory() Module { | 
| Jooyung Han | a017182 | 2019-07-22 15:48:36 +0900 | [diff] [blame] | 229 | module := &PrebuiltEtc{} | 
|  | 230 | InitPrebuiltEtcModule(module, "etc") | 
| Jiyong Park | 5a8d1be | 2018-04-25 22:57:34 +0900 | [diff] [blame] | 231 | // This module is device-only | 
| Jaewoong Jung | b9a1151 | 2019-01-15 10:47:05 -0800 | [diff] [blame] | 232 | InitAndroidArchModule(module, DeviceSupported, MultilibFirst) | 
| Jiyong Park | c678ad3 | 2018-04-10 13:07:10 +0900 | [diff] [blame] | 233 | return module | 
|  | 234 | } | 
| Tao Bao | 0ba5c94 | 2018-08-14 22:20:22 -0700 | [diff] [blame] | 235 |  | 
| Patrice Arruda | 9e14b96 | 2019-03-11 15:58:50 -0700 | [diff] [blame] | 236 | // prebuilt_etc_host is for a host prebuilt artifact that is installed in | 
|  | 237 | // $(HOST_OUT)/etc/<sub_dir> directory. | 
| Jaewoong Jung | 4b44fcd | 2019-02-07 08:28:03 -0800 | [diff] [blame] | 238 | func PrebuiltEtcHostFactory() Module { | 
| Jooyung Han | a017182 | 2019-07-22 15:48:36 +0900 | [diff] [blame] | 239 | module := &PrebuiltEtc{} | 
|  | 240 | InitPrebuiltEtcModule(module, "etc") | 
| Jaewoong Jung | 2478818 | 2019-02-04 14:34:10 -0800 | [diff] [blame] | 241 | // This module is host-only | 
|  | 242 | InitAndroidArchModule(module, HostSupported, MultilibCommon) | 
|  | 243 | return module | 
|  | 244 | } | 
|  | 245 |  | 
| Patrice Arruda | 9e14b96 | 2019-03-11 15:58:50 -0700 | [diff] [blame] | 246 | // prebuilt_usr_share is for a prebuilt artifact that is installed in | 
|  | 247 | // <partition>/usr/share/<sub_dir> directory. | 
| Jaewoong Jung | c3fcdb4 | 2019-02-13 05:50:33 -0800 | [diff] [blame] | 248 | func PrebuiltUserShareFactory() Module { | 
| Jooyung Han | a017182 | 2019-07-22 15:48:36 +0900 | [diff] [blame] | 249 | module := &PrebuiltEtc{} | 
|  | 250 | InitPrebuiltEtcModule(module, "usr/share") | 
| Jaewoong Jung | c3fcdb4 | 2019-02-13 05:50:33 -0800 | [diff] [blame] | 251 | // This module is device-only | 
|  | 252 | InitAndroidArchModule(module, DeviceSupported, MultilibFirst) | 
|  | 253 | return module | 
|  | 254 | } | 
|  | 255 |  | 
| Patrice Arruda | 9e14b96 | 2019-03-11 15:58:50 -0700 | [diff] [blame] | 256 | // prebuild_usr_share_host is for a host prebuilt artifact that is installed in | 
|  | 257 | // $(HOST_OUT)/usr/share/<sub_dir> directory. | 
| Patrice Arruda | 300cef9 | 2019-02-22 15:47:57 -0800 | [diff] [blame] | 258 | func PrebuiltUserShareHostFactory() Module { | 
| Jooyung Han | a017182 | 2019-07-22 15:48:36 +0900 | [diff] [blame] | 259 | module := &PrebuiltEtc{} | 
|  | 260 | InitPrebuiltEtcModule(module, "usr/share") | 
| Patrice Arruda | 300cef9 | 2019-02-22 15:47:57 -0800 | [diff] [blame] | 261 | // This module is host-only | 
|  | 262 | InitAndroidArchModule(module, HostSupported, MultilibCommon) | 
|  | 263 | return module | 
|  | 264 | } | 
|  | 265 |  | 
| Patrice Arruda | 61583eb | 2019-05-14 08:20:45 -0700 | [diff] [blame] | 266 | // prebuilt_font installs a font in <partition>/fonts directory. | 
|  | 267 | func PrebuiltFontFactory() Module { | 
| Jooyung Han | a017182 | 2019-07-22 15:48:36 +0900 | [diff] [blame] | 268 | module := &PrebuiltEtc{} | 
|  | 269 | InitPrebuiltEtcModule(module, "fonts") | 
| Patrice Arruda | 61583eb | 2019-05-14 08:20:45 -0700 | [diff] [blame] | 270 | // This module is device-only | 
|  | 271 | InitAndroidArchModule(module, DeviceSupported, MultilibFirst) | 
|  | 272 | return module | 
|  | 273 | } | 
| Patrice Arruda | 057a8b1 | 2019-06-03 15:29:27 -0700 | [diff] [blame] | 274 |  | 
|  | 275 | // prebuilt_firmware installs a firmware file to <partition>/etc/firmware directory for system image. | 
|  | 276 | // If soc_specific property is set to true, the firmware file is installed to the vendor <partition>/firmware | 
|  | 277 | // directory for vendor image. | 
|  | 278 | func PrebuiltFirmwareFactory() Module { | 
| Jooyung Han | a017182 | 2019-07-22 15:48:36 +0900 | [diff] [blame] | 279 | module := &PrebuiltEtc{} | 
|  | 280 | module.socInstallDirBase = "firmware" | 
|  | 281 | InitPrebuiltEtcModule(module, "etc/firmware") | 
| Patrice Arruda | 057a8b1 | 2019-06-03 15:29:27 -0700 | [diff] [blame] | 282 | // This module is device-only | 
|  | 283 | InitAndroidArchModule(module, DeviceSupported, MultilibFirst) | 
|  | 284 | return module | 
|  | 285 | } |