blob: 3f180d94a798758ec3e0651c7467b0fac19acd8d [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",
Victor Hsiehc9821f12020-08-07 11:32:29 -070031 "run_dex2oat.cpp",
Victor Hsiehcb35a062020-08-13 16:11:13 -070032 "unique_file.cpp",
Dan Willemsen4c939742016-12-06 15:44:57 -080033 "utils.cpp",
Oleksandr Peletskyid2be6322019-01-24 17:59:45 +010034 "utils_default.cpp",
Eric Holk0ebbe0f2019-01-09 18:17:27 -080035 "view_compiler.cpp",
Colin Crossdd2dae92017-11-14 13:05:37 -080036 ":installd_aidl",
Dan Willemsen4c939742016-12-06 15:44:57 -080037 ],
38 shared_libs: [
39 "libbase",
40 "libbinder",
Alan Stokesa25d90c2017-10-16 10:56:00 +010041 "libcrypto",
Dan Willemsen4c939742016-12-06 15:44:57 -080042 "libcutils",
43 "liblog",
44 "liblogwrap",
Suren Baghdasaryancd829052018-11-02 19:15:37 -070045 "libprocessgroup",
Dan Willemsen4c939742016-12-06 15:44:57 -080046 "libselinux",
47 "libutils",
Nicolas Geoffrayaaad21e2019-02-25 13:31:10 +000048 "server_configurable_flags",
Dan Willemsen4c939742016-12-06 15:44:57 -080049 ],
Martijn Coenen6de402a2021-04-26 16:23:40 +020050 static_libs: [
51 "libasync_safe",
52 ],
Jooyung Handc413662021-02-04 18:18:28 +090053 export_shared_lib_headers: [
54 "libbinder",
55 ],
Dan Willemsen4c939742016-12-06 15:44:57 -080056
Risand57852c2018-11-02 04:51:14 +090057 product_variables: {
58 arc: {
59 exclude_srcs: [
60 "QuotaUtils.cpp",
61 ],
62 static_libs: [
63 "libarcdiskquota",
64 "arc_services_aidl",
65 ],
66 cflags: [
67 "-DUSE_ARC",
68 ],
69 },
70 },
71
Dan Willemsen4c939742016-12-06 15:44:57 -080072 clang: true,
Jeff Sharkeyc1149c92017-09-21 14:51:09 -060073
74 tidy: true,
75 tidy_checks: [
76 "-*",
77 "clang-analyzer-security*",
78 "cert-*",
79 "-cert-err58-cpp",
80 ],
81 tidy_flags: [
82 "-warnings-as-errors=clang-analyzer-security*,cert-*"
83 ],
Dan Willemsen4c939742016-12-06 15:44:57 -080084}
85
86//
87// Static library used in testing and executable
88//
89
90cc_library_static {
91 name: "libinstalld",
92 defaults: ["installd_defaults"],
93
94 export_include_dirs: ["."],
95 aidl: {
96 export_aidl_headers: true,
97 },
Risand57852c2018-11-02 04:51:14 +090098
99 product_variables: {
100 arc: {
101 exclude_srcs: [
102 "QuotaUtils.cpp",
103 ],
104 static_libs: [
105 "libarcdiskquota",
106 "arc_services_aidl",
107 ],
108 cflags: [
109 "-DUSE_ARC",
110 ],
111 },
112 },
113}
114
115cc_library_headers {
116 name: "libinstalld_headers",
117 export_include_dirs: ["."],
Dan Willemsen4c939742016-12-06 15:44:57 -0800118}
119
120//
Victor Hsiehc9821f12020-08-07 11:32:29 -0700121// Unit tests
122//
123
124cc_test_host {
125 name: "run_dex2oat_test",
126 test_suites: ["general-tests"],
127 clang: true,
128 srcs: [
129 "run_dex2oat_test.cpp",
130 "run_dex2oat.cpp",
Victor Hsiehcb35a062020-08-13 16:11:13 -0700131 "unique_file.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700132 "execv_helper.cpp",
133 ],
134 cflags: ["-Wall", "-Werror"],
135 shared_libs: [
136 "libbase",
137 "server_configurable_flags",
138 ],
Victor Hsiehc9821f12020-08-07 11:32:29 -0700139 test_config: "run_dex2oat_test.xml",
140}
141
142//
Dan Willemsen4c939742016-12-06 15:44:57 -0800143// Executable
144//
145
146cc_binary {
147 name: "installd",
148 defaults: ["installd_defaults"],
149 srcs: ["installd.cpp"],
150
151 static_libs: ["libdiskusage"],
152
153 init_rc: ["installd.rc"],
Risand57852c2018-11-02 04:51:14 +0900154
155 product_variables: {
156 arc: {
157 exclude_srcs: [
158 "QuotaUtils.cpp",
159 ],
160 static_libs: [
161 "libarcdiskquota",
162 "arc_services_aidl",
163 ],
164 cflags: [
165 "-DUSE_ARC",
166 ],
167 },
168 },
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100169
170 // Needs to be wherever installd is as it's execed by
171 // installd.
172 required: [ "migrate_legacy_obb_data.sh" ],
Dan Willemsen4c939742016-12-06 15:44:57 -0800173}
174
Dan Willemsen2a001e82016-08-05 14:06:41 -0700175// OTA chroot tool
176
177cc_binary {
178 name: "otapreopt_chroot",
Martijn Coenen8af07d92019-07-03 14:56:39 +0200179 defaults: ["libapexd-deps"],
Dan Willemsen2a001e82016-08-05 14:06:41 -0700180 cflags: [
181 "-Wall",
182 "-Werror",
183 ],
184 clang: true,
185
Roland Levillain94b41802019-01-18 11:56:50 +0000186 srcs: [
187 "otapreopt_chroot.cpp",
188 "otapreopt_utils.cpp",
189 ],
Dan Willemsen2a001e82016-08-05 14:06:41 -0700190 shared_libs: [
191 "libbase",
192 "liblog",
Martijn Coenen13eba262019-03-13 12:59:57 +0100193 "libutils",
Roland Levillainc19c6042018-12-18 12:15:12 +0000194 ],
Alex Light2ca8b862021-03-09 16:39:55 -0800195 required: [
196 "apexd"
Dan Willemsen2a001e82016-08-05 14:06:41 -0700197 ],
198}
Dan Willemsen4c939742016-12-06 15:44:57 -0800199
Colin Crossdd2dae92017-11-14 13:05:37 -0800200filegroup {
201 name: "installd_aidl",
202 srcs: [
Jeff Sharkey8d3848b2020-08-13 14:16:46 -0600203 "binder/**/*.aidl",
Colin Crossdd2dae92017-11-14 13:05:37 -0800204 ],
Dan Willemsena5d65222018-09-14 21:27:01 -0700205 path: "binder",
Colin Crossdd2dae92017-11-14 13:05:37 -0800206}
207
Calin Juravledff47292018-02-01 14:44:56 +0000208//
209// Static library for otapreopt used in testing
210//
211cc_library_static {
212 name: "libotapreoptparameters",
213 cflags: [
214 "-Wall",
215 "-Werror"
216 ],
Calin Juravledff47292018-02-01 14:44:56 +0000217
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700218 srcs: ["otapreopt_parameters.cpp"],
Calin Juravledff47292018-02-01 14:44:56 +0000219
220 export_include_dirs: ["."],
221
222 shared_libs: [
223 "libbase",
224 "libcutils",
225 "liblog",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700226 "libprocessgroup",
Calin Juravledff47292018-02-01 14:44:56 +0000227 "libutils",
228 ],
229}
230
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700231//
232// OTA Executable
233//
234
235cc_binary {
236 name: "otapreopt",
237 cflags: [
238 "-Wall",
239 "-Werror"
240 ],
241
242 srcs: [
243 "dexopt.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700244 "execv_helper.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700245 "globals.cpp",
246 "otapreopt.cpp",
Roland Levillain94b41802019-01-18 11:56:50 +0000247 "otapreopt_utils.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700248 "run_dex2oat.cpp",
Victor Hsiehcb35a062020-08-13 16:11:13 -0700249 "unique_file.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700250 "utils.cpp",
Oleksandr Peletskyid2be6322019-01-24 17:59:45 +0100251 "utils_default.cpp",
Eric Holk0ebbe0f2019-01-09 18:17:27 -0800252 "view_compiler.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700253 ],
254
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700255 static_libs: [
Martijn Coenen6de402a2021-04-26 16:23:40 +0200256 "libasync_safe",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700257 "libdiskusage",
258 "libotapreoptparameters",
259 ],
260
261 shared_libs: [
262 "libbase",
263 "libcrypto",
264 "libcutils",
265 "liblog",
266 "liblogwrap",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700267 "libprocessgroup",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700268 "libselinux",
269 "libutils",
Nicolas Geoffrayaaad21e2019-02-25 13:31:10 +0000270 "server_configurable_flags",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700271 ],
272}
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800273
274// OTA slot script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800275sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800276 name: "otapreopt_slot",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800277 src: "otapreopt_slot.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800278 init_rc: ["otapreopt.rc"],
279}
280
281// OTA postinstall script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800282sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800283 name: "otapreopt_script",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800284 src: "otapreopt_script.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800285 // Let this depend on otapreopt, the chroot tool and the slot script,
286 // so we just have to mention one in a configuration.
287 required: [
288 "otapreopt",
289 "otapreopt_chroot",
290 "otapreopt_slot",
291 ],
292}
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100293
294// Script to migrate legacy obb data.
295sh_binary {
296 name: "migrate_legacy_obb_data.sh",
297 src: "migrate_legacy_obb_data.sh"
298}