blob: bf5e893a99fb644472e8f42ac0afed26b9cdd701 [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
13 cflags: [
14 "-Wall",
15 "-Werror",
Jeff Sharkeyc1149c92017-09-21 14:51:09 -060016 "-Wextra",
Andreas Gampefa2dadd2018-02-28 19:52:47 -080017
18 "-Wunreachable-code",
19 "-Wunreachable-code-break",
20 "-Wunreachable-code-return",
Dan Willemsen4c939742016-12-06 15:44:57 -080021 ],
22 srcs: [
Jeff Sharkey88ddd942017-01-17 18:05:54 -070023 "CacheItem.cpp",
24 "CacheTracker.cpp",
Felka Chang2a0a2462019-11-20 14:20:40 +080025 "CrateManager.cpp",
Jeff Sharkeyf3e30b92016-12-09 17:06:57 -070026 "InstalldNativeService.cpp",
Risan5f308262018-10-26 12:06:58 -060027 "QuotaUtils.cpp",
Jeff Sharkey6c2c0562016-12-07 12:12:00 -070028 "dexopt.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -070029 "execv_helper.cpp",
Dan Willemsen4c939742016-12-06 15:44:57 -080030 "globals.cpp",
Keun young Parkb7342262021-10-25 08:09:27 -070031 "restorable_file.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -070032 "run_dex2oat.cpp",
Victor Hsiehcb35a062020-08-13 16:11:13 -070033 "unique_file.cpp",
Dan Willemsen4c939742016-12-06 15:44:57 -080034 "utils.cpp",
Oleksandr Peletskyid2be6322019-01-24 17:59:45 +010035 "utils_default.cpp",
Eric Holk0ebbe0f2019-01-09 18:17:27 -080036 "view_compiler.cpp",
Colin Crossdd2dae92017-11-14 13:05:37 -080037 ":installd_aidl",
Dan Willemsen4c939742016-12-06 15:44:57 -080038 ],
39 shared_libs: [
40 "libbase",
41 "libbinder",
Alan Stokesa25d90c2017-10-16 10:56:00 +010042 "libcrypto",
Dan Willemsen4c939742016-12-06 15:44:57 -080043 "libcutils",
44 "liblog",
45 "liblogwrap",
Suren Baghdasaryancd829052018-11-02 19:15:37 -070046 "libprocessgroup",
Dan Willemsen4c939742016-12-06 15:44:57 -080047 "libselinux",
48 "libutils",
Yang Tianping8f2a40e2021-10-29 14:39:02 +080049 "libziparchive",
Nicolas Geoffrayaaad21e2019-02-25 13:31:10 +000050 "server_configurable_flags",
Dan Willemsen4c939742016-12-06 15:44:57 -080051 ],
Martijn Coenen6de402a2021-04-26 16:23:40 +020052 static_libs: [
53 "libasync_safe",
Alex Buynytskyy4ab5d532022-02-17 21:20:10 +000054 "libext2_uuid",
Martijn Coenen6de402a2021-04-26 16:23:40 +020055 ],
Jooyung Handc413662021-02-04 18:18:28 +090056 export_shared_lib_headers: [
57 "libbinder",
58 ],
Dan Willemsen4c939742016-12-06 15:44:57 -080059
Risand57852c2018-11-02 04:51:14 +090060 product_variables: {
61 arc: {
62 exclude_srcs: [
63 "QuotaUtils.cpp",
64 ],
65 static_libs: [
66 "libarcdiskquota",
67 "arc_services_aidl",
68 ],
69 cflags: [
70 "-DUSE_ARC",
71 ],
72 },
73 },
74
Dan Willemsen4c939742016-12-06 15:44:57 -080075 clang: true,
Jeff Sharkeyc1149c92017-09-21 14:51:09 -060076
77 tidy: true,
78 tidy_checks: [
79 "-*",
80 "clang-analyzer-security*",
81 "cert-*",
82 "-cert-err58-cpp",
83 ],
Chih-Hung Hsieh8c18eb42022-04-27 16:00:44 -070084 tidy_checks_as_errors: [
85 "clang-analyzer-security*",
86 "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",
244 cflags: [
245 "-Wall",
Keun young Parkb7342262021-10-25 08:09:27 -0700246 "-Werror",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700247 ],
248
249 srcs: [
250 "dexopt.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700251 "execv_helper.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700252 "globals.cpp",
253 "otapreopt.cpp",
Roland Levillain94b41802019-01-18 11:56:50 +0000254 "otapreopt_utils.cpp",
Keun young Parkb7342262021-10-25 08:09:27 -0700255 "restorable_file.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700256 "run_dex2oat.cpp",
Victor Hsiehcb35a062020-08-13 16:11:13 -0700257 "unique_file.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700258 "utils.cpp",
Oleksandr Peletskyid2be6322019-01-24 17:59:45 +0100259 "utils_default.cpp",
Eric Holk0ebbe0f2019-01-09 18:17:27 -0800260 "view_compiler.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700261 ],
262
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700263 static_libs: [
Martijn Coenen6de402a2021-04-26 16:23:40 +0200264 "libasync_safe",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700265 "libdiskusage",
266 "libotapreoptparameters",
Alex Buynytskyy4ab5d532022-02-17 21:20:10 +0000267 "libext2_uuid",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700268 ],
269
270 shared_libs: [
271 "libbase",
272 "libcrypto",
273 "libcutils",
274 "liblog",
275 "liblogwrap",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700276 "libprocessgroup",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700277 "libselinux",
278 "libutils",
Yang Tianping8f2a40e2021-10-29 14:39:02 +0800279 "libziparchive",
Nicolas Geoffrayaaad21e2019-02-25 13:31:10 +0000280 "server_configurable_flags",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700281 ],
282}
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800283
284// OTA slot script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800285sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800286 name: "otapreopt_slot",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800287 src: "otapreopt_slot.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800288 init_rc: ["otapreopt.rc"],
289}
290
291// OTA postinstall script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800292sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800293 name: "otapreopt_script",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800294 src: "otapreopt_script.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800295 // Let this depend on otapreopt, the chroot tool and the slot script,
296 // so we just have to mention one in a configuration.
297 required: [
298 "otapreopt",
299 "otapreopt_chroot",
300 "otapreopt_slot",
301 ],
302}
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100303
304// Script to migrate legacy obb data.
305sh_binary {
306 name: "migrate_legacy_obb_data.sh",
Keun young Parkb7342262021-10-25 08:09:27 -0700307 src: "migrate_legacy_obb_data.sh",
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100308}