blob: faa84854bab670db88ee602f2bb76850f64eb529 [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",
Yang Tianping8f2a40e2021-10-29 14:39:02 +080048 "libziparchive",
Nicolas Geoffrayaaad21e2019-02-25 13:31:10 +000049 "server_configurable_flags",
Dan Willemsen4c939742016-12-06 15:44:57 -080050 ],
Martijn Coenen6de402a2021-04-26 16:23:40 +020051 static_libs: [
52 "libasync_safe",
53 ],
Jooyung Handc413662021-02-04 18:18:28 +090054 export_shared_lib_headers: [
55 "libbinder",
56 ],
Dan Willemsen4c939742016-12-06 15:44:57 -080057
Risand57852c2018-11-02 04:51:14 +090058 product_variables: {
59 arc: {
60 exclude_srcs: [
61 "QuotaUtils.cpp",
62 ],
63 static_libs: [
64 "libarcdiskquota",
65 "arc_services_aidl",
66 ],
67 cflags: [
68 "-DUSE_ARC",
69 ],
70 },
71 },
72
Dan Willemsen4c939742016-12-06 15:44:57 -080073 clang: true,
Jeff Sharkeyc1149c92017-09-21 14:51:09 -060074
75 tidy: true,
76 tidy_checks: [
77 "-*",
78 "clang-analyzer-security*",
79 "cert-*",
80 "-cert-err58-cpp",
81 ],
82 tidy_flags: [
83 "-warnings-as-errors=clang-analyzer-security*,cert-*"
84 ],
Dan Willemsen4c939742016-12-06 15:44:57 -080085}
86
87//
88// Static library used in testing and executable
89//
90
91cc_library_static {
92 name: "libinstalld",
93 defaults: ["installd_defaults"],
94
95 export_include_dirs: ["."],
96 aidl: {
97 export_aidl_headers: true,
98 },
Risand57852c2018-11-02 04:51:14 +090099
100 product_variables: {
101 arc: {
102 exclude_srcs: [
103 "QuotaUtils.cpp",
104 ],
105 static_libs: [
106 "libarcdiskquota",
107 "arc_services_aidl",
108 ],
109 cflags: [
110 "-DUSE_ARC",
111 ],
112 },
113 },
114}
115
116cc_library_headers {
117 name: "libinstalld_headers",
118 export_include_dirs: ["."],
Dan Willemsen4c939742016-12-06 15:44:57 -0800119}
120
121//
Victor Hsiehc9821f12020-08-07 11:32:29 -0700122// Unit tests
123//
124
125cc_test_host {
126 name: "run_dex2oat_test",
127 test_suites: ["general-tests"],
128 clang: true,
129 srcs: [
130 "run_dex2oat_test.cpp",
131 "run_dex2oat.cpp",
Victor Hsiehcb35a062020-08-13 16:11:13 -0700132 "unique_file.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700133 "execv_helper.cpp",
134 ],
135 cflags: ["-Wall", "-Werror"],
136 shared_libs: [
137 "libbase",
138 "server_configurable_flags",
139 ],
Victor Hsiehc9821f12020-08-07 11:32:29 -0700140 test_config: "run_dex2oat_test.xml",
141}
142
143//
Dan Willemsen4c939742016-12-06 15:44:57 -0800144// Executable
145//
146
147cc_binary {
148 name: "installd",
149 defaults: ["installd_defaults"],
150 srcs: ["installd.cpp"],
151
152 static_libs: ["libdiskusage"],
153
154 init_rc: ["installd.rc"],
Risand57852c2018-11-02 04:51:14 +0900155
156 product_variables: {
157 arc: {
158 exclude_srcs: [
159 "QuotaUtils.cpp",
160 ],
161 static_libs: [
162 "libarcdiskquota",
163 "arc_services_aidl",
164 ],
165 cflags: [
166 "-DUSE_ARC",
167 ],
168 },
169 },
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100170
171 // Needs to be wherever installd is as it's execed by
172 // installd.
173 required: [ "migrate_legacy_obb_data.sh" ],
Dan Willemsen4c939742016-12-06 15:44:57 -0800174}
175
Dan Willemsen2a001e82016-08-05 14:06:41 -0700176// OTA chroot tool
177
178cc_binary {
179 name: "otapreopt_chroot",
Martijn Coenen8af07d92019-07-03 14:56:39 +0200180 defaults: ["libapexd-deps"],
Dan Willemsen2a001e82016-08-05 14:06:41 -0700181 cflags: [
182 "-Wall",
183 "-Werror",
184 ],
185 clang: true,
186
Roland Levillain94b41802019-01-18 11:56:50 +0000187 srcs: [
188 "otapreopt_chroot.cpp",
189 "otapreopt_utils.cpp",
190 ],
Dan Willemsen2a001e82016-08-05 14:06:41 -0700191 shared_libs: [
192 "libbase",
193 "liblog",
Martijn Coenen13eba262019-03-13 12:59:57 +0100194 "libutils",
Roland Levillainc19c6042018-12-18 12:15:12 +0000195 ],
Alex Light2ca8b862021-03-09 16:39:55 -0800196 required: [
197 "apexd"
Dan Willemsen2a001e82016-08-05 14:06:41 -0700198 ],
199}
Dan Willemsen4c939742016-12-06 15:44:57 -0800200
Colin Crossdd2dae92017-11-14 13:05:37 -0800201filegroup {
202 name: "installd_aidl",
203 srcs: [
Jeff Sharkey8d3848b2020-08-13 14:16:46 -0600204 "binder/**/*.aidl",
Colin Crossdd2dae92017-11-14 13:05:37 -0800205 ],
Dan Willemsena5d65222018-09-14 21:27:01 -0700206 path: "binder",
Colin Crossdd2dae92017-11-14 13:05:37 -0800207}
208
Calin Juravledff47292018-02-01 14:44:56 +0000209//
210// Static library for otapreopt used in testing
211//
212cc_library_static {
213 name: "libotapreoptparameters",
214 cflags: [
215 "-Wall",
216 "-Werror"
217 ],
Calin Juravledff47292018-02-01 14:44:56 +0000218
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700219 srcs: ["otapreopt_parameters.cpp"],
Calin Juravledff47292018-02-01 14:44:56 +0000220
221 export_include_dirs: ["."],
222
223 shared_libs: [
224 "libbase",
225 "libcutils",
226 "liblog",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700227 "libprocessgroup",
Calin Juravledff47292018-02-01 14:44:56 +0000228 "libutils",
229 ],
230}
231
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700232//
233// OTA Executable
234//
235
236cc_binary {
237 name: "otapreopt",
238 cflags: [
239 "-Wall",
240 "-Werror"
241 ],
242
243 srcs: [
244 "dexopt.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700245 "execv_helper.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700246 "globals.cpp",
247 "otapreopt.cpp",
Roland Levillain94b41802019-01-18 11:56:50 +0000248 "otapreopt_utils.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700249 "run_dex2oat.cpp",
Victor Hsiehcb35a062020-08-13 16:11:13 -0700250 "unique_file.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700251 "utils.cpp",
Oleksandr Peletskyid2be6322019-01-24 17:59:45 +0100252 "utils_default.cpp",
Eric Holk0ebbe0f2019-01-09 18:17:27 -0800253 "view_compiler.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700254 ],
255
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700256 static_libs: [
Martijn Coenen6de402a2021-04-26 16:23:40 +0200257 "libasync_safe",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700258 "libdiskusage",
259 "libotapreoptparameters",
260 ],
261
262 shared_libs: [
263 "libbase",
264 "libcrypto",
265 "libcutils",
266 "liblog",
267 "liblogwrap",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700268 "libprocessgroup",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700269 "libselinux",
270 "libutils",
Yang Tianping8f2a40e2021-10-29 14:39:02 +0800271 "libziparchive",
Nicolas Geoffrayaaad21e2019-02-25 13:31:10 +0000272 "server_configurable_flags",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700273 ],
274}
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800275
276// OTA slot script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800277sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800278 name: "otapreopt_slot",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800279 src: "otapreopt_slot.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800280 init_rc: ["otapreopt.rc"],
281}
282
283// OTA postinstall script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800284sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800285 name: "otapreopt_script",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800286 src: "otapreopt_script.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800287 // Let this depend on otapreopt, the chroot tool and the slot script,
288 // so we just have to mention one in a configuration.
289 required: [
290 "otapreopt",
291 "otapreopt_chroot",
292 "otapreopt_slot",
293 ],
294}
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100295
296// Script to migrate legacy obb data.
297sh_binary {
298 name: "migrate_legacy_obb_data.sh",
299 src: "migrate_legacy_obb_data.sh"
300}