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