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", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 98 | "Devmapper.cpp", |
| 99 | "EncryptInplace.cpp", |
| 100 | "Ext4Crypt.cpp", |
Jeff Sharkey | 2048a28 | 2017-06-15 09:59:43 -0600 | [diff] [blame] | 101 | "FileDeviceUtils.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 102 | "IdleMaint.cpp", |
| 103 | "KeyBuffer.cpp", |
| 104 | "KeyStorage.cpp", |
| 105 | "KeyUtil.cpp", |
| 106 | "Keymaster.cpp", |
| 107 | "Loop.cpp", |
| 108 | "MetadataCrypt.cpp", |
| 109 | "MoveStorage.cpp", |
| 110 | "NetlinkHandler.cpp", |
| 111 | "NetlinkManager.cpp", |
| 112 | "Process.cpp", |
| 113 | "ScryptParameters.cpp", |
| 114 | "Utils.cpp", |
| 115 | "VoldNativeService.cpp", |
| 116 | "VoldUtil.cpp", |
| 117 | "VolumeManager.cpp", |
| 118 | "cryptfs.cpp", |
Jeff Sharkey | 37ba125 | 2018-01-19 10:55:18 +0900 | [diff] [blame] | 119 | "fs/Exfat.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 120 | "fs/Ext4.cpp", |
| 121 | "fs/F2fs.cpp", |
| 122 | "fs/Vfat.cpp", |
| 123 | "model/Disk.cpp", |
| 124 | "model/EmulatedVolume.cpp", |
| 125 | "model/ObbVolume.cpp", |
| 126 | "model/PrivateVolume.cpp", |
| 127 | "model/PublicVolume.cpp", |
| 128 | "model/VolumeBase.cpp", |
| 129 | "secontext.cpp", |
| 130 | ], |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 131 | product_variables: { |
| 132 | arc: { |
| 133 | exclude_srcs: [ |
| 134 | "model/ObbVolume.cpp", |
| 135 | ], |
| 136 | static_libs: [ |
Risan | ea2d2bb | 2018-02-23 08:12:37 +0900 | [diff] [blame] | 137 | "arc_services_aidl", |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 138 | "libarcobbvolume", |
| 139 | ], |
| 140 | }, |
| 141 | }, |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 142 | shared_libs: [ |
Yifan Hong | 91a68df | 2018-09-19 10:28:16 -0700 | [diff] [blame^] | 143 | "android.hardware.health.storage@1.0", |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 144 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 145 | } |
| 146 | |
| 147 | cc_binary { |
| 148 | name: "vold", |
| 149 | defaults: [ |
| 150 | "vold_default_flags", |
| 151 | "vold_default_libs", |
| 152 | ], |
| 153 | |
| 154 | srcs: ["main.cpp"], |
| 155 | static_libs: ["libvold"], |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 156 | product_variables: { |
| 157 | arc: { |
| 158 | static_libs: [ |
Risan | ea2d2bb | 2018-02-23 08:12:37 +0900 | [diff] [blame] | 159 | "arc_services_aidl", |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 160 | "libarcobbvolume", |
Risan | 9929e7d | 2018-01-22 11:04:25 +0900 | [diff] [blame] | 161 | ], |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 162 | }, |
| 163 | }, |
Wei Wang | f5b085c | 2018-05-15 16:12:20 -0700 | [diff] [blame] | 164 | init_rc: [ |
| 165 | "vold.rc", |
| 166 | "wait_for_keymaster.rc", |
| 167 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 168 | |
| 169 | required: [ |
| 170 | "mke2fs", |
| 171 | "vold_prepare_subdirs", |
Paul Crowley | 8f82879 | 2018-02-07 14:41:26 -0800 | [diff] [blame] | 172 | "wait_for_keymaster", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 173 | ], |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 174 | |
| 175 | shared_libs: [ |
Yifan Hong | 91a68df | 2018-09-19 10:28:16 -0700 | [diff] [blame^] | 176 | "android.hardware.health.storage@1.0", |
Yifan Hong | 024a124 | 2018-08-10 13:50:46 -0700 | [diff] [blame] | 177 | "libhidltransport", |
| 178 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 179 | } |
| 180 | |
| 181 | cc_binary { |
| 182 | name: "vdc", |
| 183 | defaults: ["vold_default_flags"], |
| 184 | |
| 185 | srcs: ["vdc.cpp"], |
| 186 | shared_libs: [ |
| 187 | "libbase", |
| 188 | "libbinder", |
| 189 | "libcutils", |
| 190 | "libutils", |
| 191 | ], |
| 192 | static_libs: [ |
| 193 | "libvold_binder", |
| 194 | ], |
| 195 | init_rc: ["vdc.rc"], |
| 196 | } |
| 197 | |
| 198 | cc_binary { |
Paul Crowley | 8f82879 | 2018-02-07 14:41:26 -0800 | [diff] [blame] | 199 | name: "wait_for_keymaster", |
| 200 | defaults: ["vold_default_flags"], |
| 201 | |
| 202 | srcs: [ |
| 203 | "wait_for_keymaster.cpp", |
| 204 | "Keymaster.cpp", |
| 205 | ], |
| 206 | shared_libs: [ |
| 207 | "libbase", |
| 208 | "libbinder", |
| 209 | |
| 210 | "android.hardware.keymaster@3.0", |
| 211 | "android.hardware.keymaster@4.0", |
| 212 | "libhardware", |
| 213 | "libhardware_legacy", |
| 214 | "libhidlbase", |
| 215 | "libhwbinder", |
| 216 | "libkeymaster4support", |
| 217 | ], |
| 218 | } |
| 219 | |
| 220 | cc_binary { |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 221 | name: "secdiscard", |
| 222 | defaults: ["vold_default_flags"], |
| 223 | |
| 224 | srcs: [ |
| 225 | "FileDeviceUtils.cpp", |
| 226 | "secdiscard.cpp", |
| 227 | ], |
| 228 | shared_libs: ["libbase"], |
| 229 | } |
| 230 | |
| 231 | cc_binary { |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 232 | name: "vold_prepare_subdirs", |
| 233 | defaults: ["vold_default_flags"], |
| 234 | |
Paul Crowley | 82b41ff | 2017-10-20 08:17:54 -0700 | [diff] [blame] | 235 | srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"], |
| 236 | shared_libs: [ |
| 237 | "libbase", |
| 238 | "libcutils", |
| 239 | "liblogwrap", |
| 240 | "libselinux", |
| 241 | "libutils", |
| 242 | ], |
| 243 | static_libs: [ |
| 244 | "libvold_binder", |
| 245 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 246 | } |
| 247 | |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 248 | filegroup { |
| 249 | name: "vold_aidl", |
| 250 | srcs: [ |
| 251 | "binder/android/os/IVold.aidl", |
| 252 | "binder/android/os/IVoldListener.aidl", |
| 253 | "binder/android/os/IVoldTaskListener.aidl", |
| 254 | ], |
| 255 | } |
| 256 | |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 257 | subdirs = ["tests"] |