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