blob: d09d3e8689691ef8c6d5dc9f6fd5968f8146f628 [file] [log] [blame]
Bob Badour3c538232021-02-12 21:26:48 -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",
Nicolas Geoffrayaaad21e2019-02-25 13:31:10 +000048 "server_configurable_flags",
Dan Willemsen4c939742016-12-06 15:44:57 -080049 ],
Jooyung Handc413662021-02-04 18:18:28 +090050 export_shared_lib_headers: [
51 "libbinder",
52 ],
Dan Willemsen4c939742016-12-06 15:44:57 -080053
Risand57852c2018-11-02 04:51:14 +090054 product_variables: {
55 arc: {
56 exclude_srcs: [
57 "QuotaUtils.cpp",
58 ],
59 static_libs: [
60 "libarcdiskquota",
61 "arc_services_aidl",
62 ],
63 cflags: [
64 "-DUSE_ARC",
65 ],
66 },
67 },
68
Dan Willemsen4c939742016-12-06 15:44:57 -080069 clang: true,
Jeff Sharkeyc1149c92017-09-21 14:51:09 -060070
71 tidy: true,
72 tidy_checks: [
73 "-*",
74 "clang-analyzer-security*",
75 "cert-*",
76 "-cert-err58-cpp",
77 ],
78 tidy_flags: [
79 "-warnings-as-errors=clang-analyzer-security*,cert-*"
80 ],
Dan Willemsen4c939742016-12-06 15:44:57 -080081}
82
83//
84// Static library used in testing and executable
85//
86
87cc_library_static {
88 name: "libinstalld",
89 defaults: ["installd_defaults"],
90
91 export_include_dirs: ["."],
92 aidl: {
93 export_aidl_headers: true,
94 },
Risand57852c2018-11-02 04:51:14 +090095
96 product_variables: {
97 arc: {
98 exclude_srcs: [
99 "QuotaUtils.cpp",
100 ],
101 static_libs: [
102 "libarcdiskquota",
103 "arc_services_aidl",
104 ],
105 cflags: [
106 "-DUSE_ARC",
107 ],
108 },
109 },
110}
111
112cc_library_headers {
113 name: "libinstalld_headers",
114 export_include_dirs: ["."],
Dan Willemsen4c939742016-12-06 15:44:57 -0800115}
116
117//
Victor Hsiehc9821f12020-08-07 11:32:29 -0700118// Unit tests
119//
120
121cc_test_host {
122 name: "run_dex2oat_test",
123 test_suites: ["general-tests"],
124 clang: true,
125 srcs: [
126 "run_dex2oat_test.cpp",
127 "run_dex2oat.cpp",
Victor Hsiehcb35a062020-08-13 16:11:13 -0700128 "unique_file.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700129 "execv_helper.cpp",
130 ],
131 cflags: ["-Wall", "-Werror"],
132 shared_libs: [
133 "libbase",
134 "server_configurable_flags",
135 ],
Victor Hsiehc9821f12020-08-07 11:32:29 -0700136 test_config: "run_dex2oat_test.xml",
137}
138
139//
Dan Willemsen4c939742016-12-06 15:44:57 -0800140// Executable
141//
142
143cc_binary {
144 name: "installd",
145 defaults: ["installd_defaults"],
146 srcs: ["installd.cpp"],
147
148 static_libs: ["libdiskusage"],
149
150 init_rc: ["installd.rc"],
Risand57852c2018-11-02 04:51:14 +0900151
152 product_variables: {
153 arc: {
154 exclude_srcs: [
155 "QuotaUtils.cpp",
156 ],
157 static_libs: [
158 "libarcdiskquota",
159 "arc_services_aidl",
160 ],
161 cflags: [
162 "-DUSE_ARC",
163 ],
164 },
165 },
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100166
167 // Needs to be wherever installd is as it's execed by
168 // installd.
169 required: [ "migrate_legacy_obb_data.sh" ],
Dan Willemsen4c939742016-12-06 15:44:57 -0800170}
171
Dan Willemsen2a001e82016-08-05 14:06:41 -0700172// OTA chroot tool
173
174cc_binary {
175 name: "otapreopt_chroot",
Martijn Coenen8af07d92019-07-03 14:56:39 +0200176 defaults: ["libapexd-deps"],
Dan Willemsen2a001e82016-08-05 14:06:41 -0700177 cflags: [
178 "-Wall",
179 "-Werror",
180 ],
181 clang: true,
182
Roland Levillain94b41802019-01-18 11:56:50 +0000183 srcs: [
184 "otapreopt_chroot.cpp",
185 "otapreopt_utils.cpp",
186 ],
Dan Willemsen2a001e82016-08-05 14:06:41 -0700187 shared_libs: [
188 "libbase",
189 "liblog",
Martijn Coenen13eba262019-03-13 12:59:57 +0100190 "libutils",
Roland Levillainc19c6042018-12-18 12:15:12 +0000191 ],
Alex Light53e94382021-03-09 16:39:55 -0800192 required: [
193 "apexd"
Dan Willemsen2a001e82016-08-05 14:06:41 -0700194 ],
195}
Dan Willemsen4c939742016-12-06 15:44:57 -0800196
Colin Crossdd2dae92017-11-14 13:05:37 -0800197filegroup {
198 name: "installd_aidl",
199 srcs: [
200 "binder/android/os/IInstalld.aidl",
Felka Chang2a0a2462019-11-20 14:20:40 +0800201 "binder/android/os/storage/CrateMetadata.aidl",
Colin Crossdd2dae92017-11-14 13:05:37 -0800202 ],
Dan Willemsena5d65222018-09-14 21:27:01 -0700203 path: "binder",
Colin Crossdd2dae92017-11-14 13:05:37 -0800204}
205
Calin Juravledff47292018-02-01 14:44:56 +0000206//
207// Static library for otapreopt used in testing
208//
209cc_library_static {
210 name: "libotapreoptparameters",
211 cflags: [
212 "-Wall",
213 "-Werror"
214 ],
Calin Juravledff47292018-02-01 14:44:56 +0000215
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700216 srcs: ["otapreopt_parameters.cpp"],
Calin Juravledff47292018-02-01 14:44:56 +0000217
218 export_include_dirs: ["."],
219
220 shared_libs: [
221 "libbase",
222 "libcutils",
223 "liblog",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700224 "libprocessgroup",
Calin Juravledff47292018-02-01 14:44:56 +0000225 "libutils",
226 ],
227}
228
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700229//
230// OTA Executable
231//
232
233cc_binary {
234 name: "otapreopt",
235 cflags: [
236 "-Wall",
237 "-Werror"
238 ],
239
240 srcs: [
241 "dexopt.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700242 "execv_helper.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700243 "globals.cpp",
244 "otapreopt.cpp",
Roland Levillain94b41802019-01-18 11:56:50 +0000245 "otapreopt_utils.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700246 "run_dex2oat.cpp",
Victor Hsiehcb35a062020-08-13 16:11:13 -0700247 "unique_file.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700248 "utils.cpp",
Oleksandr Peletskyid2be6322019-01-24 17:59:45 +0100249 "utils_default.cpp",
Eric Holk0ebbe0f2019-01-09 18:17:27 -0800250 "view_compiler.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700251 ],
252
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700253 static_libs: [
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700254 "libdiskusage",
255 "libotapreoptparameters",
256 ],
257
258 shared_libs: [
259 "libbase",
260 "libcrypto",
261 "libcutils",
262 "liblog",
263 "liblogwrap",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700264 "libprocessgroup",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700265 "libselinux",
266 "libutils",
Nicolas Geoffrayaaad21e2019-02-25 13:31:10 +0000267 "server_configurable_flags",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700268 ],
269}
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800270
271// OTA slot script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800272sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800273 name: "otapreopt_slot",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800274 src: "otapreopt_slot.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800275 init_rc: ["otapreopt.rc"],
276}
277
278// OTA postinstall script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800279sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800280 name: "otapreopt_script",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800281 src: "otapreopt_script.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800282 // Let this depend on otapreopt, the chroot tool and the slot script,
283 // so we just have to mention one in a configuration.
284 required: [
285 "otapreopt",
286 "otapreopt_chroot",
287 "otapreopt_slot",
288 ],
289}
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100290
291// Script to migrate legacy obb data.
292sh_binary {
293 name: "migrate_legacy_obb_data.sh",
294 src: "migrate_legacy_obb_data.sh"
295}