blob: 00babc3346fd3a5dbbbb63eec0ddf1337ea8eaef [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",
54 ],
Jooyung Handc413662021-02-04 18:18:28 +090055 export_shared_lib_headers: [
56 "libbinder",
57 ],
Dan Willemsen4c939742016-12-06 15:44:57 -080058
Risand57852c2018-11-02 04:51:14 +090059 product_variables: {
60 arc: {
61 exclude_srcs: [
62 "QuotaUtils.cpp",
63 ],
64 static_libs: [
65 "libarcdiskquota",
66 "arc_services_aidl",
67 ],
68 cflags: [
69 "-DUSE_ARC",
70 ],
71 },
72 },
73
Dan Willemsen4c939742016-12-06 15:44:57 -080074 clang: true,
Jeff Sharkeyc1149c92017-09-21 14:51:09 -060075
76 tidy: true,
77 tidy_checks: [
78 "-*",
79 "clang-analyzer-security*",
80 "cert-*",
81 "-cert-err58-cpp",
82 ],
83 tidy_flags: [
Keun young Parkb7342262021-10-25 08:09:27 -070084 "-warnings-as-errors=clang-analyzer-security*,cert-*",
Jeff Sharkeyc1149c92017-09-21 14:51:09 -060085 ],
Dan Willemsen4c939742016-12-06 15:44:57 -080086}
87
88//
89// Static library used in testing and executable
90//
91
92cc_library_static {
93 name: "libinstalld",
94 defaults: ["installd_defaults"],
95
96 export_include_dirs: ["."],
97 aidl: {
98 export_aidl_headers: true,
99 },
Risand57852c2018-11-02 04:51:14 +0900100
101 product_variables: {
102 arc: {
103 exclude_srcs: [
104 "QuotaUtils.cpp",
105 ],
106 static_libs: [
107 "libarcdiskquota",
108 "arc_services_aidl",
109 ],
110 cflags: [
111 "-DUSE_ARC",
112 ],
113 },
114 },
115}
116
117cc_library_headers {
118 name: "libinstalld_headers",
119 export_include_dirs: ["."],
Dan Willemsen4c939742016-12-06 15:44:57 -0800120}
121
122//
Victor Hsiehc9821f12020-08-07 11:32:29 -0700123// Unit tests
124//
125
126cc_test_host {
127 name: "run_dex2oat_test",
128 test_suites: ["general-tests"],
129 clang: true,
130 srcs: [
131 "run_dex2oat_test.cpp",
132 "run_dex2oat.cpp",
Victor Hsiehcb35a062020-08-13 16:11:13 -0700133 "unique_file.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700134 "execv_helper.cpp",
135 ],
Keun young Parkb7342262021-10-25 08:09:27 -0700136 cflags: [
137 "-Wall",
138 "-Werror",
139 ],
Victor Hsiehc9821f12020-08-07 11:32:29 -0700140 shared_libs: [
141 "libbase",
142 "server_configurable_flags",
143 ],
Victor Hsiehc9821f12020-08-07 11:32:29 -0700144 test_config: "run_dex2oat_test.xml",
145}
146
147//
Dan Willemsen4c939742016-12-06 15:44:57 -0800148// Executable
149//
150
151cc_binary {
152 name: "installd",
153 defaults: ["installd_defaults"],
154 srcs: ["installd.cpp"],
155
156 static_libs: ["libdiskusage"],
157
158 init_rc: ["installd.rc"],
Risand57852c2018-11-02 04:51:14 +0900159
160 product_variables: {
161 arc: {
162 exclude_srcs: [
163 "QuotaUtils.cpp",
164 ],
165 static_libs: [
166 "libarcdiskquota",
167 "arc_services_aidl",
168 ],
169 cflags: [
170 "-DUSE_ARC",
171 ],
172 },
173 },
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100174
175 // Needs to be wherever installd is as it's execed by
176 // installd.
Keun young Parkb7342262021-10-25 08:09:27 -0700177 required: ["migrate_legacy_obb_data.sh"],
Dan Willemsen4c939742016-12-06 15:44:57 -0800178}
179
Dan Willemsen2a001e82016-08-05 14:06:41 -0700180// OTA chroot tool
181
182cc_binary {
183 name: "otapreopt_chroot",
Martijn Coenen8af07d92019-07-03 14:56:39 +0200184 defaults: ["libapexd-deps"],
Dan Willemsen2a001e82016-08-05 14:06:41 -0700185 cflags: [
186 "-Wall",
187 "-Werror",
188 ],
189 clang: true,
190
Roland Levillain94b41802019-01-18 11:56:50 +0000191 srcs: [
192 "otapreopt_chroot.cpp",
193 "otapreopt_utils.cpp",
194 ],
Dan Willemsen2a001e82016-08-05 14:06:41 -0700195 shared_libs: [
196 "libbase",
197 "liblog",
Martijn Coenen13eba262019-03-13 12:59:57 +0100198 "libutils",
Roland Levillainc19c6042018-12-18 12:15:12 +0000199 ],
Alex Light2ca8b862021-03-09 16:39:55 -0800200 required: [
Keun young Parkb7342262021-10-25 08:09:27 -0700201 "apexd",
Dan Willemsen2a001e82016-08-05 14:06:41 -0700202 ],
203}
Dan Willemsen4c939742016-12-06 15:44:57 -0800204
Colin Crossdd2dae92017-11-14 13:05:37 -0800205filegroup {
206 name: "installd_aidl",
207 srcs: [
Jeff Sharkey8d3848b2020-08-13 14:16:46 -0600208 "binder/**/*.aidl",
Colin Crossdd2dae92017-11-14 13:05:37 -0800209 ],
Dan Willemsena5d65222018-09-14 21:27:01 -0700210 path: "binder",
Colin Crossdd2dae92017-11-14 13:05:37 -0800211}
212
Calin Juravledff47292018-02-01 14:44:56 +0000213//
214// Static library for otapreopt used in testing
215//
216cc_library_static {
217 name: "libotapreoptparameters",
218 cflags: [
219 "-Wall",
Keun young Parkb7342262021-10-25 08:09:27 -0700220 "-Werror",
Calin Juravledff47292018-02-01 14:44:56 +0000221 ],
Calin Juravledff47292018-02-01 14:44:56 +0000222
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700223 srcs: ["otapreopt_parameters.cpp"],
Calin Juravledff47292018-02-01 14:44:56 +0000224
225 export_include_dirs: ["."],
226
227 shared_libs: [
228 "libbase",
229 "libcutils",
230 "liblog",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700231 "libprocessgroup",
Calin Juravledff47292018-02-01 14:44:56 +0000232 "libutils",
233 ],
234}
235
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700236//
237// OTA Executable
238//
239
240cc_binary {
241 name: "otapreopt",
242 cflags: [
243 "-Wall",
Keun young Parkb7342262021-10-25 08:09:27 -0700244 "-Werror",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700245 ],
246
247 srcs: [
248 "dexopt.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700249 "execv_helper.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700250 "globals.cpp",
251 "otapreopt.cpp",
Roland Levillain94b41802019-01-18 11:56:50 +0000252 "otapreopt_utils.cpp",
Keun young Parkb7342262021-10-25 08:09:27 -0700253 "restorable_file.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700254 "run_dex2oat.cpp",
Victor Hsiehcb35a062020-08-13 16:11:13 -0700255 "unique_file.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700256 "utils.cpp",
Oleksandr Peletskyid2be6322019-01-24 17:59:45 +0100257 "utils_default.cpp",
Eric Holk0ebbe0f2019-01-09 18:17:27 -0800258 "view_compiler.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700259 ],
260
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700261 static_libs: [
Martijn Coenen6de402a2021-04-26 16:23:40 +0200262 "libasync_safe",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700263 "libdiskusage",
264 "libotapreoptparameters",
265 ],
266
267 shared_libs: [
268 "libbase",
269 "libcrypto",
270 "libcutils",
271 "liblog",
272 "liblogwrap",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700273 "libprocessgroup",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700274 "libselinux",
275 "libutils",
Yang Tianping8f2a40e2021-10-29 14:39:02 +0800276 "libziparchive",
Nicolas Geoffrayaaad21e2019-02-25 13:31:10 +0000277 "server_configurable_flags",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700278 ],
279}
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800280
281// OTA slot script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800282sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800283 name: "otapreopt_slot",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800284 src: "otapreopt_slot.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800285 init_rc: ["otapreopt.rc"],
286}
287
288// OTA postinstall script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800289sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800290 name: "otapreopt_script",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800291 src: "otapreopt_script.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800292 // Let this depend on otapreopt, the chroot tool and the slot script,
293 // so we just have to mention one in a configuration.
294 required: [
295 "otapreopt",
296 "otapreopt_chroot",
297 "otapreopt_slot",
298 ],
299}
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100300
301// Script to migrate legacy obb data.
302sh_binary {
303 name: "migrate_legacy_obb_data.sh",
Keun young Parkb7342262021-10-25 08:09:27 -0700304 src: "migrate_legacy_obb_data.sh",
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100305}