blob: c9f680b26697be18e87c31bb532a216b3ab0be07 [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 ],
84 tidy_flags: [
Keun young Parkb7342262021-10-25 08:09:27 -070085 "-warnings-as-errors=clang-analyzer-security*,cert-*",
Jeff Sharkeyc1149c92017-09-21 14:51:09 -060086 ],
Dan Willemsen4c939742016-12-06 15:44:57 -080087}
88
89//
90// Static library used in testing and executable
91//
92
93cc_library_static {
94 name: "libinstalld",
95 defaults: ["installd_defaults"],
96
97 export_include_dirs: ["."],
98 aidl: {
99 export_aidl_headers: true,
100 },
Risand57852c2018-11-02 04:51:14 +0900101
102 product_variables: {
103 arc: {
104 exclude_srcs: [
105 "QuotaUtils.cpp",
106 ],
107 static_libs: [
108 "libarcdiskquota",
109 "arc_services_aidl",
110 ],
111 cflags: [
112 "-DUSE_ARC",
113 ],
114 },
115 },
116}
117
118cc_library_headers {
119 name: "libinstalld_headers",
120 export_include_dirs: ["."],
Dan Willemsen4c939742016-12-06 15:44:57 -0800121}
122
123//
Victor Hsiehc9821f12020-08-07 11:32:29 -0700124// Unit tests
125//
126
127cc_test_host {
128 name: "run_dex2oat_test",
129 test_suites: ["general-tests"],
130 clang: true,
131 srcs: [
132 "run_dex2oat_test.cpp",
133 "run_dex2oat.cpp",
Victor Hsiehcb35a062020-08-13 16:11:13 -0700134 "unique_file.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700135 "execv_helper.cpp",
136 ],
Keun young Parkb7342262021-10-25 08:09:27 -0700137 cflags: [
138 "-Wall",
139 "-Werror",
140 ],
Victor Hsiehc9821f12020-08-07 11:32:29 -0700141 shared_libs: [
142 "libbase",
143 "server_configurable_flags",
144 ],
Victor Hsiehc9821f12020-08-07 11:32:29 -0700145 test_config: "run_dex2oat_test.xml",
146}
147
148//
Dan Willemsen4c939742016-12-06 15:44:57 -0800149// Executable
150//
151
152cc_binary {
153 name: "installd",
154 defaults: ["installd_defaults"],
155 srcs: ["installd.cpp"],
156
157 static_libs: ["libdiskusage"],
158
159 init_rc: ["installd.rc"],
Risand57852c2018-11-02 04:51:14 +0900160
161 product_variables: {
162 arc: {
163 exclude_srcs: [
164 "QuotaUtils.cpp",
165 ],
166 static_libs: [
167 "libarcdiskquota",
168 "arc_services_aidl",
169 ],
170 cflags: [
171 "-DUSE_ARC",
172 ],
173 },
174 },
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100175
176 // Needs to be wherever installd is as it's execed by
177 // installd.
Keun young Parkb7342262021-10-25 08:09:27 -0700178 required: ["migrate_legacy_obb_data.sh"],
Dan Willemsen4c939742016-12-06 15:44:57 -0800179}
180
Dan Willemsen2a001e82016-08-05 14:06:41 -0700181// OTA chroot tool
182
183cc_binary {
184 name: "otapreopt_chroot",
Martijn Coenen8af07d92019-07-03 14:56:39 +0200185 defaults: ["libapexd-deps"],
Dan Willemsen2a001e82016-08-05 14:06:41 -0700186 cflags: [
187 "-Wall",
188 "-Werror",
189 ],
190 clang: true,
191
Roland Levillain94b41802019-01-18 11:56:50 +0000192 srcs: [
193 "otapreopt_chroot.cpp",
194 "otapreopt_utils.cpp",
195 ],
Dan Willemsen2a001e82016-08-05 14:06:41 -0700196 shared_libs: [
197 "libbase",
198 "liblog",
Martijn Coenen13eba262019-03-13 12:59:57 +0100199 "libutils",
Roland Levillainc19c6042018-12-18 12:15:12 +0000200 ],
Alex Light2ca8b862021-03-09 16:39:55 -0800201 required: [
Keun young Parkb7342262021-10-25 08:09:27 -0700202 "apexd",
Dan Willemsen2a001e82016-08-05 14:06:41 -0700203 ],
204}
Dan Willemsen4c939742016-12-06 15:44:57 -0800205
Colin Crossdd2dae92017-11-14 13:05:37 -0800206filegroup {
207 name: "installd_aidl",
208 srcs: [
Jeff Sharkey8d3848b2020-08-13 14:16:46 -0600209 "binder/**/*.aidl",
Colin Crossdd2dae92017-11-14 13:05:37 -0800210 ],
Dan Willemsena5d65222018-09-14 21:27:01 -0700211 path: "binder",
Colin Crossdd2dae92017-11-14 13:05:37 -0800212}
213
Calin Juravledff47292018-02-01 14:44:56 +0000214//
215// Static library for otapreopt used in testing
216//
217cc_library_static {
218 name: "libotapreoptparameters",
219 cflags: [
220 "-Wall",
Keun young Parkb7342262021-10-25 08:09:27 -0700221 "-Werror",
Calin Juravledff47292018-02-01 14:44:56 +0000222 ],
Calin Juravledff47292018-02-01 14:44:56 +0000223
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700224 srcs: ["otapreopt_parameters.cpp"],
Calin Juravledff47292018-02-01 14:44:56 +0000225
226 export_include_dirs: ["."],
227
228 shared_libs: [
229 "libbase",
230 "libcutils",
231 "liblog",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700232 "libprocessgroup",
Calin Juravledff47292018-02-01 14:44:56 +0000233 "libutils",
234 ],
235}
236
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700237//
238// OTA Executable
239//
240
241cc_binary {
242 name: "otapreopt",
243 cflags: [
244 "-Wall",
Keun young Parkb7342262021-10-25 08:09:27 -0700245 "-Werror",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700246 ],
247
248 srcs: [
249 "dexopt.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700250 "execv_helper.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700251 "globals.cpp",
252 "otapreopt.cpp",
Roland Levillain94b41802019-01-18 11:56:50 +0000253 "otapreopt_utils.cpp",
Keun young Parkb7342262021-10-25 08:09:27 -0700254 "restorable_file.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700255 "run_dex2oat.cpp",
Victor Hsiehcb35a062020-08-13 16:11:13 -0700256 "unique_file.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700257 "utils.cpp",
Oleksandr Peletskyid2be6322019-01-24 17:59:45 +0100258 "utils_default.cpp",
Eric Holk0ebbe0f2019-01-09 18:17:27 -0800259 "view_compiler.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700260 ],
261
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700262 static_libs: [
Martijn Coenen6de402a2021-04-26 16:23:40 +0200263 "libasync_safe",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700264 "libdiskusage",
265 "libotapreoptparameters",
Alex Buynytskyy4ab5d532022-02-17 21:20:10 +0000266 "libext2_uuid",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700267 ],
268
269 shared_libs: [
270 "libbase",
271 "libcrypto",
272 "libcutils",
273 "liblog",
274 "liblogwrap",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700275 "libprocessgroup",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700276 "libselinux",
277 "libutils",
Yang Tianping8f2a40e2021-10-29 14:39:02 +0800278 "libziparchive",
Nicolas Geoffrayaaad21e2019-02-25 13:31:10 +0000279 "server_configurable_flags",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700280 ],
281}
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800282
283// OTA slot script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800284sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800285 name: "otapreopt_slot",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800286 src: "otapreopt_slot.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800287 init_rc: ["otapreopt.rc"],
288}
289
290// OTA postinstall script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800291sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800292 name: "otapreopt_script",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800293 src: "otapreopt_script.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800294 // Let this depend on otapreopt, the chroot tool and the slot script,
295 // so we just have to mention one in a configuration.
296 required: [
297 "otapreopt",
298 "otapreopt_chroot",
299 "otapreopt_slot",
300 ],
301}
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100302
303// Script to migrate legacy obb data.
304sh_binary {
305 name: "migrate_legacy_obb_data.sh",
Keun young Parkb7342262021-10-25 08:09:27 -0700306 src: "migrate_legacy_obb_data.sh",
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100307}