Bob Badour | 3306e49 | 2021-02-25 15:35:37 -0800 | [diff] [blame] | 1 | package { |
| 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 Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 10 | cc_defaults { |
| 11 | name: "installd_defaults", |
| 12 | |
| 13 | cflags: [ |
| 14 | "-Wall", |
| 15 | "-Werror", |
Jeff Sharkey | c1149c9 | 2017-09-21 14:51:09 -0600 | [diff] [blame] | 16 | "-Wextra", |
Andreas Gampe | fa2dadd | 2018-02-28 19:52:47 -0800 | [diff] [blame] | 17 | |
| 18 | "-Wunreachable-code", |
| 19 | "-Wunreachable-code-break", |
| 20 | "-Wunreachable-code-return", |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 21 | ], |
| 22 | srcs: [ |
Jeff Sharkey | 88ddd94 | 2017-01-17 18:05:54 -0700 | [diff] [blame] | 23 | "CacheItem.cpp", |
| 24 | "CacheTracker.cpp", |
Felka Chang | 2a0a246 | 2019-11-20 14:20:40 +0800 | [diff] [blame] | 25 | "CrateManager.cpp", |
Jeff Sharkey | f3e30b9 | 2016-12-09 17:06:57 -0700 | [diff] [blame] | 26 | "InstalldNativeService.cpp", |
Risan | 5f30826 | 2018-10-26 12:06:58 -0600 | [diff] [blame] | 27 | "QuotaUtils.cpp", |
Jeff Sharkey | 6c2c056 | 2016-12-07 12:12:00 -0700 | [diff] [blame] | 28 | "dexopt.cpp", |
Victor Hsieh | c9821f1 | 2020-08-07 11:32:29 -0700 | [diff] [blame] | 29 | "execv_helper.cpp", |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 30 | "globals.cpp", |
Keun young Park | b734226 | 2021-10-25 08:09:27 -0700 | [diff] [blame] | 31 | "restorable_file.cpp", |
Victor Hsieh | c9821f1 | 2020-08-07 11:32:29 -0700 | [diff] [blame] | 32 | "run_dex2oat.cpp", |
Victor Hsieh | cb35a06 | 2020-08-13 16:11:13 -0700 | [diff] [blame] | 33 | "unique_file.cpp", |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 34 | "utils.cpp", |
Oleksandr Peletskyi | d2be632 | 2019-01-24 17:59:45 +0100 | [diff] [blame] | 35 | "utils_default.cpp", |
Eric Holk | 0ebbe0f | 2019-01-09 18:17:27 -0800 | [diff] [blame] | 36 | "view_compiler.cpp", |
Colin Cross | dd2dae9 | 2017-11-14 13:05:37 -0800 | [diff] [blame] | 37 | ":installd_aidl", |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 38 | ], |
| 39 | shared_libs: [ |
| 40 | "libbase", |
| 41 | "libbinder", |
Alan Stokes | a25d90c | 2017-10-16 10:56:00 +0100 | [diff] [blame] | 42 | "libcrypto", |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 43 | "libcutils", |
| 44 | "liblog", |
| 45 | "liblogwrap", |
Suren Baghdasaryan | cd82905 | 2018-11-02 19:15:37 -0700 | [diff] [blame] | 46 | "libprocessgroup", |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 47 | "libselinux", |
| 48 | "libutils", |
Yang Tianping | 8f2a40e | 2021-10-29 14:39:02 +0800 | [diff] [blame] | 49 | "libziparchive", |
Nicolas Geoffray | aaad21e | 2019-02-25 13:31:10 +0000 | [diff] [blame] | 50 | "server_configurable_flags", |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 51 | ], |
Martijn Coenen | 6de402a | 2021-04-26 16:23:40 +0200 | [diff] [blame] | 52 | static_libs: [ |
| 53 | "libasync_safe", |
Alex Buynytskyy | 4ab5d53 | 2022-02-17 21:20:10 +0000 | [diff] [blame] | 54 | "libext2_uuid", |
Martijn Coenen | 6de402a | 2021-04-26 16:23:40 +0200 | [diff] [blame] | 55 | ], |
Jooyung Han | dc41366 | 2021-02-04 18:18:28 +0900 | [diff] [blame] | 56 | export_shared_lib_headers: [ |
| 57 | "libbinder", |
| 58 | ], |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 59 | |
Risan | d57852c | 2018-11-02 04:51:14 +0900 | [diff] [blame] | 60 | product_variables: { |
| 61 | arc: { |
| 62 | exclude_srcs: [ |
| 63 | "QuotaUtils.cpp", |
| 64 | ], |
| 65 | static_libs: [ |
| 66 | "libarcdiskquota", |
| 67 | "arc_services_aidl", |
| 68 | ], |
| 69 | cflags: [ |
| 70 | "-DUSE_ARC", |
| 71 | ], |
| 72 | }, |
| 73 | }, |
| 74 | |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 75 | clang: true, |
Jeff Sharkey | c1149c9 | 2017-09-21 14:51:09 -0600 | [diff] [blame] | 76 | |
| 77 | tidy: true, |
| 78 | tidy_checks: [ |
| 79 | "-*", |
| 80 | "clang-analyzer-security*", |
| 81 | "cert-*", |
| 82 | "-cert-err58-cpp", |
| 83 | ], |
Chih-Hung Hsieh | 8c18eb4 | 2022-04-27 16:00:44 -0700 | [diff] [blame^] | 84 | tidy_checks_as_errors: [ |
| 85 | "clang-analyzer-security*", |
| 86 | "cert-*", |
Jeff Sharkey | c1149c9 | 2017-09-21 14:51:09 -0600 | [diff] [blame] | 87 | ], |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 88 | } |
| 89 | |
| 90 | // |
| 91 | // Static library used in testing and executable |
| 92 | // |
| 93 | |
| 94 | cc_library_static { |
| 95 | name: "libinstalld", |
| 96 | defaults: ["installd_defaults"], |
| 97 | |
| 98 | export_include_dirs: ["."], |
| 99 | aidl: { |
| 100 | export_aidl_headers: true, |
| 101 | }, |
Risan | d57852c | 2018-11-02 04:51:14 +0900 | [diff] [blame] | 102 | |
| 103 | product_variables: { |
| 104 | arc: { |
| 105 | exclude_srcs: [ |
| 106 | "QuotaUtils.cpp", |
| 107 | ], |
| 108 | static_libs: [ |
| 109 | "libarcdiskquota", |
| 110 | "arc_services_aidl", |
| 111 | ], |
| 112 | cflags: [ |
| 113 | "-DUSE_ARC", |
| 114 | ], |
| 115 | }, |
| 116 | }, |
| 117 | } |
| 118 | |
| 119 | cc_library_headers { |
| 120 | name: "libinstalld_headers", |
| 121 | export_include_dirs: ["."], |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 122 | } |
| 123 | |
| 124 | // |
Victor Hsieh | c9821f1 | 2020-08-07 11:32:29 -0700 | [diff] [blame] | 125 | // Unit tests |
| 126 | // |
| 127 | |
| 128 | cc_test_host { |
| 129 | name: "run_dex2oat_test", |
| 130 | test_suites: ["general-tests"], |
| 131 | clang: true, |
| 132 | srcs: [ |
| 133 | "run_dex2oat_test.cpp", |
| 134 | "run_dex2oat.cpp", |
Victor Hsieh | cb35a06 | 2020-08-13 16:11:13 -0700 | [diff] [blame] | 135 | "unique_file.cpp", |
Victor Hsieh | c9821f1 | 2020-08-07 11:32:29 -0700 | [diff] [blame] | 136 | "execv_helper.cpp", |
| 137 | ], |
Keun young Park | b734226 | 2021-10-25 08:09:27 -0700 | [diff] [blame] | 138 | cflags: [ |
| 139 | "-Wall", |
| 140 | "-Werror", |
| 141 | ], |
Victor Hsieh | c9821f1 | 2020-08-07 11:32:29 -0700 | [diff] [blame] | 142 | shared_libs: [ |
| 143 | "libbase", |
| 144 | "server_configurable_flags", |
| 145 | ], |
Victor Hsieh | c9821f1 | 2020-08-07 11:32:29 -0700 | [diff] [blame] | 146 | test_config: "run_dex2oat_test.xml", |
| 147 | } |
| 148 | |
| 149 | // |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 150 | // Executable |
| 151 | // |
| 152 | |
| 153 | cc_binary { |
| 154 | name: "installd", |
| 155 | defaults: ["installd_defaults"], |
| 156 | srcs: ["installd.cpp"], |
| 157 | |
| 158 | static_libs: ["libdiskusage"], |
| 159 | |
| 160 | init_rc: ["installd.rc"], |
Risan | d57852c | 2018-11-02 04:51:14 +0900 | [diff] [blame] | 161 | |
| 162 | product_variables: { |
| 163 | arc: { |
| 164 | exclude_srcs: [ |
| 165 | "QuotaUtils.cpp", |
| 166 | ], |
| 167 | static_libs: [ |
| 168 | "libarcdiskquota", |
| 169 | "arc_services_aidl", |
| 170 | ], |
| 171 | cflags: [ |
| 172 | "-DUSE_ARC", |
| 173 | ], |
| 174 | }, |
| 175 | }, |
Narayan Kamath | 28ab93b | 2019-05-15 18:29:44 +0100 | [diff] [blame] | 176 | |
| 177 | // Needs to be wherever installd is as it's execed by |
| 178 | // installd. |
Keun young Park | b734226 | 2021-10-25 08:09:27 -0700 | [diff] [blame] | 179 | required: ["migrate_legacy_obb_data.sh"], |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 180 | } |
| 181 | |
Dan Willemsen | 2a001e8 | 2016-08-05 14:06:41 -0700 | [diff] [blame] | 182 | // OTA chroot tool |
| 183 | |
| 184 | cc_binary { |
| 185 | name: "otapreopt_chroot", |
Martijn Coenen | 8af07d9 | 2019-07-03 14:56:39 +0200 | [diff] [blame] | 186 | defaults: ["libapexd-deps"], |
Dan Willemsen | 2a001e8 | 2016-08-05 14:06:41 -0700 | [diff] [blame] | 187 | cflags: [ |
| 188 | "-Wall", |
| 189 | "-Werror", |
| 190 | ], |
| 191 | clang: true, |
| 192 | |
Roland Levillain | 94b4180 | 2019-01-18 11:56:50 +0000 | [diff] [blame] | 193 | srcs: [ |
| 194 | "otapreopt_chroot.cpp", |
| 195 | "otapreopt_utils.cpp", |
| 196 | ], |
Dan Willemsen | 2a001e8 | 2016-08-05 14:06:41 -0700 | [diff] [blame] | 197 | shared_libs: [ |
| 198 | "libbase", |
| 199 | "liblog", |
Martijn Coenen | 13eba26 | 2019-03-13 12:59:57 +0100 | [diff] [blame] | 200 | "libutils", |
Roland Levillain | c19c604 | 2018-12-18 12:15:12 +0000 | [diff] [blame] | 201 | ], |
Alex Light | 2ca8b86 | 2021-03-09 16:39:55 -0800 | [diff] [blame] | 202 | required: [ |
Keun young Park | b734226 | 2021-10-25 08:09:27 -0700 | [diff] [blame] | 203 | "apexd", |
Dan Willemsen | 2a001e8 | 2016-08-05 14:06:41 -0700 | [diff] [blame] | 204 | ], |
| 205 | } |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 206 | |
Colin Cross | dd2dae9 | 2017-11-14 13:05:37 -0800 | [diff] [blame] | 207 | filegroup { |
| 208 | name: "installd_aidl", |
| 209 | srcs: [ |
Jeff Sharkey | 8d3848b | 2020-08-13 14:16:46 -0600 | [diff] [blame] | 210 | "binder/**/*.aidl", |
Colin Cross | dd2dae9 | 2017-11-14 13:05:37 -0800 | [diff] [blame] | 211 | ], |
Dan Willemsen | a5d6522 | 2018-09-14 21:27:01 -0700 | [diff] [blame] | 212 | path: "binder", |
Colin Cross | dd2dae9 | 2017-11-14 13:05:37 -0800 | [diff] [blame] | 213 | } |
| 214 | |
Calin Juravle | dff4729 | 2018-02-01 14:44:56 +0000 | [diff] [blame] | 215 | // |
| 216 | // Static library for otapreopt used in testing |
| 217 | // |
| 218 | cc_library_static { |
| 219 | name: "libotapreoptparameters", |
| 220 | cflags: [ |
| 221 | "-Wall", |
Keun young Park | b734226 | 2021-10-25 08:09:27 -0700 | [diff] [blame] | 222 | "-Werror", |
Calin Juravle | dff4729 | 2018-02-01 14:44:56 +0000 | [diff] [blame] | 223 | ], |
Calin Juravle | dff4729 | 2018-02-01 14:44:56 +0000 | [diff] [blame] | 224 | |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 225 | srcs: ["otapreopt_parameters.cpp"], |
Calin Juravle | dff4729 | 2018-02-01 14:44:56 +0000 | [diff] [blame] | 226 | |
| 227 | export_include_dirs: ["."], |
| 228 | |
| 229 | shared_libs: [ |
| 230 | "libbase", |
| 231 | "libcutils", |
| 232 | "liblog", |
Suren Baghdasaryan | cd82905 | 2018-11-02 19:15:37 -0700 | [diff] [blame] | 233 | "libprocessgroup", |
Calin Juravle | dff4729 | 2018-02-01 14:44:56 +0000 | [diff] [blame] | 234 | "libutils", |
| 235 | ], |
| 236 | } |
| 237 | |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 238 | // |
| 239 | // OTA Executable |
| 240 | // |
| 241 | |
| 242 | cc_binary { |
| 243 | name: "otapreopt", |
| 244 | cflags: [ |
| 245 | "-Wall", |
Keun young Park | b734226 | 2021-10-25 08:09:27 -0700 | [diff] [blame] | 246 | "-Werror", |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 247 | ], |
| 248 | |
| 249 | srcs: [ |
| 250 | "dexopt.cpp", |
Victor Hsieh | c9821f1 | 2020-08-07 11:32:29 -0700 | [diff] [blame] | 251 | "execv_helper.cpp", |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 252 | "globals.cpp", |
| 253 | "otapreopt.cpp", |
Roland Levillain | 94b4180 | 2019-01-18 11:56:50 +0000 | [diff] [blame] | 254 | "otapreopt_utils.cpp", |
Keun young Park | b734226 | 2021-10-25 08:09:27 -0700 | [diff] [blame] | 255 | "restorable_file.cpp", |
Victor Hsieh | c9821f1 | 2020-08-07 11:32:29 -0700 | [diff] [blame] | 256 | "run_dex2oat.cpp", |
Victor Hsieh | cb35a06 | 2020-08-13 16:11:13 -0700 | [diff] [blame] | 257 | "unique_file.cpp", |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 258 | "utils.cpp", |
Oleksandr Peletskyi | d2be632 | 2019-01-24 17:59:45 +0100 | [diff] [blame] | 259 | "utils_default.cpp", |
Eric Holk | 0ebbe0f | 2019-01-09 18:17:27 -0800 | [diff] [blame] | 260 | "view_compiler.cpp", |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 261 | ], |
| 262 | |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 263 | static_libs: [ |
Martijn Coenen | 6de402a | 2021-04-26 16:23:40 +0200 | [diff] [blame] | 264 | "libasync_safe", |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 265 | "libdiskusage", |
| 266 | "libotapreoptparameters", |
Alex Buynytskyy | 4ab5d53 | 2022-02-17 21:20:10 +0000 | [diff] [blame] | 267 | "libext2_uuid", |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 268 | ], |
| 269 | |
| 270 | shared_libs: [ |
| 271 | "libbase", |
| 272 | "libcrypto", |
| 273 | "libcutils", |
| 274 | "liblog", |
| 275 | "liblogwrap", |
Suren Baghdasaryan | cd82905 | 2018-11-02 19:15:37 -0700 | [diff] [blame] | 276 | "libprocessgroup", |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 277 | "libselinux", |
| 278 | "libutils", |
Yang Tianping | 8f2a40e | 2021-10-29 14:39:02 +0800 | [diff] [blame] | 279 | "libziparchive", |
Nicolas Geoffray | aaad21e | 2019-02-25 13:31:10 +0000 | [diff] [blame] | 280 | "server_configurable_flags", |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 281 | ], |
| 282 | } |
Sasha Smundak | 6a6bdad | 2019-01-24 23:20:47 -0800 | [diff] [blame] | 283 | |
| 284 | // OTA slot script |
Sasha Smundak | 1fa4b8d | 2019-02-04 11:20:58 -0800 | [diff] [blame] | 285 | sh_binary { |
Sasha Smundak | 6a6bdad | 2019-01-24 23:20:47 -0800 | [diff] [blame] | 286 | name: "otapreopt_slot", |
Sasha Smundak | 1fa4b8d | 2019-02-04 11:20:58 -0800 | [diff] [blame] | 287 | src: "otapreopt_slot.sh", |
Sasha Smundak | 6a6bdad | 2019-01-24 23:20:47 -0800 | [diff] [blame] | 288 | init_rc: ["otapreopt.rc"], |
| 289 | } |
| 290 | |
| 291 | // OTA postinstall script |
Sasha Smundak | 1fa4b8d | 2019-02-04 11:20:58 -0800 | [diff] [blame] | 292 | sh_binary { |
Sasha Smundak | 6a6bdad | 2019-01-24 23:20:47 -0800 | [diff] [blame] | 293 | name: "otapreopt_script", |
Sasha Smundak | 1fa4b8d | 2019-02-04 11:20:58 -0800 | [diff] [blame] | 294 | src: "otapreopt_script.sh", |
Sasha Smundak | 6a6bdad | 2019-01-24 23:20:47 -0800 | [diff] [blame] | 295 | // Let this depend on otapreopt, the chroot tool and the slot script, |
| 296 | // so we just have to mention one in a configuration. |
| 297 | required: [ |
| 298 | "otapreopt", |
| 299 | "otapreopt_chroot", |
| 300 | "otapreopt_slot", |
| 301 | ], |
| 302 | } |
Narayan Kamath | 28ab93b | 2019-05-15 18:29:44 +0100 | [diff] [blame] | 303 | |
| 304 | // Script to migrate legacy obb data. |
| 305 | sh_binary { |
| 306 | name: "migrate_legacy_obb_data.sh", |
Keun young Park | b734226 | 2021-10-25 08:09:27 -0700 | [diff] [blame] | 307 | src: "migrate_legacy_obb_data.sh", |
Narayan Kamath | 28ab93b | 2019-05-15 18:29:44 +0100 | [diff] [blame] | 308 | } |