blob: 8e37ce91e6b96e0be0f73d0e579d129a08bbdf31 [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",
Zim23457d02022-08-17 12:57:41 +010028 "SysTrace.cpp",
Jeff Sharkey6c2c0562016-12-07 12:12:00 -070029 "dexopt.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -070030 "execv_helper.cpp",
Dan Willemsen4c939742016-12-06 15:44:57 -080031 "globals.cpp",
Keun young Parkb7342262021-10-25 08:09:27 -070032 "restorable_file.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -070033 "run_dex2oat.cpp",
Victor Hsiehcb35a062020-08-13 16:11:13 -070034 "unique_file.cpp",
Dan Willemsen4c939742016-12-06 15:44:57 -080035 "utils.cpp",
Oleksandr Peletskyid2be6322019-01-24 17:59:45 +010036 "utils_default.cpp",
Eric Holk0ebbe0f2019-01-09 18:17:27 -080037 "view_compiler.cpp",
Colin Crossdd2dae92017-11-14 13:05:37 -080038 ":installd_aidl",
Dan Willemsen4c939742016-12-06 15:44:57 -080039 ],
40 shared_libs: [
41 "libbase",
42 "libbinder",
Alan Stokesa25d90c2017-10-16 10:56:00 +010043 "libcrypto",
Dan Willemsen4c939742016-12-06 15:44:57 -080044 "libcutils",
45 "liblog",
46 "liblogwrap",
Suren Baghdasaryancd829052018-11-02 19:15:37 -070047 "libprocessgroup",
Dan Willemsen4c939742016-12-06 15:44:57 -080048 "libselinux",
49 "libutils",
Yang Tianping8f2a40e2021-10-29 14:39:02 +080050 "libziparchive",
Nicolas Geoffrayaaad21e2019-02-25 13:31:10 +000051 "server_configurable_flags",
Dan Willemsen4c939742016-12-06 15:44:57 -080052 ],
Martijn Coenen6de402a2021-04-26 16:23:40 +020053 static_libs: [
54 "libasync_safe",
Alex Buynytskyy4ab5d532022-02-17 21:20:10 +000055 "libext2_uuid",
Martijn Coenen6de402a2021-04-26 16:23:40 +020056 ],
Jooyung Handc413662021-02-04 18:18:28 +090057 export_shared_lib_headers: [
58 "libbinder",
59 ],
Dan Willemsen4c939742016-12-06 15:44:57 -080060
Risand57852c2018-11-02 04:51:14 +090061 product_variables: {
62 arc: {
63 exclude_srcs: [
64 "QuotaUtils.cpp",
65 ],
66 static_libs: [
67 "libarcdiskquota",
68 "arc_services_aidl",
69 ],
70 cflags: [
71 "-DUSE_ARC",
72 ],
73 },
74 },
75
Jeff Sharkeyc1149c92017-09-21 14:51:09 -060076 tidy: true,
77 tidy_checks: [
78 "-*",
79 "clang-analyzer-security*",
80 "cert-*",
81 "-cert-err58-cpp",
82 ],
Chih-Hung Hsieh8c18eb42022-04-27 16:00:44 -070083 tidy_checks_as_errors: [
84 "clang-analyzer-security*",
85 "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"],
Victor Hsiehc9821f12020-08-07 11:32:29 -0700130 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 ],
Dan Willemsen2a001e82016-08-05 14:06:41 -0700189
Roland Levillain94b41802019-01-18 11:56:50 +0000190 srcs: [
191 "otapreopt_chroot.cpp",
192 "otapreopt_utils.cpp",
193 ],
Dan Willemsen2a001e82016-08-05 14:06:41 -0700194 shared_libs: [
195 "libbase",
196 "liblog",
Martijn Coenen13eba262019-03-13 12:59:57 +0100197 "libutils",
Roland Levillainc19c6042018-12-18 12:15:12 +0000198 ],
Alex Light2ca8b862021-03-09 16:39:55 -0800199 required: [
Keun young Parkb7342262021-10-25 08:09:27 -0700200 "apexd",
Dan Willemsen2a001e82016-08-05 14:06:41 -0700201 ],
202}
Dan Willemsen4c939742016-12-06 15:44:57 -0800203
Colin Crossdd2dae92017-11-14 13:05:37 -0800204filegroup {
205 name: "installd_aidl",
206 srcs: [
Jeff Sharkey8d3848b2020-08-13 14:16:46 -0600207 "binder/**/*.aidl",
Colin Crossdd2dae92017-11-14 13:05:37 -0800208 ],
Dan Willemsena5d65222018-09-14 21:27:01 -0700209 path: "binder",
Colin Crossdd2dae92017-11-14 13:05:37 -0800210}
211
Calin Juravledff47292018-02-01 14:44:56 +0000212//
213// Static library for otapreopt used in testing
214//
215cc_library_static {
216 name: "libotapreoptparameters",
217 cflags: [
218 "-Wall",
Keun young Parkb7342262021-10-25 08:09:27 -0700219 "-Werror",
Calin Juravledff47292018-02-01 14:44:56 +0000220 ],
Calin Juravledff47292018-02-01 14:44:56 +0000221
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700222 srcs: ["otapreopt_parameters.cpp"],
Calin Juravledff47292018-02-01 14:44:56 +0000223
224 export_include_dirs: ["."],
225
226 shared_libs: [
227 "libbase",
228 "libcutils",
229 "liblog",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700230 "libprocessgroup",
Calin Juravledff47292018-02-01 14:44:56 +0000231 "libutils",
232 ],
233}
234
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700235//
236// OTA Executable
237//
238
239cc_binary {
240 name: "otapreopt",
241 cflags: [
242 "-Wall",
Keun young Parkb7342262021-10-25 08:09:27 -0700243 "-Werror",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700244 ],
245
246 srcs: [
247 "dexopt.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700248 "execv_helper.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700249 "globals.cpp",
250 "otapreopt.cpp",
Roland Levillain94b41802019-01-18 11:56:50 +0000251 "otapreopt_utils.cpp",
Keun young Parkb7342262021-10-25 08:09:27 -0700252 "restorable_file.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700253 "run_dex2oat.cpp",
Victor Hsiehcb35a062020-08-13 16:11:13 -0700254 "unique_file.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700255 "utils.cpp",
Oleksandr Peletskyid2be6322019-01-24 17:59:45 +0100256 "utils_default.cpp",
Eric Holk0ebbe0f2019-01-09 18:17:27 -0800257 "view_compiler.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700258 ],
259
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700260 static_libs: [
Martijn Coenen6de402a2021-04-26 16:23:40 +0200261 "libasync_safe",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700262 "libdiskusage",
263 "libotapreoptparameters",
Alex Buynytskyy4ab5d532022-02-17 21:20:10 +0000264 "libext2_uuid",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700265 ],
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}