blob: fd38ddfc57b478414e7e416d22dbd7a207831f5e [file] [log] [blame]
Bob Badour3306e492021-02-25 15:35:37 -08001package {
2 // See: http://go/android-license-faq
3 // A large-scale-change added 'default_applicable_licenses' to import
4 // all of the 'license_kinds' from "frameworks_native_license"
5 // to get the below license kinds:
6 // SPDX-license-identifier-Apache-2.0
7 default_applicable_licenses: ["frameworks_native_license"],
8}
9
Dan Willemsen4c939742016-12-06 15:44:57 -080010cc_defaults {
11 name: "installd_defaults",
12
Alex Buynytskyy038a19b2022-02-09 19:51:52 -080013 cpp_std: "c++2a",
Dan Willemsen4c939742016-12-06 15:44:57 -080014 cflags: [
15 "-Wall",
16 "-Werror",
Jeff Sharkeyc1149c92017-09-21 14:51:09 -060017 "-Wextra",
Andreas Gampefa2dadd2018-02-28 19:52:47 -080018
19 "-Wunreachable-code",
20 "-Wunreachable-code-break",
21 "-Wunreachable-code-return",
Dan Willemsen4c939742016-12-06 15:44:57 -080022 ],
23 srcs: [
Jeff Sharkey88ddd942017-01-17 18:05:54 -070024 "CacheItem.cpp",
25 "CacheTracker.cpp",
Felka Chang2a0a2462019-11-20 14:20:40 +080026 "CrateManager.cpp",
Jeff Sharkeyf3e30b92016-12-09 17:06:57 -070027 "InstalldNativeService.cpp",
Risan5f308262018-10-26 12:06:58 -060028 "QuotaUtils.cpp",
Jeff Sharkey6c2c0562016-12-07 12:12:00 -070029 "dexopt.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -070030 "execv_helper.cpp",
Dan Willemsen4c939742016-12-06 15:44:57 -080031 "globals.cpp",
Keun young Parkb7342262021-10-25 08:09:27 -070032 "restorable_file.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -070033 "run_dex2oat.cpp",
Victor Hsiehcb35a062020-08-13 16:11:13 -070034 "unique_file.cpp",
Dan Willemsen4c939742016-12-06 15:44:57 -080035 "utils.cpp",
Oleksandr Peletskyid2be6322019-01-24 17:59:45 +010036 "utils_default.cpp",
Eric Holk0ebbe0f2019-01-09 18:17:27 -080037 "view_compiler.cpp",
Colin Crossdd2dae92017-11-14 13:05:37 -080038 ":installd_aidl",
Dan Willemsen4c939742016-12-06 15:44:57 -080039 ],
40 shared_libs: [
41 "libbase",
42 "libbinder",
Alan Stokesa25d90c2017-10-16 10:56:00 +010043 "libcrypto",
Dan Willemsen4c939742016-12-06 15:44:57 -080044 "libcutils",
Alex Buynytskyy038a19b2022-02-09 19:51:52 -080045 "libext2_uuid",
Dan Willemsen4c939742016-12-06 15:44:57 -080046 "liblog",
47 "liblogwrap",
Suren Baghdasaryancd829052018-11-02 19:15:37 -070048 "libprocessgroup",
Dan Willemsen4c939742016-12-06 15:44:57 -080049 "libselinux",
50 "libutils",
Yang Tianping8f2a40e2021-10-29 14:39:02 +080051 "libziparchive",
Nicolas Geoffrayaaad21e2019-02-25 13:31:10 +000052 "server_configurable_flags",
Dan Willemsen4c939742016-12-06 15:44:57 -080053 ],
Martijn Coenen6de402a2021-04-26 16:23:40 +020054 static_libs: [
55 "libasync_safe",
56 ],
Jooyung Handc413662021-02-04 18:18:28 +090057 export_shared_lib_headers: [
58 "libbinder",
59 ],
Dan Willemsen4c939742016-12-06 15:44:57 -080060
Risand57852c2018-11-02 04:51:14 +090061 product_variables: {
62 arc: {
63 exclude_srcs: [
64 "QuotaUtils.cpp",
65 ],
66 static_libs: [
67 "libarcdiskquota",
68 "arc_services_aidl",
69 ],
70 cflags: [
71 "-DUSE_ARC",
72 ],
73 },
74 },
75
Dan Willemsen4c939742016-12-06 15:44:57 -080076 clang: true,
Jeff Sharkeyc1149c92017-09-21 14:51:09 -060077
78 tidy: true,
79 tidy_checks: [
80 "-*",
81 "clang-analyzer-security*",
82 "cert-*",
83 "-cert-err58-cpp",
84 ],
85 tidy_flags: [
Keun young Parkb7342262021-10-25 08:09:27 -070086 "-warnings-as-errors=clang-analyzer-security*,cert-*",
Jeff Sharkeyc1149c92017-09-21 14:51:09 -060087 ],
Dan Willemsen4c939742016-12-06 15:44:57 -080088}
89
90//
91// Static library used in testing and executable
92//
93
94cc_library_static {
95 name: "libinstalld",
96 defaults: ["installd_defaults"],
97
98 export_include_dirs: ["."],
99 aidl: {
100 export_aidl_headers: true,
101 },
Risand57852c2018-11-02 04:51:14 +0900102
103 product_variables: {
104 arc: {
105 exclude_srcs: [
106 "QuotaUtils.cpp",
107 ],
108 static_libs: [
109 "libarcdiskquota",
110 "arc_services_aidl",
111 ],
112 cflags: [
113 "-DUSE_ARC",
114 ],
115 },
116 },
117}
118
119cc_library_headers {
120 name: "libinstalld_headers",
121 export_include_dirs: ["."],
Dan Willemsen4c939742016-12-06 15:44:57 -0800122}
123
124//
Victor Hsiehc9821f12020-08-07 11:32:29 -0700125// Unit tests
126//
127
128cc_test_host {
129 name: "run_dex2oat_test",
130 test_suites: ["general-tests"],
131 clang: true,
132 srcs: [
133 "run_dex2oat_test.cpp",
134 "run_dex2oat.cpp",
Victor Hsiehcb35a062020-08-13 16:11:13 -0700135 "unique_file.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700136 "execv_helper.cpp",
137 ],
Keun young Parkb7342262021-10-25 08:09:27 -0700138 cflags: [
139 "-Wall",
140 "-Werror",
141 ],
Victor Hsiehc9821f12020-08-07 11:32:29 -0700142 shared_libs: [
143 "libbase",
144 "server_configurable_flags",
145 ],
Victor Hsiehc9821f12020-08-07 11:32:29 -0700146 test_config: "run_dex2oat_test.xml",
147}
148
149//
Dan Willemsen4c939742016-12-06 15:44:57 -0800150// Executable
151//
152
153cc_binary {
154 name: "installd",
155 defaults: ["installd_defaults"],
156 srcs: ["installd.cpp"],
157
158 static_libs: ["libdiskusage"],
159
160 init_rc: ["installd.rc"],
Risand57852c2018-11-02 04:51:14 +0900161
162 product_variables: {
163 arc: {
164 exclude_srcs: [
165 "QuotaUtils.cpp",
166 ],
167 static_libs: [
168 "libarcdiskquota",
169 "arc_services_aidl",
170 ],
171 cflags: [
172 "-DUSE_ARC",
173 ],
174 },
175 },
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100176
177 // Needs to be wherever installd is as it's execed by
178 // installd.
Keun young Parkb7342262021-10-25 08:09:27 -0700179 required: ["migrate_legacy_obb_data.sh"],
Dan Willemsen4c939742016-12-06 15:44:57 -0800180}
181
Dan Willemsen2a001e82016-08-05 14:06:41 -0700182// OTA chroot tool
183
184cc_binary {
185 name: "otapreopt_chroot",
Martijn Coenen8af07d92019-07-03 14:56:39 +0200186 defaults: ["libapexd-deps"],
Dan Willemsen2a001e82016-08-05 14:06:41 -0700187 cflags: [
188 "-Wall",
189 "-Werror",
190 ],
191 clang: true,
192
Roland Levillain94b41802019-01-18 11:56:50 +0000193 srcs: [
194 "otapreopt_chroot.cpp",
195 "otapreopt_utils.cpp",
196 ],
Dan Willemsen2a001e82016-08-05 14:06:41 -0700197 shared_libs: [
198 "libbase",
199 "liblog",
Martijn Coenen13eba262019-03-13 12:59:57 +0100200 "libutils",
Roland Levillainc19c6042018-12-18 12:15:12 +0000201 ],
Alex Light2ca8b862021-03-09 16:39:55 -0800202 required: [
Keun young Parkb7342262021-10-25 08:09:27 -0700203 "apexd",
Dan Willemsen2a001e82016-08-05 14:06:41 -0700204 ],
205}
Dan Willemsen4c939742016-12-06 15:44:57 -0800206
Colin Crossdd2dae92017-11-14 13:05:37 -0800207filegroup {
208 name: "installd_aidl",
209 srcs: [
Jeff Sharkey8d3848b2020-08-13 14:16:46 -0600210 "binder/**/*.aidl",
Colin Crossdd2dae92017-11-14 13:05:37 -0800211 ],
Dan Willemsena5d65222018-09-14 21:27:01 -0700212 path: "binder",
Colin Crossdd2dae92017-11-14 13:05:37 -0800213}
214
Calin Juravledff47292018-02-01 14:44:56 +0000215//
216// Static library for otapreopt used in testing
217//
218cc_library_static {
219 name: "libotapreoptparameters",
220 cflags: [
221 "-Wall",
Keun young Parkb7342262021-10-25 08:09:27 -0700222 "-Werror",
Calin Juravledff47292018-02-01 14:44:56 +0000223 ],
Calin Juravledff47292018-02-01 14:44:56 +0000224
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700225 srcs: ["otapreopt_parameters.cpp"],
Calin Juravledff47292018-02-01 14:44:56 +0000226
227 export_include_dirs: ["."],
228
229 shared_libs: [
230 "libbase",
231 "libcutils",
232 "liblog",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700233 "libprocessgroup",
Calin Juravledff47292018-02-01 14:44:56 +0000234 "libutils",
235 ],
236}
237
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700238//
239// OTA Executable
240//
241
242cc_binary {
243 name: "otapreopt",
Alex Buynytskyy038a19b2022-02-09 19:51:52 -0800244
245 cpp_std: "c++2a",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700246 cflags: [
247 "-Wall",
Keun young Parkb7342262021-10-25 08:09:27 -0700248 "-Werror",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700249 ],
250
251 srcs: [
252 "dexopt.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700253 "execv_helper.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700254 "globals.cpp",
255 "otapreopt.cpp",
Roland Levillain94b41802019-01-18 11:56:50 +0000256 "otapreopt_utils.cpp",
Keun young Parkb7342262021-10-25 08:09:27 -0700257 "restorable_file.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700258 "run_dex2oat.cpp",
Victor Hsiehcb35a062020-08-13 16:11:13 -0700259 "unique_file.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700260 "utils.cpp",
Oleksandr Peletskyid2be6322019-01-24 17:59:45 +0100261 "utils_default.cpp",
Eric Holk0ebbe0f2019-01-09 18:17:27 -0800262 "view_compiler.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700263 ],
264
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700265 static_libs: [
Martijn Coenen6de402a2021-04-26 16:23:40 +0200266 "libasync_safe",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700267 "libdiskusage",
268 "libotapreoptparameters",
269 ],
270
271 shared_libs: [
272 "libbase",
273 "libcrypto",
274 "libcutils",
Alex Buynytskyy038a19b2022-02-09 19:51:52 -0800275 "libext2_uuid",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700276 "liblog",
277 "liblogwrap",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700278 "libprocessgroup",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700279 "libselinux",
280 "libutils",
Yang Tianping8f2a40e2021-10-29 14:39:02 +0800281 "libziparchive",
Nicolas Geoffrayaaad21e2019-02-25 13:31:10 +0000282 "server_configurable_flags",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700283 ],
284}
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800285
286// OTA slot script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800287sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800288 name: "otapreopt_slot",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800289 src: "otapreopt_slot.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800290 init_rc: ["otapreopt.rc"],
291}
292
293// OTA postinstall script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800294sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800295 name: "otapreopt_script",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800296 src: "otapreopt_script.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800297 // Let this depend on otapreopt, the chroot tool and the slot script,
298 // so we just have to mention one in a configuration.
299 required: [
300 "otapreopt",
301 "otapreopt_chroot",
302 "otapreopt_slot",
303 ],
304}
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100305
306// Script to migrate legacy obb data.
307sh_binary {
308 name: "migrate_legacy_obb_data.sh",
Keun young Parkb7342262021-10-25 08:09:27 -0700309 src: "migrate_legacy_obb_data.sh",
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100310}