blob: 25c4f1bec3bcc3cad5d3a54334ca13c3ee8288b4 [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",
Dan Willemsen4c939742016-12-06 15:44:57 -080020 "globals.cpp",
21 "utils.cpp",
Oleksandr Peletskyid2be6322019-01-24 17:59:45 +010022 "utils_default.cpp",
Eric Holk0ebbe0f2019-01-09 18:17:27 -080023 "view_compiler.cpp",
Colin Crossdd2dae92017-11-14 13:05:37 -080024 ":installd_aidl",
Dan Willemsen4c939742016-12-06 15:44:57 -080025 ],
Andreas Gampefa2dadd2018-02-28 19:52:47 -080026 header_libs: [
27 "dex2oat_headers",
28 ],
Dan Willemsen4c939742016-12-06 15:44:57 -080029 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//
106// Executable
107//
108
109cc_binary {
110 name: "installd",
111 defaults: ["installd_defaults"],
112 srcs: ["installd.cpp"],
113
114 static_libs: ["libdiskusage"],
115
116 init_rc: ["installd.rc"],
Risand57852c2018-11-02 04:51:14 +0900117
118 product_variables: {
119 arc: {
120 exclude_srcs: [
121 "QuotaUtils.cpp",
122 ],
123 static_libs: [
124 "libarcdiskquota",
125 "arc_services_aidl",
126 ],
127 cflags: [
128 "-DUSE_ARC",
129 ],
130 },
131 },
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100132
133 // Needs to be wherever installd is as it's execed by
134 // installd.
135 required: [ "migrate_legacy_obb_data.sh" ],
Dan Willemsen4c939742016-12-06 15:44:57 -0800136}
137
Dan Willemsen2a001e82016-08-05 14:06:41 -0700138// OTA chroot tool
139
140cc_binary {
141 name: "otapreopt_chroot",
Martijn Coenen8af07d92019-07-03 14:56:39 +0200142 defaults: ["libapexd-deps"],
Dan Willemsen2a001e82016-08-05 14:06:41 -0700143 cflags: [
144 "-Wall",
145 "-Werror",
146 ],
147 clang: true,
148
Roland Levillain94b41802019-01-18 11:56:50 +0000149 srcs: [
150 "otapreopt_chroot.cpp",
151 "otapreopt_utils.cpp",
152 ],
Dan Willemsen2a001e82016-08-05 14:06:41 -0700153 shared_libs: [
154 "libbase",
155 "liblog",
Martijn Coenen13eba262019-03-13 12:59:57 +0100156 "libutils",
Roland Levillainc19c6042018-12-18 12:15:12 +0000157 ],
158 static_libs: [
Roland Levillainc19c6042018-12-18 12:15:12 +0000159 "libapexd",
Dan Willemsen2a001e82016-08-05 14:06:41 -0700160 ],
161}
Dan Willemsen4c939742016-12-06 15:44:57 -0800162
Colin Crossdd2dae92017-11-14 13:05:37 -0800163filegroup {
164 name: "installd_aidl",
165 srcs: [
Jeff Sharkey8d3848b2020-08-13 14:16:46 -0600166 "binder/**/*.aidl",
Colin Crossdd2dae92017-11-14 13:05:37 -0800167 ],
Dan Willemsena5d65222018-09-14 21:27:01 -0700168 path: "binder",
Colin Crossdd2dae92017-11-14 13:05:37 -0800169}
170
Calin Juravledff47292018-02-01 14:44:56 +0000171//
172// Static library for otapreopt used in testing
173//
174cc_library_static {
175 name: "libotapreoptparameters",
176 cflags: [
177 "-Wall",
178 "-Werror"
179 ],
Calin Juravledff47292018-02-01 14:44:56 +0000180
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700181 srcs: ["otapreopt_parameters.cpp"],
Calin Juravledff47292018-02-01 14:44:56 +0000182
183 export_include_dirs: ["."],
184
185 shared_libs: [
186 "libbase",
187 "libcutils",
188 "liblog",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700189 "libprocessgroup",
Calin Juravledff47292018-02-01 14:44:56 +0000190 "libutils",
191 ],
192}
193
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700194//
195// OTA Executable
196//
197
198cc_binary {
199 name: "otapreopt",
200 cflags: [
201 "-Wall",
202 "-Werror"
203 ],
204
205 srcs: [
206 "dexopt.cpp",
207 "globals.cpp",
208 "otapreopt.cpp",
Roland Levillain94b41802019-01-18 11:56:50 +0000209 "otapreopt_utils.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700210 "utils.cpp",
Oleksandr Peletskyid2be6322019-01-24 17:59:45 +0100211 "utils_default.cpp",
Eric Holk0ebbe0f2019-01-09 18:17:27 -0800212 "view_compiler.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700213 ],
214
215 header_libs: ["dex2oat_headers"],
216
217 static_libs: [
218 "libartimagevalues",
219 "libdiskusage",
220 "libotapreoptparameters",
221 ],
222
223 shared_libs: [
224 "libbase",
225 "libcrypto",
226 "libcutils",
227 "liblog",
228 "liblogwrap",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700229 "libprocessgroup",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700230 "libselinux",
231 "libutils",
Nicolas Geoffrayaaad21e2019-02-25 13:31:10 +0000232 "server_configurable_flags",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700233 ],
234}
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800235
236// OTA slot script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800237sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800238 name: "otapreopt_slot",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800239 src: "otapreopt_slot.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800240 init_rc: ["otapreopt.rc"],
241}
242
243// OTA postinstall script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800244sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800245 name: "otapreopt_script",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800246 src: "otapreopt_script.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800247 // Let this depend on otapreopt, the chroot tool and the slot script,
248 // so we just have to mention one in a configuration.
249 required: [
250 "otapreopt",
251 "otapreopt_chroot",
252 "otapreopt_slot",
253 ],
254}
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100255
256// Script to migrate legacy obb data.
257sh_binary {
258 name: "migrate_legacy_obb_data.sh",
259 src: "migrate_legacy_obb_data.sh"
260}