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