Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 1 | cc_defaults { |
| 2 | name: "vold_default_flags", |
| 3 | |
| 4 | cflags: [ |
| 5 | "-Wall", |
| 6 | "-Werror", |
| 7 | "-Wextra", |
| 8 | "-Wno-missing-field-initializers", |
| 9 | "-Wno-unused-parameter", |
| 10 | "-Wno-unused-variable", |
| 11 | ], |
| 12 | |
| 13 | clang: true, |
| 14 | |
| 15 | tidy: true, |
| 16 | tidy_checks: [ |
| 17 | "-*", |
| 18 | "cert-*", |
| 19 | "clang-analyzer-security*", |
Nick Kralevich | d78fb53 | 2019-03-29 16:07:58 -0700 | [diff] [blame] | 20 | "android-*", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 21 | ], |
| 22 | tidy_flags: [ |
| 23 | "-warnings-as-errors=clang-analyzer-security*,cert-*", |
| 24 | ], |
| 25 | } |
| 26 | |
| 27 | cc_defaults { |
| 28 | name: "vold_default_libs", |
| 29 | |
| 30 | static_libs: [ |
| 31 | "libavb", |
| 32 | "libbootloader_message", |
David Anderson | b922473 | 2019-05-13 13:02:54 -0700 | [diff] [blame] | 33 | "libdm", |
David Anderson | 10de69d | 2019-06-27 13:40:09 -0700 | [diff] [blame] | 34 | "libext2_uuid", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 35 | "libfec", |
| 36 | "libfec_rs", |
Bowgo Tsai | 549fd0e | 2018-11-29 22:15:08 +0800 | [diff] [blame] | 37 | "libfs_avb", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 38 | "libfs_mgr", |
| 39 | "libscrypt_static", |
| 40 | "libsquashfs_utils", |
| 41 | "libvold_binder", |
| 42 | ], |
| 43 | shared_libs: [ |
| 44 | "android.hardware.keymaster@3.0", |
Shawn Willden | 3535181 | 2018-01-22 09:08:32 -0700 | [diff] [blame] | 45 | "android.hardware.keymaster@4.0", |
Daniel Rosenberg | d399249 | 2018-10-02 17:40:44 -0700 | [diff] [blame] | 46 | "android.hardware.boot@1.0", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 47 | "libbase", |
| 48 | "libbinder", |
| 49 | "libcrypto", |
| 50 | "libcrypto_utils", |
| 51 | "libcutils", |
| 52 | "libdiskconfig", |
| 53 | "libext4_utils", |
| 54 | "libf2fs_sparseblock", |
| 55 | "libhardware", |
| 56 | "libhardware_legacy", |
Songchun Fan | ab55cec | 2019-12-02 10:50:12 -0800 | [diff] [blame] | 57 | "libincfs", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 58 | "libhidlbase", |
Shawn Willden | 3535181 | 2018-01-22 09:08:32 -0700 | [diff] [blame] | 59 | "libkeymaster4support", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 60 | "libkeyutils", |
| 61 | "liblog", |
| 62 | "liblogwrap", |
| 63 | "libselinux", |
| 64 | "libsysutils", |
| 65 | "libutils", |
| 66 | ], |
| 67 | } |
| 68 | |
| 69 | cc_library_static { |
| 70 | name: "libvold_binder", |
| 71 | defaults: ["vold_default_flags"], |
| 72 | |
| 73 | srcs: [ |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 74 | ":vold_aidl", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 75 | ], |
| 76 | shared_libs: [ |
| 77 | "libbinder", |
| 78 | "libutils", |
| 79 | ], |
| 80 | aidl: { |
| 81 | local_include_dirs: ["binder"], |
Songchun Fan | ab55cec | 2019-12-02 10:50:12 -0800 | [diff] [blame] | 82 | include_dirs: [ |
| 83 | "frameworks/native/aidl/binder", |
Jiyong Park | 50c3ab6 | 2020-01-20 12:37:52 +0900 | [diff] [blame^] | 84 | "frameworks/base/core/java", |
Songchun Fan | ab55cec | 2019-12-02 10:50:12 -0800 | [diff] [blame] | 85 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 86 | export_aidl_headers: true, |
| 87 | }, |
Songchun Fan | ab55cec | 2019-12-02 10:50:12 -0800 | [diff] [blame] | 88 | whole_static_libs: [ |
| 89 | "libincremental_aidl-cpp", |
| 90 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 91 | } |
| 92 | |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 93 | cc_library_headers { |
| 94 | name: "libvold_headers", |
Tao Bao | b1bbc70 | 2019-10-01 23:31:17 -0700 | [diff] [blame] | 95 | recovery_available: true, |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 96 | export_include_dirs: ["."], |
| 97 | } |
| 98 | |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 99 | // Static library factored out to support testing |
| 100 | cc_library_static { |
| 101 | name: "libvold", |
| 102 | defaults: [ |
| 103 | "vold_default_flags", |
| 104 | "vold_default_libs", |
| 105 | ], |
| 106 | |
| 107 | srcs: [ |
Risan | ac02a48 | 2018-10-31 21:59:47 -0600 | [diff] [blame] | 108 | "AppFuseUtil.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 109 | "Benchmark.cpp", |
Jeff Sharkey | 2048a28 | 2017-06-15 09:59:43 -0600 | [diff] [blame] | 110 | "CheckEncryption.cpp", |
Daniel Rosenberg | 65f99c9 | 2018-08-28 01:58:49 -0700 | [diff] [blame] | 111 | "Checkpoint.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 112 | "Devmapper.cpp", |
| 113 | "EncryptInplace.cpp", |
Jeff Sharkey | 2048a28 | 2017-06-15 09:59:43 -0600 | [diff] [blame] | 114 | "FileDeviceUtils.cpp", |
Eric Biggers | a701c45 | 2018-10-23 13:06:55 -0700 | [diff] [blame] | 115 | "FsCrypt.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 116 | "IdleMaint.cpp", |
| 117 | "KeyBuffer.cpp", |
| 118 | "KeyStorage.cpp", |
| 119 | "KeyUtil.cpp", |
| 120 | "Keymaster.cpp", |
| 121 | "Loop.cpp", |
| 122 | "MetadataCrypt.cpp", |
| 123 | "MoveStorage.cpp", |
| 124 | "NetlinkHandler.cpp", |
| 125 | "NetlinkManager.cpp", |
| 126 | "Process.cpp", |
| 127 | "ScryptParameters.cpp", |
| 128 | "Utils.cpp", |
| 129 | "VoldNativeService.cpp", |
| 130 | "VoldUtil.cpp", |
| 131 | "VolumeManager.cpp", |
| 132 | "cryptfs.cpp", |
Jeff Sharkey | 37ba125 | 2018-01-19 10:55:18 +0900 | [diff] [blame] | 133 | "fs/Exfat.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 134 | "fs/Ext4.cpp", |
| 135 | "fs/F2fs.cpp", |
| 136 | "fs/Vfat.cpp", |
| 137 | "model/Disk.cpp", |
| 138 | "model/EmulatedVolume.cpp", |
| 139 | "model/ObbVolume.cpp", |
| 140 | "model/PrivateVolume.cpp", |
| 141 | "model/PublicVolume.cpp", |
| 142 | "model/VolumeBase.cpp", |
Risan | 8c9f332 | 2018-10-29 08:52:56 +0900 | [diff] [blame] | 143 | "model/StubVolume.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 144 | ], |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 145 | product_variables: { |
| 146 | arc: { |
| 147 | exclude_srcs: [ |
Risan | dcbd4fc | 2018-11-02 01:26:31 +0900 | [diff] [blame] | 148 | "AppFuseUtil.cpp", |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 149 | "model/ObbVolume.cpp", |
| 150 | ], |
| 151 | static_libs: [ |
Risan | ea2d2bb | 2018-02-23 08:12:37 +0900 | [diff] [blame] | 152 | "arc_services_aidl", |
Risan | dcbd4fc | 2018-11-02 01:26:31 +0900 | [diff] [blame] | 153 | "libarcappfuse", |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 154 | "libarcobbvolume", |
| 155 | ], |
| 156 | }, |
Mark Salyzyn | c4405e9 | 2018-09-20 10:09:27 -0700 | [diff] [blame] | 157 | debuggable: { |
| 158 | cppflags: ["-D__ANDROID_DEBUGGABLE__"], |
| 159 | }, |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 160 | }, |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 161 | shared_libs: [ |
Yifan Hong | 91a68df | 2018-09-19 10:28:16 -0700 | [diff] [blame] | 162 | "android.hardware.health.storage@1.0", |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 163 | ], |
Jiyong Park | 8d21c92 | 2019-01-04 13:35:25 +0900 | [diff] [blame] | 164 | whole_static_libs: [ |
| 165 | "com.android.sysprop.apex", |
| 166 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 167 | } |
| 168 | |
| 169 | cc_binary { |
| 170 | name: "vold", |
| 171 | defaults: [ |
| 172 | "vold_default_flags", |
| 173 | "vold_default_libs", |
| 174 | ], |
| 175 | |
| 176 | srcs: ["main.cpp"], |
| 177 | static_libs: ["libvold"], |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 178 | product_variables: { |
| 179 | arc: { |
| 180 | static_libs: [ |
Risan | ea2d2bb | 2018-02-23 08:12:37 +0900 | [diff] [blame] | 181 | "arc_services_aidl", |
Risan | dcbd4fc | 2018-11-02 01:26:31 +0900 | [diff] [blame] | 182 | "libarcappfuse", |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 183 | "libarcobbvolume", |
Risan | 9929e7d | 2018-01-22 11:04:25 +0900 | [diff] [blame] | 184 | ], |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 185 | }, |
| 186 | }, |
Wei Wang | f5b085c | 2018-05-15 16:12:20 -0700 | [diff] [blame] | 187 | init_rc: [ |
| 188 | "vold.rc", |
| 189 | "wait_for_keymaster.rc", |
| 190 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 191 | |
| 192 | required: [ |
| 193 | "mke2fs", |
| 194 | "vold_prepare_subdirs", |
Paul Crowley | 8f82879 | 2018-02-07 14:41:26 -0800 | [diff] [blame] | 195 | "wait_for_keymaster", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 196 | ], |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 197 | |
| 198 | shared_libs: [ |
Yifan Hong | 91a68df | 2018-09-19 10:28:16 -0700 | [diff] [blame] | 199 | "android.hardware.health.storage@1.0", |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 200 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 201 | } |
| 202 | |
| 203 | cc_binary { |
| 204 | name: "vdc", |
| 205 | defaults: ["vold_default_flags"], |
| 206 | |
| 207 | srcs: ["vdc.cpp"], |
| 208 | shared_libs: [ |
| 209 | "libbase", |
| 210 | "libbinder", |
| 211 | "libcutils", |
| 212 | "libutils", |
| 213 | ], |
| 214 | static_libs: [ |
| 215 | "libvold_binder", |
| 216 | ], |
| 217 | init_rc: ["vdc.rc"], |
| 218 | } |
| 219 | |
| 220 | cc_binary { |
Paul Crowley | 8f82879 | 2018-02-07 14:41:26 -0800 | [diff] [blame] | 221 | name: "wait_for_keymaster", |
| 222 | defaults: ["vold_default_flags"], |
| 223 | |
| 224 | srcs: [ |
| 225 | "wait_for_keymaster.cpp", |
| 226 | "Keymaster.cpp", |
| 227 | ], |
| 228 | shared_libs: [ |
| 229 | "libbase", |
| 230 | "libbinder", |
| 231 | |
| 232 | "android.hardware.keymaster@3.0", |
| 233 | "android.hardware.keymaster@4.0", |
| 234 | "libhardware", |
| 235 | "libhardware_legacy", |
| 236 | "libhidlbase", |
Paul Crowley | 8f82879 | 2018-02-07 14:41:26 -0800 | [diff] [blame] | 237 | "libkeymaster4support", |
| 238 | ], |
| 239 | } |
| 240 | |
| 241 | cc_binary { |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 242 | name: "secdiscard", |
| 243 | defaults: ["vold_default_flags"], |
| 244 | |
| 245 | srcs: [ |
| 246 | "FileDeviceUtils.cpp", |
| 247 | "secdiscard.cpp", |
| 248 | ], |
| 249 | shared_libs: ["libbase"], |
| 250 | } |
| 251 | |
| 252 | cc_binary { |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 253 | name: "vold_prepare_subdirs", |
| 254 | defaults: ["vold_default_flags"], |
| 255 | |
Paul Crowley | 82b41ff | 2017-10-20 08:17:54 -0700 | [diff] [blame] | 256 | srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"], |
| 257 | shared_libs: [ |
| 258 | "libbase", |
| 259 | "libcutils", |
| 260 | "liblogwrap", |
| 261 | "libselinux", |
| 262 | "libutils", |
| 263 | ], |
| 264 | static_libs: [ |
| 265 | "libvold_binder", |
| 266 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 267 | } |
| 268 | |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 269 | filegroup { |
| 270 | name: "vold_aidl", |
| 271 | srcs: [ |
| 272 | "binder/android/os/IVold.aidl", |
| 273 | "binder/android/os/IVoldListener.aidl", |
| 274 | "binder/android/os/IVoldTaskListener.aidl", |
| 275 | ], |
Dan Willemsen | 87c7f88 | 2018-09-14 21:28:50 -0700 | [diff] [blame] | 276 | path: "binder", |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 277 | } |