blob: 8ff4dd862d18789dce2e68f57a40be275e98be4c [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: [
166 "binder/android/os/IInstalld.aidl",
Felka Chang2a0a2462019-11-20 14:20:40 +0800167 "binder/android/os/storage/CrateMetadata.aidl",
Colin Crossdd2dae92017-11-14 13:05:37 -0800168 ],
Dan Willemsena5d65222018-09-14 21:27:01 -0700169 path: "binder",
Colin Crossdd2dae92017-11-14 13:05:37 -0800170}
171
Calin Juravledff47292018-02-01 14:44:56 +0000172//
173// Static library for otapreopt used in testing
174//
175cc_library_static {
176 name: "libotapreoptparameters",
177 cflags: [
178 "-Wall",
179 "-Werror"
180 ],
Calin Juravledff47292018-02-01 14:44:56 +0000181
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700182 srcs: ["otapreopt_parameters.cpp"],
Calin Juravledff47292018-02-01 14:44:56 +0000183
184 export_include_dirs: ["."],
185
186 shared_libs: [
187 "libbase",
188 "libcutils",
189 "liblog",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700190 "libprocessgroup",
Calin Juravledff47292018-02-01 14:44:56 +0000191 "libutils",
192 ],
193}
194
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700195//
196// OTA Executable
197//
198
199cc_binary {
200 name: "otapreopt",
201 cflags: [
202 "-Wall",
203 "-Werror"
204 ],
205
206 srcs: [
207 "dexopt.cpp",
208 "globals.cpp",
209 "otapreopt.cpp",
Roland Levillain94b41802019-01-18 11:56:50 +0000210 "otapreopt_utils.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700211 "utils.cpp",
Oleksandr Peletskyid2be6322019-01-24 17:59:45 +0100212 "utils_default.cpp",
Eric Holk0ebbe0f2019-01-09 18:17:27 -0800213 "view_compiler.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700214 ],
215
216 header_libs: ["dex2oat_headers"],
217
218 static_libs: [
219 "libartimagevalues",
220 "libdiskusage",
221 "libotapreoptparameters",
222 ],
223
224 shared_libs: [
225 "libbase",
226 "libcrypto",
227 "libcutils",
228 "liblog",
229 "liblogwrap",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700230 "libprocessgroup",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700231 "libselinux",
232 "libutils",
Nicolas Geoffrayaaad21e2019-02-25 13:31:10 +0000233 "server_configurable_flags",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700234 ],
235}
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800236
237// OTA slot script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800238sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800239 name: "otapreopt_slot",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800240 src: "otapreopt_slot.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800241 init_rc: ["otapreopt.rc"],
242}
243
244// OTA postinstall script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800245sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800246 name: "otapreopt_script",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800247 src: "otapreopt_script.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800248 // Let this depend on otapreopt, the chroot tool and the slot script,
249 // so we just have to mention one in a configuration.
250 required: [
251 "otapreopt",
252 "otapreopt_chroot",
253 "otapreopt_slot",
254 ],
255}
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100256
257// Script to migrate legacy obb data.
258sh_binary {
259 name: "migrate_legacy_obb_data.sh",
260 src: "migrate_legacy_obb_data.sh"
261}