blob: 334bae44e3ffa126f49585a4ef1f7a2dcd5b07e8 [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",
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
Jeff Sharkeyc1149c92017-09-21 14:51:09 -060075 tidy: true,
76 tidy_checks: [
77 "-*",
78 "clang-analyzer-security*",
79 "cert-*",
80 "-cert-err58-cpp",
81 ],
Chih-Hung Hsieh8c18eb42022-04-27 16:00:44 -070082 tidy_checks_as_errors: [
83 "clang-analyzer-security*",
84 "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"],
Victor Hsiehc9821f12020-08-07 11:32:29 -0700129 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 ],
Keun young Parkb7342262021-10-25 08:09:27 -0700135 cflags: [
136 "-Wall",
137 "-Werror",
138 ],
Victor Hsiehc9821f12020-08-07 11:32:29 -0700139 shared_libs: [
140 "libbase",
141 "server_configurable_flags",
142 ],
Victor Hsiehc9821f12020-08-07 11:32:29 -0700143 test_config: "run_dex2oat_test.xml",
144}
145
146//
Dan Willemsen4c939742016-12-06 15:44:57 -0800147// Executable
148//
149
150cc_binary {
151 name: "installd",
152 defaults: ["installd_defaults"],
153 srcs: ["installd.cpp"],
154
155 static_libs: ["libdiskusage"],
156
157 init_rc: ["installd.rc"],
Risand57852c2018-11-02 04:51:14 +0900158
159 product_variables: {
160 arc: {
161 exclude_srcs: [
162 "QuotaUtils.cpp",
163 ],
164 static_libs: [
165 "libarcdiskquota",
166 "arc_services_aidl",
167 ],
168 cflags: [
169 "-DUSE_ARC",
170 ],
171 },
172 },
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100173
174 // Needs to be wherever installd is as it's execed by
175 // installd.
Cole Faustf6cd58a2022-09-01 17:34:36 -0700176 required: ["migrate_legacy_obb_data"],
Dan Willemsen4c939742016-12-06 15:44:57 -0800177}
178
Dan Willemsen2a001e82016-08-05 14:06:41 -0700179// OTA chroot tool
180
181cc_binary {
182 name: "otapreopt_chroot",
Martijn Coenen8af07d92019-07-03 14:56:39 +0200183 defaults: ["libapexd-deps"],
Dan Willemsen2a001e82016-08-05 14:06:41 -0700184 cflags: [
185 "-Wall",
186 "-Werror",
187 ],
Dan Willemsen2a001e82016-08-05 14:06:41 -0700188
Roland Levillain94b41802019-01-18 11:56:50 +0000189 srcs: [
190 "otapreopt_chroot.cpp",
191 "otapreopt_utils.cpp",
192 ],
Dan Willemsen2a001e82016-08-05 14:06:41 -0700193 shared_libs: [
194 "libbase",
195 "liblog",
Martijn Coenen13eba262019-03-13 12:59:57 +0100196 "libutils",
Roland Levillainc19c6042018-12-18 12:15:12 +0000197 ],
Alex Light2ca8b862021-03-09 16:39:55 -0800198 required: [
Keun young Parkb7342262021-10-25 08:09:27 -0700199 "apexd",
Dan Willemsen2a001e82016-08-05 14:06:41 -0700200 ],
201}
Dan Willemsen4c939742016-12-06 15:44:57 -0800202
Colin Crossdd2dae92017-11-14 13:05:37 -0800203filegroup {
204 name: "installd_aidl",
205 srcs: [
Jeff Sharkey8d3848b2020-08-13 14:16:46 -0600206 "binder/**/*.aidl",
Colin Crossdd2dae92017-11-14 13:05:37 -0800207 ],
Dan Willemsena5d65222018-09-14 21:27:01 -0700208 path: "binder",
Colin Crossdd2dae92017-11-14 13:05:37 -0800209}
210
Calin Juravledff47292018-02-01 14:44:56 +0000211//
212// Static library for otapreopt used in testing
213//
214cc_library_static {
215 name: "libotapreoptparameters",
216 cflags: [
217 "-Wall",
Keun young Parkb7342262021-10-25 08:09:27 -0700218 "-Werror",
Calin Juravledff47292018-02-01 14:44:56 +0000219 ],
Calin Juravledff47292018-02-01 14:44:56 +0000220
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700221 srcs: ["otapreopt_parameters.cpp"],
Calin Juravledff47292018-02-01 14:44:56 +0000222
223 export_include_dirs: ["."],
224
225 shared_libs: [
226 "libbase",
227 "libcutils",
228 "liblog",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700229 "libprocessgroup",
Calin Juravledff47292018-02-01 14:44:56 +0000230 "libutils",
231 ],
232}
233
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700234//
235// OTA Executable
236//
237
238cc_binary {
239 name: "otapreopt",
240 cflags: [
241 "-Wall",
Keun young Parkb7342262021-10-25 08:09:27 -0700242 "-Werror",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700243 ],
244
245 srcs: [
246 "dexopt.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700247 "execv_helper.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700248 "globals.cpp",
249 "otapreopt.cpp",
Roland Levillain94b41802019-01-18 11:56:50 +0000250 "otapreopt_utils.cpp",
Keun young Parkb7342262021-10-25 08:09:27 -0700251 "restorable_file.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700252 "run_dex2oat.cpp",
Victor Hsiehcb35a062020-08-13 16:11:13 -0700253 "unique_file.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700254 "utils.cpp",
Oleksandr Peletskyid2be6322019-01-24 17:59:45 +0100255 "utils_default.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700256 ],
257
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700258 static_libs: [
Martijn Coenen6de402a2021-04-26 16:23:40 +0200259 "libasync_safe",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700260 "libdiskusage",
261 "libotapreoptparameters",
Alex Buynytskyy4ab5d532022-02-17 21:20:10 +0000262 "libext2_uuid",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700263 ],
264
265 shared_libs: [
266 "libbase",
267 "libcrypto",
268 "libcutils",
269 "liblog",
270 "liblogwrap",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700271 "libprocessgroup",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700272 "libselinux",
273 "libutils",
Yang Tianping8f2a40e2021-10-29 14:39:02 +0800274 "libziparchive",
Nicolas Geoffrayaaad21e2019-02-25 13:31:10 +0000275 "server_configurable_flags",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700276 ],
277}
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800278
279// OTA slot script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800280sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800281 name: "otapreopt_slot",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800282 src: "otapreopt_slot.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800283 init_rc: ["otapreopt.rc"],
284}
285
286// OTA postinstall script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800287sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800288 name: "otapreopt_script",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800289 src: "otapreopt_script.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800290 // Let this depend on otapreopt, the chroot tool and the slot script,
291 // so we just have to mention one in a configuration.
292 required: [
293 "otapreopt",
294 "otapreopt_chroot",
295 "otapreopt_slot",
296 ],
297}
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100298
299// Script to migrate legacy obb data.
300sh_binary {
Cole Faustf6cd58a2022-09-01 17:34:36 -0700301 name: "migrate_legacy_obb_data",
Keun young Parkb7342262021-10-25 08:09:27 -0700302 src: "migrate_legacy_obb_data.sh",
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100303}