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