1// 2// Copyright (C) 2019 The Android Open Source Project 3// 4// Licensed under the Apache License, Version 2.0 (the "License"); 5// you may not use this file except in compliance with the License. 6// You may obtain a copy of the License at 7// 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// See the License for the specific language governing permissions and 14// limitations under the License. 15// 16 17package { 18 default_applicable_licenses: ["Android-Apache-2.0"], 19} 20 21cc_binary { 22 name: "gsi_tool", 23 shared_libs: [ 24 "gsi_aidl_interface-cpp", 25 "libbase", 26 "libbinder", 27 "libcutils", 28 "libgsi", 29 "liblog", 30 "libutils", 31 ], 32 static_libs: [ 33 "libgsid", 34 ], 35 srcs: [ 36 "gsi_tool.cpp", 37 ], 38 cflags: [ 39 "-Wall", 40 "-Werror", 41 ], 42} 43 44cc_library { 45 name: "libgsi", 46 ramdisk_available: true, 47 vendor_ramdisk_available: true, 48 recovery_available: true, 49 host_supported: true, 50 srcs: [ 51 "libgsi.cpp", 52 ], 53 shared_libs: [ 54 "libbase", 55 ], 56 cflags: [ 57 "-Wall", 58 "-Werror", 59 ], 60 export_include_dirs: ["include"], 61} 62 63cc_library_static { 64 name: "libgsid", 65 srcs: [ 66 "libgsid.cpp", 67 ], 68 shared_libs: [ 69 "gsi_aidl_interface-cpp", 70 "libbase", 71 "libbinder", 72 "libutils", 73 ], 74 cflags: [ 75 "-Wall", 76 "-Werror", 77 ], 78 export_include_dirs: ["include"], 79} 80 81cc_library_headers { 82 name: "libgsi_headers", 83 host_supported: true, 84 ramdisk_available: true, 85 vendor_ramdisk_available: true, 86 recovery_available: true, 87 vendor_available: true, 88 export_include_dirs: ["include"], 89 apex_available: [ 90 "//apex_available:anyapex", 91 "//apex_available:platform", 92 ], 93 min_sdk_version: "31", 94} 95 96cc_defaults { 97 name: "gsid_defaults", 98 srcs: [ 99 "gsi_service.cpp", 100 "partition_installer.cpp", 101 ], 102 shared_libs: [ 103 "libbase", 104 "libbinder", 105 "libcrypto", 106 "liblog", 107 ], 108 static_libs: [ 109 "gsi_aidl_interface-cpp", 110 "libavb", 111 "libcutils", 112 "libdm", 113 "libext4_utils", 114 "libfs_mgr", 115 "libgsi", 116 "libgsid", 117 "liblp", 118 "libselinux", 119 "libutils", 120 "libvold_binder", 121 ], 122 header_libs: [ 123 "libstorage_literals_headers", 124 ], 125 cflags: [ 126 "-Wall", 127 "-Werror", 128 ], 129 target: { 130 android: { 131 shared_libs: [ 132 "libvndksupport", 133 ], 134 }, 135 }, 136 local_include_dirs: ["include"], 137} 138 139cc_binary { 140 name: "gsid", 141 defaults: [ 142 "gsid_defaults", 143 ], 144 srcs: [ 145 "daemon.cpp", 146 ], 147 required: [ 148 "mke2fs", 149 ], 150 init_rc: [ 151 "gsid.rc", 152 ], 153} 154 155aidl_interface { 156 name: "gsi_aidl_interface", 157 unstable: true, 158 srcs: [":gsiservice_aidl"], 159 local_include_dir: "aidl", 160 backend: { 161 ndk: { 162 enabled: false, 163 }, 164 }, 165} 166 167filegroup { 168 name: "gsiservice_aidl", 169 srcs: [ 170 "aidl/android/gsi/AvbPublicKey.aidl", 171 "aidl/android/gsi/GsiProgress.aidl", 172 "aidl/android/gsi/IGsiService.aidl", 173 "aidl/android/gsi/IGsiServiceCallback.aidl", 174 "aidl/android/gsi/IImageService.aidl", 175 "aidl/android/gsi/IProgressCallback.aidl", 176 "aidl/android/gsi/MappedImage.aidl", 177 ], 178 path: "aidl", 179} 180 181cc_fuzz { 182 name: "gsi_service_fuzzer", 183 defaults: [ 184 "gsid_defaults", 185 "service_fuzzer_defaults", 186 "fuzzer_disable_leaks", 187 ], 188 srcs: [ 189 "fuzzers/GsiServiceFuzzer.cpp", 190 ], 191 fuzz_config: { 192 triage_assignee: "waghpawan@google.com", 193 cc: [ 194 "elsk@google.com", 195 "yochiang@google.com", 196 ] 197 }, 198} 199