blob: c80ae3bbf64a63e6f2738b30b4a9b2df98e7130e [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",
Jeff Sharkeyf3e30b92016-12-09 17:06:57 -070016 "InstalldNativeService.cpp",
Risan5f308262018-10-26 12:06:58 -060017 "QuotaUtils.cpp",
Jeff Sharkey6c2c0562016-12-07 12:12:00 -070018 "dexopt.cpp",
Dan Willemsen4c939742016-12-06 15:44:57 -080019 "globals.cpp",
20 "utils.cpp",
Oleksandr Peletskyid2be6322019-01-24 17:59:45 +010021 "utils_default.cpp",
Eric Holk0ebbe0f2019-01-09 18:17:27 -080022 "view_compiler.cpp",
Colin Crossdd2dae92017-11-14 13:05:37 -080023 ":installd_aidl",
Dan Willemsen4c939742016-12-06 15:44:57 -080024 ],
Andreas Gampefa2dadd2018-02-28 19:52:47 -080025 header_libs: [
26 "dex2oat_headers",
27 ],
Dan Willemsen4c939742016-12-06 15:44:57 -080028 shared_libs: [
29 "libbase",
30 "libbinder",
Alan Stokesa25d90c2017-10-16 10:56:00 +010031 "libcrypto",
Dan Willemsen4c939742016-12-06 15:44:57 -080032 "libcutils",
33 "liblog",
34 "liblogwrap",
Suren Baghdasaryancd829052018-11-02 19:15:37 -070035 "libprocessgroup",
Dan Willemsen4c939742016-12-06 15:44:57 -080036 "libselinux",
37 "libutils",
Nicolas Geoffrayaaad21e2019-02-25 13:31:10 +000038 "server_configurable_flags",
Dan Willemsen4c939742016-12-06 15:44:57 -080039 ],
40
Risand57852c2018-11-02 04:51:14 +090041 product_variables: {
42 arc: {
43 exclude_srcs: [
44 "QuotaUtils.cpp",
45 ],
46 static_libs: [
47 "libarcdiskquota",
48 "arc_services_aidl",
49 ],
50 cflags: [
51 "-DUSE_ARC",
52 ],
53 },
54 },
55
Dan Willemsen4c939742016-12-06 15:44:57 -080056 clang: true,
Jeff Sharkeyc1149c92017-09-21 14:51:09 -060057
58 tidy: true,
59 tidy_checks: [
60 "-*",
61 "clang-analyzer-security*",
62 "cert-*",
63 "-cert-err58-cpp",
64 ],
65 tidy_flags: [
66 "-warnings-as-errors=clang-analyzer-security*,cert-*"
67 ],
Dan Willemsen4c939742016-12-06 15:44:57 -080068}
69
70//
71// Static library used in testing and executable
72//
73
74cc_library_static {
75 name: "libinstalld",
76 defaults: ["installd_defaults"],
77
78 export_include_dirs: ["."],
79 aidl: {
80 export_aidl_headers: true,
81 },
Risand57852c2018-11-02 04:51:14 +090082
83 product_variables: {
84 arc: {
85 exclude_srcs: [
86 "QuotaUtils.cpp",
87 ],
88 static_libs: [
89 "libarcdiskquota",
90 "arc_services_aidl",
91 ],
92 cflags: [
93 "-DUSE_ARC",
94 ],
95 },
96 },
97}
98
99cc_library_headers {
100 name: "libinstalld_headers",
101 export_include_dirs: ["."],
Dan Willemsen4c939742016-12-06 15:44:57 -0800102}
103
104//
105// Executable
106//
107
108cc_binary {
109 name: "installd",
110 defaults: ["installd_defaults"],
111 srcs: ["installd.cpp"],
112
113 static_libs: ["libdiskusage"],
114
115 init_rc: ["installd.rc"],
Risand57852c2018-11-02 04:51:14 +0900116
117 product_variables: {
118 arc: {
119 exclude_srcs: [
120 "QuotaUtils.cpp",
121 ],
122 static_libs: [
123 "libarcdiskquota",
124 "arc_services_aidl",
125 ],
126 cflags: [
127 "-DUSE_ARC",
128 ],
129 },
130 },
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100131
132 // Needs to be wherever installd is as it's execed by
133 // installd.
134 required: [ "migrate_legacy_obb_data.sh" ],
Dan Willemsen4c939742016-12-06 15:44:57 -0800135}
136
Dan Willemsen2a001e82016-08-05 14:06:41 -0700137// OTA chroot tool
138
139cc_binary {
140 name: "otapreopt_chroot",
141 cflags: [
142 "-Wall",
143 "-Werror",
144 ],
145 clang: true,
146
Roland Levillain94b41802019-01-18 11:56:50 +0000147 srcs: [
148 "otapreopt_chroot.cpp",
149 "otapreopt_utils.cpp",
150 ],
Dan Willemsen2a001e82016-08-05 14:06:41 -0700151 shared_libs: [
152 "libbase",
Martijn Coenen13eba262019-03-13 12:59:57 +0100153 "libbinder",
Dan Willemsen2a001e82016-08-05 14:06:41 -0700154 "liblog",
Roland Levillainc19c6042018-12-18 12:15:12 +0000155 "libprotobuf-cpp-full",
156 "libselinux",
Martijn Coenen13eba262019-03-13 12:59:57 +0100157 "libutils",
Roland Levillainc19c6042018-12-18 12:15:12 +0000158 "libziparchive",
159 ],
160 static_libs: [
161 "libapex",
162 "libapexd",
163 "lib_apex_manifest_proto",
164 "libavb",
165 "libdm",
Martijn Coenen13eba262019-03-13 12:59:57 +0100166 "libvold_binder",
Dan Willemsen2a001e82016-08-05 14:06:41 -0700167 ],
168}
Dan Willemsen4c939742016-12-06 15:44:57 -0800169
Colin Crossdd2dae92017-11-14 13:05:37 -0800170filegroup {
171 name: "installd_aidl",
172 srcs: [
173 "binder/android/os/IInstalld.aidl",
174 ],
175}
176
Calin Juravledff47292018-02-01 14:44:56 +0000177//
178// Static library for otapreopt used in testing
179//
180cc_library_static {
181 name: "libotapreoptparameters",
182 cflags: [
183 "-Wall",
184 "-Werror"
185 ],
Calin Juravledff47292018-02-01 14:44:56 +0000186
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700187 srcs: ["otapreopt_parameters.cpp"],
Calin Juravledff47292018-02-01 14:44:56 +0000188
189 export_include_dirs: ["."],
190
191 shared_libs: [
192 "libbase",
193 "libcutils",
194 "liblog",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700195 "libprocessgroup",
Calin Juravledff47292018-02-01 14:44:56 +0000196 "libutils",
197 ],
198}
199
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700200//
201// OTA Executable
202//
203
204cc_binary {
205 name: "otapreopt",
206 cflags: [
207 "-Wall",
208 "-Werror"
209 ],
210
211 srcs: [
212 "dexopt.cpp",
213 "globals.cpp",
214 "otapreopt.cpp",
Roland Levillain94b41802019-01-18 11:56:50 +0000215 "otapreopt_utils.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700216 "utils.cpp",
Oleksandr Peletskyid2be6322019-01-24 17:59:45 +0100217 "utils_default.cpp",
Eric Holk0ebbe0f2019-01-09 18:17:27 -0800218 "view_compiler.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700219 ],
220
221 header_libs: ["dex2oat_headers"],
222
223 static_libs: [
224 "libartimagevalues",
225 "libdiskusage",
226 "libotapreoptparameters",
227 ],
228
229 shared_libs: [
230 "libbase",
231 "libcrypto",
232 "libcutils",
233 "liblog",
234 "liblogwrap",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700235 "libprocessgroup",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700236 "libselinux",
237 "libutils",
Nicolas Geoffrayaaad21e2019-02-25 13:31:10 +0000238 "server_configurable_flags",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700239 ],
240}
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800241
242// OTA slot script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800243sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800244 name: "otapreopt_slot",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800245 src: "otapreopt_slot.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800246 init_rc: ["otapreopt.rc"],
247}
248
249// OTA postinstall script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800250sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800251 name: "otapreopt_script",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800252 src: "otapreopt_script.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800253 // Let this depend on otapreopt, the chroot tool and the slot script,
254 // so we just have to mention one in a configuration.
255 required: [
256 "otapreopt",
257 "otapreopt_chroot",
258 "otapreopt_slot",
259 ],
260}
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100261
262// Script to migrate legacy obb data.
263sh_binary {
264 name: "migrate_legacy_obb_data.sh",
265 src: "migrate_legacy_obb_data.sh"
266}