blob: 523115f476853307bb29927d7524fafd885758c6 [file] [log] [blame]
Dan Willemsen4c939742016-12-06 15:44:57 -08001cc_defaults {
2 name: "installd_defaults",
3
4 cflags: [
5 "-Wall",
6 "-Werror",
Jeff Sharkeyc1149c92017-09-21 14:51:09 -06007 "-Wextra",
Andreas Gampefa2dadd2018-02-28 19:52:47 -08008
9 "-Wunreachable-code",
10 "-Wunreachable-code-break",
11 "-Wunreachable-code-return",
Dan Willemsen4c939742016-12-06 15:44:57 -080012 ],
13 srcs: [
Jeff Sharkey88ddd942017-01-17 18:05:54 -070014 "CacheItem.cpp",
15 "CacheTracker.cpp",
Felka Chang2a0a2462019-11-20 14:20:40 +080016 "CrateManager.cpp",
Jeff Sharkeyf3e30b92016-12-09 17:06:57 -070017 "InstalldNativeService.cpp",
Risan5f308262018-10-26 12:06:58 -060018 "QuotaUtils.cpp",
Jeff Sharkey6c2c0562016-12-07 12:12:00 -070019 "dexopt.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -070020 "execv_helper.cpp",
Dan Willemsen4c939742016-12-06 15:44:57 -080021 "globals.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -070022 "run_dex2oat.cpp",
Victor Hsiehcb35a062020-08-13 16:11:13 -070023 "unique_file.cpp",
Dan Willemsen4c939742016-12-06 15:44:57 -080024 "utils.cpp",
Oleksandr Peletskyid2be6322019-01-24 17:59:45 +010025 "utils_default.cpp",
Eric Holk0ebbe0f2019-01-09 18:17:27 -080026 "view_compiler.cpp",
Colin Crossdd2dae92017-11-14 13:05:37 -080027 ":installd_aidl",
Dan Willemsen4c939742016-12-06 15:44:57 -080028 ],
29 shared_libs: [
30 "libbase",
31 "libbinder",
Alan Stokesa25d90c2017-10-16 10:56:00 +010032 "libcrypto",
Dan Willemsen4c939742016-12-06 15:44:57 -080033 "libcutils",
34 "liblog",
35 "liblogwrap",
Suren Baghdasaryancd829052018-11-02 19:15:37 -070036 "libprocessgroup",
Dan Willemsen4c939742016-12-06 15:44:57 -080037 "libselinux",
38 "libutils",
Nicolas Geoffrayaaad21e2019-02-25 13:31:10 +000039 "server_configurable_flags",
Dan Willemsen4c939742016-12-06 15:44:57 -080040 ],
41
Risand57852c2018-11-02 04:51:14 +090042 product_variables: {
43 arc: {
44 exclude_srcs: [
45 "QuotaUtils.cpp",
46 ],
47 static_libs: [
48 "libarcdiskquota",
49 "arc_services_aidl",
50 ],
51 cflags: [
52 "-DUSE_ARC",
53 ],
54 },
55 },
56
Dan Willemsen4c939742016-12-06 15:44:57 -080057 clang: true,
Jeff Sharkeyc1149c92017-09-21 14:51:09 -060058
59 tidy: true,
60 tidy_checks: [
61 "-*",
62 "clang-analyzer-security*",
63 "cert-*",
64 "-cert-err58-cpp",
65 ],
66 tidy_flags: [
67 "-warnings-as-errors=clang-analyzer-security*,cert-*"
68 ],
Dan Willemsen4c939742016-12-06 15:44:57 -080069}
70
71//
72// Static library used in testing and executable
73//
74
75cc_library_static {
76 name: "libinstalld",
77 defaults: ["installd_defaults"],
78
79 export_include_dirs: ["."],
80 aidl: {
81 export_aidl_headers: true,
82 },
Risand57852c2018-11-02 04:51:14 +090083
84 product_variables: {
85 arc: {
86 exclude_srcs: [
87 "QuotaUtils.cpp",
88 ],
89 static_libs: [
90 "libarcdiskquota",
91 "arc_services_aidl",
92 ],
93 cflags: [
94 "-DUSE_ARC",
95 ],
96 },
97 },
98}
99
100cc_library_headers {
101 name: "libinstalld_headers",
102 export_include_dirs: ["."],
Dan Willemsen4c939742016-12-06 15:44:57 -0800103}
104
105//
Victor Hsiehc9821f12020-08-07 11:32:29 -0700106// Unit tests
107//
108
109cc_test_host {
110 name: "run_dex2oat_test",
111 test_suites: ["general-tests"],
112 clang: true,
113 srcs: [
114 "run_dex2oat_test.cpp",
115 "run_dex2oat.cpp",
Victor Hsiehcb35a062020-08-13 16:11:13 -0700116 "unique_file.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700117 "execv_helper.cpp",
118 ],
119 cflags: ["-Wall", "-Werror"],
120 shared_libs: [
121 "libbase",
122 "server_configurable_flags",
123 ],
Victor Hsiehc9821f12020-08-07 11:32:29 -0700124 test_config: "run_dex2oat_test.xml",
125}
126
127//
Dan Willemsen4c939742016-12-06 15:44:57 -0800128// Executable
129//
130
131cc_binary {
132 name: "installd",
133 defaults: ["installd_defaults"],
134 srcs: ["installd.cpp"],
135
136 static_libs: ["libdiskusage"],
137
138 init_rc: ["installd.rc"],
Risand57852c2018-11-02 04:51:14 +0900139
140 product_variables: {
141 arc: {
142 exclude_srcs: [
143 "QuotaUtils.cpp",
144 ],
145 static_libs: [
146 "libarcdiskquota",
147 "arc_services_aidl",
148 ],
149 cflags: [
150 "-DUSE_ARC",
151 ],
152 },
153 },
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100154
155 // Needs to be wherever installd is as it's execed by
156 // installd.
157 required: [ "migrate_legacy_obb_data.sh" ],
Dan Willemsen4c939742016-12-06 15:44:57 -0800158}
159
Dan Willemsen2a001e82016-08-05 14:06:41 -0700160// OTA chroot tool
161
162cc_binary {
163 name: "otapreopt_chroot",
Martijn Coenen8af07d92019-07-03 14:56:39 +0200164 defaults: ["libapexd-deps"],
Dan Willemsen2a001e82016-08-05 14:06:41 -0700165 cflags: [
166 "-Wall",
167 "-Werror",
168 ],
169 clang: true,
170
Roland Levillain94b41802019-01-18 11:56:50 +0000171 srcs: [
172 "otapreopt_chroot.cpp",
173 "otapreopt_utils.cpp",
174 ],
Dan Willemsen2a001e82016-08-05 14:06:41 -0700175 shared_libs: [
176 "libbase",
177 "liblog",
Martijn Coenen13eba262019-03-13 12:59:57 +0100178 "libutils",
Roland Levillainc19c6042018-12-18 12:15:12 +0000179 ],
180 static_libs: [
Roland Levillainc19c6042018-12-18 12:15:12 +0000181 "libapexd",
Dan Willemsen2a001e82016-08-05 14:06:41 -0700182 ],
183}
Dan Willemsen4c939742016-12-06 15:44:57 -0800184
Colin Crossdd2dae92017-11-14 13:05:37 -0800185filegroup {
186 name: "installd_aidl",
187 srcs: [
188 "binder/android/os/IInstalld.aidl",
Felka Chang2a0a2462019-11-20 14:20:40 +0800189 "binder/android/os/storage/CrateMetadata.aidl",
Colin Crossdd2dae92017-11-14 13:05:37 -0800190 ],
Dan Willemsena5d65222018-09-14 21:27:01 -0700191 path: "binder",
Colin Crossdd2dae92017-11-14 13:05:37 -0800192}
193
Calin Juravledff47292018-02-01 14:44:56 +0000194//
195// Static library for otapreopt used in testing
196//
197cc_library_static {
198 name: "libotapreoptparameters",
199 cflags: [
200 "-Wall",
201 "-Werror"
202 ],
Calin Juravledff47292018-02-01 14:44:56 +0000203
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700204 srcs: ["otapreopt_parameters.cpp"],
Calin Juravledff47292018-02-01 14:44:56 +0000205
206 export_include_dirs: ["."],
207
208 shared_libs: [
209 "libbase",
210 "libcutils",
211 "liblog",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700212 "libprocessgroup",
Calin Juravledff47292018-02-01 14:44:56 +0000213 "libutils",
214 ],
215}
216
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700217//
218// OTA Executable
219//
220
221cc_binary {
222 name: "otapreopt",
223 cflags: [
224 "-Wall",
225 "-Werror"
226 ],
227
228 srcs: [
229 "dexopt.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700230 "execv_helper.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700231 "globals.cpp",
232 "otapreopt.cpp",
Roland Levillain94b41802019-01-18 11:56:50 +0000233 "otapreopt_utils.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700234 "run_dex2oat.cpp",
Victor Hsiehcb35a062020-08-13 16:11:13 -0700235 "unique_file.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700236 "utils.cpp",
Oleksandr Peletskyid2be6322019-01-24 17:59:45 +0100237 "utils_default.cpp",
Eric Holk0ebbe0f2019-01-09 18:17:27 -0800238 "view_compiler.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700239 ],
240
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700241 static_libs: [
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700242 "libdiskusage",
243 "libotapreoptparameters",
244 ],
245
246 shared_libs: [
247 "libbase",
248 "libcrypto",
249 "libcutils",
250 "liblog",
251 "liblogwrap",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700252 "libprocessgroup",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700253 "libselinux",
254 "libutils",
Nicolas Geoffrayaaad21e2019-02-25 13:31:10 +0000255 "server_configurable_flags",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700256 ],
257}
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800258
259// OTA slot script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800260sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800261 name: "otapreopt_slot",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800262 src: "otapreopt_slot.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800263 init_rc: ["otapreopt.rc"],
264}
265
266// OTA postinstall script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800267sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800268 name: "otapreopt_script",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800269 src: "otapreopt_script.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800270 // Let this depend on otapreopt, the chroot tool and the slot script,
271 // so we just have to mention one in a configuration.
272 required: [
273 "otapreopt",
274 "otapreopt_chroot",
275 "otapreopt_slot",
276 ],
277}
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100278
279// Script to migrate legacy obb data.
280sh_binary {
281 name: "migrate_legacy_obb_data.sh",
282 src: "migrate_legacy_obb_data.sh"
283}