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", |
Eric Biggers | a701c45 | 2018-10-23 13:06:55 -0700 | [diff] [blame] | 55 | "libfscrypt", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 56 | "libhardware", |
| 57 | "libhardware_legacy", |
| 58 | "libhidlbase", |
| 59 | "libhwbinder", |
Shawn Willden | 3535181 | 2018-01-22 09:08:32 -0700 | [diff] [blame] | 60 | "libkeymaster4support", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 61 | "libkeyutils", |
| 62 | "liblog", |
| 63 | "liblogwrap", |
| 64 | "libselinux", |
| 65 | "libsysutils", |
| 66 | "libutils", |
| 67 | ], |
| 68 | } |
| 69 | |
| 70 | cc_library_static { |
| 71 | name: "libvold_binder", |
| 72 | defaults: ["vold_default_flags"], |
| 73 | |
| 74 | srcs: [ |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 75 | ":vold_aidl", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 76 | ], |
| 77 | shared_libs: [ |
| 78 | "libbinder", |
| 79 | "libutils", |
| 80 | ], |
| 81 | aidl: { |
| 82 | local_include_dirs: ["binder"], |
| 83 | include_dirs: ["frameworks/native/aidl/binder"], |
| 84 | export_aidl_headers: true, |
| 85 | }, |
| 86 | } |
| 87 | |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 88 | cc_library_headers { |
| 89 | name: "libvold_headers", |
| 90 | export_include_dirs: ["."], |
| 91 | } |
| 92 | |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 93 | // Static library factored out to support testing |
| 94 | cc_library_static { |
| 95 | name: "libvold", |
| 96 | defaults: [ |
| 97 | "vold_default_flags", |
| 98 | "vold_default_libs", |
| 99 | ], |
| 100 | |
| 101 | srcs: [ |
Risan | ac02a48 | 2018-10-31 21:59:47 -0600 | [diff] [blame] | 102 | "AppFuseUtil.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 103 | "Benchmark.cpp", |
Jeff Sharkey | 2048a28 | 2017-06-15 09:59:43 -0600 | [diff] [blame] | 104 | "CheckEncryption.cpp", |
Daniel Rosenberg | 65f99c9 | 2018-08-28 01:58:49 -0700 | [diff] [blame] | 105 | "Checkpoint.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 106 | "Devmapper.cpp", |
| 107 | "EncryptInplace.cpp", |
Jeff Sharkey | 2048a28 | 2017-06-15 09:59:43 -0600 | [diff] [blame] | 108 | "FileDeviceUtils.cpp", |
Eric Biggers | a701c45 | 2018-10-23 13:06:55 -0700 | [diff] [blame] | 109 | "FsCrypt.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 110 | "IdleMaint.cpp", |
| 111 | "KeyBuffer.cpp", |
| 112 | "KeyStorage.cpp", |
| 113 | "KeyUtil.cpp", |
| 114 | "Keymaster.cpp", |
| 115 | "Loop.cpp", |
| 116 | "MetadataCrypt.cpp", |
| 117 | "MoveStorage.cpp", |
| 118 | "NetlinkHandler.cpp", |
| 119 | "NetlinkManager.cpp", |
| 120 | "Process.cpp", |
| 121 | "ScryptParameters.cpp", |
| 122 | "Utils.cpp", |
| 123 | "VoldNativeService.cpp", |
| 124 | "VoldUtil.cpp", |
| 125 | "VolumeManager.cpp", |
| 126 | "cryptfs.cpp", |
Jeff Sharkey | 37ba125 | 2018-01-19 10:55:18 +0900 | [diff] [blame] | 127 | "fs/Exfat.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 128 | "fs/Ext4.cpp", |
| 129 | "fs/F2fs.cpp", |
| 130 | "fs/Vfat.cpp", |
| 131 | "model/Disk.cpp", |
| 132 | "model/EmulatedVolume.cpp", |
| 133 | "model/ObbVolume.cpp", |
| 134 | "model/PrivateVolume.cpp", |
| 135 | "model/PublicVolume.cpp", |
| 136 | "model/VolumeBase.cpp", |
Risan | 8c9f332 | 2018-10-29 08:52:56 +0900 | [diff] [blame] | 137 | "model/StubVolume.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 138 | ], |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 139 | product_variables: { |
| 140 | arc: { |
| 141 | exclude_srcs: [ |
Risan | dcbd4fc | 2018-11-02 01:26:31 +0900 | [diff] [blame] | 142 | "AppFuseUtil.cpp", |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 143 | "model/ObbVolume.cpp", |
| 144 | ], |
| 145 | static_libs: [ |
Risan | ea2d2bb | 2018-02-23 08:12:37 +0900 | [diff] [blame] | 146 | "arc_services_aidl", |
Risan | dcbd4fc | 2018-11-02 01:26:31 +0900 | [diff] [blame] | 147 | "libarcappfuse", |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 148 | "libarcobbvolume", |
| 149 | ], |
| 150 | }, |
Mark Salyzyn | c4405e9 | 2018-09-20 10:09:27 -0700 | [diff] [blame] | 151 | debuggable: { |
| 152 | cppflags: ["-D__ANDROID_DEBUGGABLE__"], |
| 153 | }, |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 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", |
| 160 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 161 | } |
| 162 | |
| 163 | cc_binary { |
| 164 | name: "vold", |
| 165 | defaults: [ |
| 166 | "vold_default_flags", |
| 167 | "vold_default_libs", |
| 168 | ], |
| 169 | |
| 170 | srcs: ["main.cpp"], |
| 171 | static_libs: ["libvold"], |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 172 | product_variables: { |
| 173 | arc: { |
| 174 | static_libs: [ |
Risan | ea2d2bb | 2018-02-23 08:12:37 +0900 | [diff] [blame] | 175 | "arc_services_aidl", |
Risan | dcbd4fc | 2018-11-02 01:26:31 +0900 | [diff] [blame] | 176 | "libarcappfuse", |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 177 | "libarcobbvolume", |
Risan | 9929e7d | 2018-01-22 11:04:25 +0900 | [diff] [blame] | 178 | ], |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 179 | }, |
| 180 | }, |
Wei Wang | f5b085c | 2018-05-15 16:12:20 -0700 | [diff] [blame] | 181 | init_rc: [ |
| 182 | "vold.rc", |
| 183 | "wait_for_keymaster.rc", |
| 184 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 185 | |
| 186 | required: [ |
| 187 | "mke2fs", |
| 188 | "vold_prepare_subdirs", |
Paul Crowley | 8f82879 | 2018-02-07 14:41:26 -0800 | [diff] [blame] | 189 | "wait_for_keymaster", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 190 | ], |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 191 | |
| 192 | shared_libs: [ |
Yifan Hong | 91a68df | 2018-09-19 10:28:16 -0700 | [diff] [blame] | 193 | "android.hardware.health.storage@1.0", |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 194 | "libhidltransport", |
| 195 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 196 | } |
| 197 | |
| 198 | cc_binary { |
| 199 | name: "vdc", |
| 200 | defaults: ["vold_default_flags"], |
| 201 | |
| 202 | srcs: ["vdc.cpp"], |
| 203 | shared_libs: [ |
| 204 | "libbase", |
| 205 | "libbinder", |
| 206 | "libcutils", |
| 207 | "libutils", |
| 208 | ], |
| 209 | static_libs: [ |
| 210 | "libvold_binder", |
| 211 | ], |
| 212 | init_rc: ["vdc.rc"], |
| 213 | } |
| 214 | |
| 215 | cc_binary { |
Paul Crowley | 8f82879 | 2018-02-07 14:41:26 -0800 | [diff] [blame] | 216 | name: "wait_for_keymaster", |
| 217 | defaults: ["vold_default_flags"], |
| 218 | |
| 219 | srcs: [ |
| 220 | "wait_for_keymaster.cpp", |
| 221 | "Keymaster.cpp", |
| 222 | ], |
| 223 | shared_libs: [ |
| 224 | "libbase", |
| 225 | "libbinder", |
| 226 | |
| 227 | "android.hardware.keymaster@3.0", |
| 228 | "android.hardware.keymaster@4.0", |
| 229 | "libhardware", |
| 230 | "libhardware_legacy", |
| 231 | "libhidlbase", |
| 232 | "libhwbinder", |
| 233 | "libkeymaster4support", |
| 234 | ], |
| 235 | } |
| 236 | |
| 237 | cc_binary { |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 238 | name: "secdiscard", |
| 239 | defaults: ["vold_default_flags"], |
| 240 | |
| 241 | srcs: [ |
| 242 | "FileDeviceUtils.cpp", |
| 243 | "secdiscard.cpp", |
| 244 | ], |
| 245 | shared_libs: ["libbase"], |
| 246 | } |
| 247 | |
| 248 | cc_binary { |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 249 | name: "vold_prepare_subdirs", |
| 250 | defaults: ["vold_default_flags"], |
| 251 | |
Paul Crowley | 82b41ff | 2017-10-20 08:17:54 -0700 | [diff] [blame] | 252 | srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"], |
| 253 | shared_libs: [ |
| 254 | "libbase", |
| 255 | "libcutils", |
| 256 | "liblogwrap", |
| 257 | "libselinux", |
| 258 | "libutils", |
| 259 | ], |
| 260 | static_libs: [ |
| 261 | "libvold_binder", |
| 262 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 263 | } |
| 264 | |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 265 | filegroup { |
| 266 | name: "vold_aidl", |
| 267 | srcs: [ |
| 268 | "binder/android/os/IVold.aidl", |
| 269 | "binder/android/os/IVoldListener.aidl", |
| 270 | "binder/android/os/IVoldTaskListener.aidl", |
| 271 | ], |
Dan Willemsen | 87c7f88 | 2018-09-14 21:28:50 -0700 | [diff] [blame] | 272 | path: "binder", |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 273 | } |