Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 1 | cc_defaults { |
| 2 | name: "installd_defaults", |
| 3 | |
| 4 | cflags: [ |
| 5 | "-Wall", |
| 6 | "-Werror", |
Jeff Sharkey | c1149c9 | 2017-09-21 14:51:09 -0600 | [diff] [blame] | 7 | "-Wextra", |
Andreas Gampe | fa2dadd | 2018-02-28 19:52:47 -0800 | [diff] [blame] | 8 | |
| 9 | "-Wunreachable-code", |
| 10 | "-Wunreachable-code-break", |
| 11 | "-Wunreachable-code-return", |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 12 | ], |
| 13 | srcs: [ |
Jeff Sharkey | 88ddd94 | 2017-01-17 18:05:54 -0700 | [diff] [blame] | 14 | "CacheItem.cpp", |
| 15 | "CacheTracker.cpp", |
Jeff Sharkey | f3e30b9 | 2016-12-09 17:06:57 -0700 | [diff] [blame] | 16 | "InstalldNativeService.cpp", |
Risan | 5f30826 | 2018-10-26 12:06:58 -0600 | [diff] [blame] | 17 | "QuotaUtils.cpp", |
Jeff Sharkey | 6c2c056 | 2016-12-07 12:12:00 -0700 | [diff] [blame] | 18 | "dexopt.cpp", |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 19 | "globals.cpp", |
| 20 | "utils.cpp", |
Oleksandr Peletskyi | d2be632 | 2019-01-24 17:59:45 +0100 | [diff] [blame] | 21 | "utils_default.cpp", |
Eric Holk | 0ebbe0f | 2019-01-09 18:17:27 -0800 | [diff] [blame] | 22 | "view_compiler.cpp", |
Colin Cross | dd2dae9 | 2017-11-14 13:05:37 -0800 | [diff] [blame] | 23 | ":installd_aidl", |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 24 | ], |
Andreas Gampe | fa2dadd | 2018-02-28 19:52:47 -0800 | [diff] [blame] | 25 | header_libs: [ |
| 26 | "dex2oat_headers", |
| 27 | ], |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 28 | shared_libs: [ |
| 29 | "libbase", |
| 30 | "libbinder", |
Alan Stokes | a25d90c | 2017-10-16 10:56:00 +0100 | [diff] [blame] | 31 | "libcrypto", |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 32 | "libcutils", |
| 33 | "liblog", |
| 34 | "liblogwrap", |
Suren Baghdasaryan | cd82905 | 2018-11-02 19:15:37 -0700 | [diff] [blame] | 35 | "libprocessgroup", |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 36 | "libselinux", |
| 37 | "libutils", |
Nicolas Geoffray | aaad21e | 2019-02-25 13:31:10 +0000 | [diff] [blame] | 38 | "server_configurable_flags", |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 39 | ], |
| 40 | |
Risan | d57852c | 2018-11-02 04:51:14 +0900 | [diff] [blame] | 41 | 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 Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 56 | clang: true, |
Jeff Sharkey | c1149c9 | 2017-09-21 14:51:09 -0600 | [diff] [blame] | 57 | |
| 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 Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 68 | } |
| 69 | |
| 70 | // |
| 71 | // Static library used in testing and executable |
| 72 | // |
| 73 | |
| 74 | cc_library_static { |
| 75 | name: "libinstalld", |
| 76 | defaults: ["installd_defaults"], |
| 77 | |
| 78 | export_include_dirs: ["."], |
| 79 | aidl: { |
| 80 | export_aidl_headers: true, |
| 81 | }, |
Risan | d57852c | 2018-11-02 04:51:14 +0900 | [diff] [blame] | 82 | |
| 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 | |
| 99 | cc_library_headers { |
| 100 | name: "libinstalld_headers", |
| 101 | export_include_dirs: ["."], |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 102 | } |
| 103 | |
| 104 | // |
| 105 | // Executable |
| 106 | // |
| 107 | |
| 108 | cc_binary { |
| 109 | name: "installd", |
| 110 | defaults: ["installd_defaults"], |
| 111 | srcs: ["installd.cpp"], |
| 112 | |
| 113 | static_libs: ["libdiskusage"], |
| 114 | |
| 115 | init_rc: ["installd.rc"], |
Risan | d57852c | 2018-11-02 04:51:14 +0900 | [diff] [blame] | 116 | |
| 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 Kamath | 28ab93b | 2019-05-15 18:29:44 +0100 | [diff] [blame] | 131 | |
| 132 | // Needs to be wherever installd is as it's execed by |
| 133 | // installd. |
| 134 | required: [ "migrate_legacy_obb_data.sh" ], |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 135 | } |
| 136 | |
Dan Willemsen | 2a001e8 | 2016-08-05 14:06:41 -0700 | [diff] [blame] | 137 | // OTA chroot tool |
| 138 | |
| 139 | cc_binary { |
| 140 | name: "otapreopt_chroot", |
Martijn Coenen | 8af07d9 | 2019-07-03 14:56:39 +0200 | [diff] [blame] | 141 | defaults: ["libapexd-deps"], |
Dan Willemsen | 2a001e8 | 2016-08-05 14:06:41 -0700 | [diff] [blame] | 142 | cflags: [ |
| 143 | "-Wall", |
| 144 | "-Werror", |
| 145 | ], |
| 146 | clang: true, |
| 147 | |
Roland Levillain | 94b4180 | 2019-01-18 11:56:50 +0000 | [diff] [blame] | 148 | srcs: [ |
| 149 | "otapreopt_chroot.cpp", |
| 150 | "otapreopt_utils.cpp", |
| 151 | ], |
Dan Willemsen | 2a001e8 | 2016-08-05 14:06:41 -0700 | [diff] [blame] | 152 | shared_libs: [ |
| 153 | "libbase", |
| 154 | "liblog", |
Martijn Coenen | 13eba26 | 2019-03-13 12:59:57 +0100 | [diff] [blame] | 155 | "libutils", |
Roland Levillain | c19c604 | 2018-12-18 12:15:12 +0000 | [diff] [blame] | 156 | ], |
| 157 | static_libs: [ |
Roland Levillain | c19c604 | 2018-12-18 12:15:12 +0000 | [diff] [blame] | 158 | "libapexd", |
Dan Willemsen | 2a001e8 | 2016-08-05 14:06:41 -0700 | [diff] [blame] | 159 | ], |
| 160 | } |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 161 | |
Colin Cross | dd2dae9 | 2017-11-14 13:05:37 -0800 | [diff] [blame] | 162 | filegroup { |
| 163 | name: "installd_aidl", |
| 164 | srcs: [ |
| 165 | "binder/android/os/IInstalld.aidl", |
| 166 | ], |
Dan Willemsen | a5d6522 | 2018-09-14 21:27:01 -0700 | [diff] [blame] | 167 | path: "binder", |
Colin Cross | dd2dae9 | 2017-11-14 13:05:37 -0800 | [diff] [blame] | 168 | } |
| 169 | |
Calin Juravle | dff4729 | 2018-02-01 14:44:56 +0000 | [diff] [blame] | 170 | // |
| 171 | // Static library for otapreopt used in testing |
| 172 | // |
| 173 | cc_library_static { |
| 174 | name: "libotapreoptparameters", |
| 175 | cflags: [ |
| 176 | "-Wall", |
| 177 | "-Werror" |
| 178 | ], |
Calin Juravle | dff4729 | 2018-02-01 14:44:56 +0000 | [diff] [blame] | 179 | |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 180 | srcs: ["otapreopt_parameters.cpp"], |
Calin Juravle | dff4729 | 2018-02-01 14:44:56 +0000 | [diff] [blame] | 181 | |
| 182 | export_include_dirs: ["."], |
| 183 | |
| 184 | shared_libs: [ |
| 185 | "libbase", |
| 186 | "libcutils", |
| 187 | "liblog", |
Suren Baghdasaryan | cd82905 | 2018-11-02 19:15:37 -0700 | [diff] [blame] | 188 | "libprocessgroup", |
Calin Juravle | dff4729 | 2018-02-01 14:44:56 +0000 | [diff] [blame] | 189 | "libutils", |
| 190 | ], |
| 191 | } |
| 192 | |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 193 | // |
| 194 | // OTA Executable |
| 195 | // |
| 196 | |
| 197 | cc_binary { |
| 198 | name: "otapreopt", |
| 199 | cflags: [ |
| 200 | "-Wall", |
| 201 | "-Werror" |
| 202 | ], |
| 203 | |
| 204 | srcs: [ |
| 205 | "dexopt.cpp", |
| 206 | "globals.cpp", |
| 207 | "otapreopt.cpp", |
Roland Levillain | 94b4180 | 2019-01-18 11:56:50 +0000 | [diff] [blame] | 208 | "otapreopt_utils.cpp", |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 209 | "utils.cpp", |
Oleksandr Peletskyi | d2be632 | 2019-01-24 17:59:45 +0100 | [diff] [blame] | 210 | "utils_default.cpp", |
Eric Holk | 0ebbe0f | 2019-01-09 18:17:27 -0800 | [diff] [blame] | 211 | "view_compiler.cpp", |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 212 | ], |
| 213 | |
| 214 | header_libs: ["dex2oat_headers"], |
| 215 | |
| 216 | static_libs: [ |
| 217 | "libartimagevalues", |
| 218 | "libdiskusage", |
| 219 | "libotapreoptparameters", |
| 220 | ], |
| 221 | |
| 222 | shared_libs: [ |
| 223 | "libbase", |
| 224 | "libcrypto", |
| 225 | "libcutils", |
| 226 | "liblog", |
| 227 | "liblogwrap", |
Suren Baghdasaryan | cd82905 | 2018-11-02 19:15:37 -0700 | [diff] [blame] | 228 | "libprocessgroup", |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 229 | "libselinux", |
| 230 | "libutils", |
Nicolas Geoffray | aaad21e | 2019-02-25 13:31:10 +0000 | [diff] [blame] | 231 | "server_configurable_flags", |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 232 | ], |
| 233 | } |
Sasha Smundak | 6a6bdad | 2019-01-24 23:20:47 -0800 | [diff] [blame] | 234 | |
| 235 | // OTA slot script |
Sasha Smundak | 1fa4b8d | 2019-02-04 11:20:58 -0800 | [diff] [blame] | 236 | sh_binary { |
Sasha Smundak | 6a6bdad | 2019-01-24 23:20:47 -0800 | [diff] [blame] | 237 | name: "otapreopt_slot", |
Sasha Smundak | 1fa4b8d | 2019-02-04 11:20:58 -0800 | [diff] [blame] | 238 | src: "otapreopt_slot.sh", |
Sasha Smundak | 6a6bdad | 2019-01-24 23:20:47 -0800 | [diff] [blame] | 239 | init_rc: ["otapreopt.rc"], |
| 240 | } |
| 241 | |
| 242 | // OTA postinstall script |
Sasha Smundak | 1fa4b8d | 2019-02-04 11:20:58 -0800 | [diff] [blame] | 243 | sh_binary { |
Sasha Smundak | 6a6bdad | 2019-01-24 23:20:47 -0800 | [diff] [blame] | 244 | name: "otapreopt_script", |
Sasha Smundak | 1fa4b8d | 2019-02-04 11:20:58 -0800 | [diff] [blame] | 245 | src: "otapreopt_script.sh", |
Sasha Smundak | 6a6bdad | 2019-01-24 23:20:47 -0800 | [diff] [blame] | 246 | // Let this depend on otapreopt, the chroot tool and the slot script, |
| 247 | // so we just have to mention one in a configuration. |
| 248 | required: [ |
| 249 | "otapreopt", |
| 250 | "otapreopt_chroot", |
| 251 | "otapreopt_slot", |
| 252 | ], |
| 253 | } |
Narayan Kamath | 28ab93b | 2019-05-15 18:29:44 +0100 | [diff] [blame] | 254 | |
| 255 | // Script to migrate legacy obb data. |
| 256 | sh_binary { |
| 257 | name: "migrate_legacy_obb_data.sh", |
| 258 | src: "migrate_legacy_obb_data.sh" |
| 259 | } |