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