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