| // | |
| // Copyright (C) 2021 The Android Open Source Project | |
| // | |
| // Licensed under the Apache License, Version 2.0 (the "License"); | |
| // you may not use this file except in compliance with the License. | |
| // You may obtain a copy of the License at | |
| // | |
| // http://www.apache.org/licenses/LICENSE-2.0 | |
| // | |
| // Unless required by applicable law or agreed to in writing, software | |
| // distributed under the License is distributed on an "AS IS" BASIS, | |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| // See the License for the specific language governing permissions and | |
| // limitations under the License. | |
| package { | |
| default_team: "trendy_team_virtualization", | |
| default_applicable_licenses: ["Android-Apache-2.0"], | |
| } | |
| rust_defaults { | |
| name: "avf_build_flags_rust", | |
| cfgs: select(release_flag("RELEASE_AVF_ENABLE_DEVICE_ASSIGNMENT"), { | |
| true: ["device_assignment"], | |
| default: [], | |
| }) + select(release_flag("RELEASE_AVF_ENABLE_LLPVM_CHANGES"), { | |
| true: ["llpvm_changes"], | |
| default: [], | |
| }) + select(release_flag("RELEASE_AVF_ENABLE_NETWORK"), { | |
| true: ["network"], | |
| default: [], | |
| }) + select(release_flag("RELEASE_AVF_ENABLE_VENDOR_MODULES"), { | |
| true: ["vendor_modules"], | |
| default: [], | |
| }) + select(release_flag("RELEASE_AVF_IMPROVE_DEBUGGABLE_VMS"), { | |
| true: ["debuggable_vms_improvements"], | |
| default: [], | |
| }) + select(release_flag("RELEASE_AVF_SUPPORT_CUSTOM_VM_WITH_PARAVIRTUALIZED_DEVICES"), { | |
| true: ["paravirtualized_devices"], | |
| default: [], | |
| }) + select(release_flag("RELEASE_AVF_MICRODROID_KERNEL_VERSION"), { | |
| // Starting with android16-6.12 microdroid kernel uses upstream version of virtcpufreq driver. | |
| "android16_612": ["virt_cpufreq_upstream"], | |
| "android17_618": [ | |
| "virt_cpufreq_upstream", | |
| "microdroid_kernel_618", | |
| ], | |
| default: [], | |
| }) + select(release_flag("RELEASE_AVF_ENABLE_VM_TO_HOST_SERVICES"), { | |
| true: ["vm_to_host_services"], | |
| default: [], | |
| }) + select(release_flag("RELEASE_AVF_SUPPORT_LONG_RUNNING_VMS"), { | |
| true: ["long_running_vms"], | |
| default: [], | |
| }) + select(release_flag("RELEASE_AVF_ENABLE_ADVANCE_MULTITENANCY"), { | |
| true: ["advance_multitenancy"], | |
| default: [], | |
| }) + select(release_flag("RELEASE_AVF_FORWARD_ROOT_OF_TRUST_PROPS_TO_SECURITY_VM"), { | |
| true: ["forward_rot"], | |
| default: [], | |
| }) + select(release_flag("RELEASE_AVF_USE_VM_ATTESTATION_SERVICE_ACCESSOR"), { | |
| true: ["use_vm_attestation_service_accessor"], | |
| default: [], | |
| }) + select(release_flag("RELEASE_AVF_VALIDATE_CLIENT_VM_USING_DICE_INFO"), { | |
| true: ["validate_client_vm_using_dice_info"], | |
| default: [], | |
| }) + select(release_flag("RELEASE_AVF_VM_PROFILES"), { | |
| true: ["vm_profiles"], | |
| default: [], | |
| }) + select(release_flag("RELEASE_AVF_ENABLE_UDS_CERTS_IN_VM_ATTESTATION2"), { | |
| true: ["uds_certs_in_vm_attestation"], | |
| default: [], | |
| }), | |
| } | |
| cc_defaults { | |
| name: "avf_build_flags_cc", | |
| cflags: ["-DAVF_OPEN_DICE_CHANGES=1"] + | |
| select(release_flag("RELEASE_AVF_ENABLE_VENDOR_MODULES"), { | |
| true: ["-DAVF_ENABLE_VENDOR_MODULES=1"], | |
| default: [], | |
| }) + select(release_flag("RELEASE_AVF_ENABLE_ADVANCE_MULTITENANCY"), { | |
| true: ["-DAVF_ENABLE_ADVANCE_MULTITENANCY=1"], | |
| default: [], | |
| }), | |
| } | |
| genrule_defaults { | |
| name: "dts_to_dtb", | |
| tools: ["dtc"], | |
| cmd: "FILES=($(in)) && $(location dtc) -@ -I dts -O dtb $${FILES[-1]} -o $(out)", | |
| } | |
| // This is a temporary workaround until b/343795511 is implemented. | |
| aconfig_declarations { | |
| name: "avf_aconfig_flags", | |
| package: "com.android.system.virtualmachine.flags", | |
| container: "com.android.virt", | |
| srcs: [ | |
| "avf_flags.aconfig", | |
| ], | |
| } | |
| rust_aconfig_library { | |
| name: "libavf_aconfig_flags_rust", | |
| crate_name: "avf_aconfig", | |
| aconfig_declarations: "avf_aconfig_flags", | |
| apex_available: ["com.android.virt"], | |
| } | |
| java_aconfig_library { | |
| name: "avf_aconfig_flags_java", | |
| aconfig_declarations: "avf_aconfig_flags", | |
| sdk_version: "module_current", | |
| apex_available: ["com.android.virt"], | |
| } | |
| genrule { | |
| name: "empty_file", | |
| out: ["empty_file"], | |
| cmd: "touch $(out)", | |
| } |