|
Android-cuttlefish cvd tool
|
#include <stdint.h>#include <algorithm>#include <cctype>#include <fstream>#include <optional>#include <string>#include <string_view>#include <utility>#include <vector>#include "absl/log/check.h"#include "absl/log/log.h"#include "absl/strings/str_cat.h"#include "absl/strings/str_split.h"#include "fmt/core.h"#include "fmt/format.h"#include "google/protobuf/text_format.h"#include "json/config.h"#include "json/reader.h"#include "json/value.h"#include "cuttlefish/common/libs/utils/device_type.h"#include "cuttlefish/common/libs/utils/files.h"#include "cuttlefish/common/libs/utils/flags_validator.h"#include "cuttlefish/common/libs/utils/host_info.h"#include "cuttlefish/host/commands/assemble_cvd/proto/guest_config.pb.h"#include "cuttlefish/host/libs/config/ap_boot_flow.h"#include "cuttlefish/host/libs/config/boot_flow.h"#include "cuttlefish/host/libs/config/config_constants.h"#include "cuttlefish/host/libs/config/cuttlefish_config.h"#include "cuttlefish/host/libs/config/data_image_policy.h"#include "cuttlefish/host/libs/config/external_network_mode.h"#include "cuttlefish/host/libs/config/gpu_mode.h"#include "cuttlefish/host/libs/config/guest_hwui_renderer.h"#include "cuttlefish/host/libs/config/guest_renderer_preload.h"#include "cuttlefish/host/libs/log_names/log_names.h"#include "cuttlefish/result/result.h"
Namespaces | |
| namespace | cuttlefish |
| namespace | cuttlefish::anonymous_namespace{cuttlefish_config_instance.cpp} |
Functions | |
| std::string | cuttlefish::anonymous_namespace{cuttlefish_config_instance.cpp}::IdToName (const std::string &id) |
Variables | |
| const char * | cuttlefish::anonymous_namespace{cuttlefish_config_instance.cpp}::kInstances = "instances" |
| static constexpr char | cuttlefish::kInstanceDir [] = "instance_dir" |
| static constexpr char | cuttlefish::kImagesDir [] = "images_dir" |
| static constexpr char | cuttlefish::kInitBootImage [] = "init_boot_image" |
| static constexpr char | cuttlefish::kDataImage [] = "data_image" |
| static constexpr char | cuttlefish::kNewDataImage [] = "new_data_image" |
| static constexpr char | cuttlefish::kSuperImage [] = "super_image" |
| static constexpr char | cuttlefish::kNewSuperImage [] = "new_super_image" |
| static constexpr char | cuttlefish::kVendorBootImage [] = "vendor_boot_image" |
| static constexpr char | cuttlefish::kNewVendorBootImage [] = "new_vendor_boot_image" |
| static constexpr char | cuttlefish::kVbmetaImage [] = "vbmeta_image" |
| static constexpr char | cuttlefish::kNewVbmetaImage [] = "new_vbmeta_image" |
| static constexpr char | cuttlefish::kVbmetaSystemImage [] = "vbmeta_system_image" |
| static constexpr char | cuttlefish::kVbmetaVendorDlkmImage [] = "vbmeta_vendor_dlkm_image" |
| static constexpr char | cuttlefish::kNewVbmetaVendorDlkmImage [] |
| static constexpr char | cuttlefish::kVbmetaSystemDlkmImage [] = "vbmeta_system_dlkm_image" |
| static constexpr char | cuttlefish::kNewVbmetaSystemDlkmImage [] |
| static constexpr char | cuttlefish::kOtherosEspImage [] = "otheros_esp_image" |
| static constexpr char | cuttlefish::kAndroidEfiLoader [] = "android_efi_loader" |
| static constexpr char | cuttlefish::kChromeOsDisk [] = "chromeos_disk" |
| static constexpr char | cuttlefish::kChromeOsKernelPath [] = "chromeos_kernel_path" |
| static constexpr char | cuttlefish::kChromeOsRootImage [] = "chromeos_root_image" |
| static constexpr char | cuttlefish::kLinuxKernelPath [] = "linux_kernel_path" |
| static constexpr char | cuttlefish::kLinuxInitramfsPath [] = "linux_initramfs_path" |
| static constexpr char | cuttlefish::kLinuxRootImage [] = "linux_root_image" |
| static constexpr char | cuttlefish::kFuchsiaZedbootPath [] = "fuchsia_zedboot_path" |
| static constexpr char | cuttlefish::kFuchsiaMultibootBinPath [] = "multiboot_bin_path" |
| static constexpr char | cuttlefish::kFuchsiaRootImage [] = "fuchsia_root_image" |
| static constexpr char | cuttlefish::kCustomPartitionPath [] = "custom_partition_path" |
| static constexpr char | cuttlefish::kBlankSdcardImageMb [] = "blank_sdcard_image_mb" |
| static constexpr char | cuttlefish::kBootloader [] = "bootloader" |
| static constexpr char | cuttlefish::kInitramfsPath [] = "initramfs_path" |
| static constexpr char | cuttlefish::kKernelPath [] = "kernel_path" |
| static constexpr char | cuttlefish::kVvmtruststorePath [] = "vvmtruststore_path" |
| static constexpr char | cuttlefish::kDefaultTargetZip [] = "default_target_zip" |
| static constexpr char | cuttlefish::kSystemTargetZip [] = "system_target_zip" |
| static constexpr char | cuttlefish::kSerialNumber [] = "serial_number" |
| static constexpr char | cuttlefish::kVirtualDiskPaths [] = "virtual_disk_paths" |
| static constexpr char | cuttlefish::kGuestAndroidVersion [] = "guest_android_version" |
| static constexpr char | cuttlefish::kBootconfigSupported [] = "bootconfig_supported" |
| static constexpr char | cuttlefish::kFilenameEncryptionMode [] = "filename_encryption_mode" |
| static constexpr char | cuttlefish::kExternalNetworkMode [] = "external_network_mode" |
| static constexpr char | cuttlefish::kGnssGrpcProxyServerPort [] |
| static constexpr char | cuttlefish::kGnssFilePath [] = "gnss_file_path" |
| static constexpr char | cuttlefish::kFixedLocationFilePath [] = "fixed_location_file_path" |
| static constexpr char | cuttlefish::kGem5BinaryDir [] = "gem5_binary_dir" |
| static constexpr char | cuttlefish::kGem5CheckpointDir [] = "gem5_checkpoint_dir" |
| static constexpr char | cuttlefish::kKgdb [] = "kgdb" |
| static constexpr char | cuttlefish::kCpus [] = "cpus" |
| static constexpr char | cuttlefish::kVcpuInfo [] = "vcpu_config_path" |
| static constexpr char | cuttlefish::kDataPolicy [] = "data_policy" |
| static constexpr char | cuttlefish::kBlankDataImageMb [] = "blank_data_image_mb" |
| static constexpr char | cuttlefish::kGdbPort [] = "gdb_port" |
| static constexpr char | cuttlefish::kMemoryMb [] = "memory_mb" |
| static constexpr char | cuttlefish::kDdrMemMb [] = "ddr_mem_mb" |
| static constexpr char | cuttlefish::kSetupWizardMode [] = "setupwizard_mode" |
| static constexpr char | cuttlefish::kUserdataFormat [] = "userdata_format" |
| static constexpr char | cuttlefish::kGuestEnforceSecurity [] = "guest_enforce_security" |
| static constexpr char | cuttlefish::kUseSdcard [] = "use_sdcard" |
| static constexpr char | cuttlefish::kPauseInBootloader [] = "pause_in_bootloader" |
| static constexpr char | cuttlefish::kRunAsDaemon [] = "run_as_daemon" |
| static constexpr char | cuttlefish::kEnableMinimalMode [] = "enable_minimal_mode" |
| static constexpr char | cuttlefish::kRunModemSimulator [] = "enable_modem_simulator" |
| static constexpr char | cuttlefish::kModemSimulatorInstanceNumber [] |
| static constexpr char | cuttlefish::kModemSimulatorSimType [] = "modem_simulator_sim_type" |
| static constexpr char | cuttlefish::kGpuMode [] = "gpu_mode" |
| static constexpr char | cuttlefish::kGpuModeCandidates [] = "gpu_mode_candidates" |
| static constexpr char | cuttlefish::kGpuAngleFeatureOverridesEnabled [] |
| static constexpr char | cuttlefish::kGpuAngleFeatureOverridesDisabled [] |
| static constexpr char | cuttlefish::kGpuCaptureBinary [] = "gpu_capture_binary" |
| static constexpr char | cuttlefish::kGpuGfxstreamTransport [] = "gpu_gfxstream_transport" |
| static constexpr char | cuttlefish::kGpuRendererFeatures [] = "gpu_renderer_features" |
| static constexpr char | cuttlefish::kGpuContextTypes [] = "gpu_context_types" |
| static constexpr char | cuttlefish::kGuestHwuiRenderer [] = "guest_hwui_renderer" |
| static constexpr char | cuttlefish::kGuestRendererPreload [] = "guest_renderer_preload" |
| static constexpr char | cuttlefish::kVulkanDriver [] = "guest_vulkan_driver" |
| static constexpr char | cuttlefish::kGuestUsesBgraFramebuffers [] |
| static constexpr char | cuttlefish::kRestartSubprocesses [] = "restart_subprocesses" |
| static constexpr char | cuttlefish::kHWComposer [] = "hwcomposer" |
| static constexpr char | cuttlefish::kEnableGpuUdmabuf [] = "enable_gpu_udmabuf" |
| static constexpr char | cuttlefish::kEnableGpuVhostUser [] = "enable_gpu_vhost_user" |
| static constexpr char | cuttlefish::kEnableGpuExternalBlob [] = "enable_gpu_external_blob" |
| static constexpr char | cuttlefish::kEnableGpuSystemBlob [] = "enable_gpu_system_blob" |
| static constexpr char | cuttlefish::kHasVulkanGfxstreamApex [] = "has_vulkan_gfxstream_apex" |
| static constexpr char | cuttlefish::kHasVulkanLavapipeApex [] = "has_vulkan_lavapipe_apex" |
| static constexpr char | cuttlefish::kHasVulkanSwiftshaderApex [] |
| static constexpr char | cuttlefish::kEnableAudio [] = "enable_audio" |
| static constexpr char | cuttlefish::kEnableMouse [] = "enable_mouse" |
| static constexpr char | cuttlefish::kEnableGamepad [] = "enable_gamepad" |
| static constexpr char | cuttlefish::kCustomKeyboardConfig [] = "custom_keyboard_config" |
| static constexpr char | cuttlefish::kDomkeyMappingConfig [] = "domkey_mapping_config" |
| static constexpr char | cuttlefish::kEnableGnssGrpcProxy [] = "enable_gnss_grpc_proxy" |
| static constexpr char | cuttlefish::kEnableBootAnimation [] = "enable_bootanimation" |
| static constexpr char | cuttlefish::kEnableUsb [] = "enable_usb" |
| static constexpr char | cuttlefish::kExtraBootconfigArgsInstanced [] = "extra_bootconfig_args" |
| static constexpr char | cuttlefish::kRecordScreen [] = "record_screen" |
| static constexpr char | cuttlefish::kGem5DebugFile [] = "gem5_debug_file" |
| static constexpr char | cuttlefish::kMte [] = "mte" |
| static constexpr char | cuttlefish::kEnableKernelLog [] = "enable_kernel_log" |
| static constexpr char | cuttlefish::kBootSlot [] = "boot_slot" |
| static constexpr char | cuttlefish::kFailFast [] = "fail_fast" |
| static constexpr char | cuttlefish::kVhostUserBlock [] = "vhost_user_block" |
| static constexpr char | cuttlefish::kTi50 [] = "ti50" |
| static constexpr char | cuttlefish::kEnableJcardSimulator [] = "enable_jcard_simulator" |
| static constexpr char | cuttlefish::kWebRTCAssetsDir [] = "webrtc_assets_dir" |
| static constexpr char | cuttlefish::kWebrtcTcpPortRange [] = "webrtc_tcp_port_range" |
| static constexpr char | cuttlefish::kWebrtcUdpPortRange [] = "webrtc_udp_port_range" |
| static constexpr char | cuttlefish::kGrpcConfig [] = "grpc_config" |
| static constexpr char | cuttlefish::kSmt [] = "smt" |
| static constexpr char | cuttlefish::kCrosvmBinary [] = "crosvm_binary" |
| static constexpr char | cuttlefish::kSeccompPolicyDir [] = "seccomp_policy_dir" |
| static constexpr char | cuttlefish::kQemuBinaryDir [] = "qemu_binary_dir" |
| static constexpr char | cuttlefish::kVhostNet [] = "vhost_net" |
| static constexpr char | cuttlefish::kOpenThreadNodeId [] = "openthread_node_id" |
| static constexpr char | cuttlefish::kVhostUserVsock [] = "vhost_user_vsock" |
| static constexpr char | cuttlefish::kRilDns [] = "ril_dns" |
| static constexpr char | cuttlefish::kRilIpaddr [] = "ril_ipaddr" |
| static constexpr char | cuttlefish::kRilGateway [] = "ril_gateway" |
| static constexpr char | cuttlefish::kRilBroadcast [] = "ril_broadcast" |
| static constexpr char | cuttlefish::kRilPrefixlen [] = "ril_prefixlen" |
| static constexpr char | cuttlefish::kDisplayConfigs [] = "display_configs" |
| static constexpr char | cuttlefish::kXRes [] = "x_res" |
| static constexpr char | cuttlefish::kYRes [] = "y_res" |
| static constexpr char | cuttlefish::kDpi [] = "dpi" |
| static constexpr char | cuttlefish::kRefreshRateHz [] = "refresh_rate_hz" |
| static constexpr char | cuttlefish::kOverlays [] = "overlays" |
| static constexpr char | cuttlefish::kTouchpadConfigs [] = "touchpad_configs" |
| static constexpr char | cuttlefish::kTargetArch [] = "target_arch" |
| static constexpr char | cuttlefish::kDeviceType [] = "device_type" |
| static constexpr char | cuttlefish::kEnableSandbox [] = "enable_sandbox" |
| static constexpr char | cuttlefish::kEnableVirtiofs [] = "enable_virtiofs" |
| static constexpr char | cuttlefish::kConsole [] = "console" |
| static constexpr char | cuttlefish::kModemSimulatorPorts [] = "modem_simulator_ports" |
| static constexpr char | cuttlefish::kEnableModemNetsim [] = "enable_modem_netsim" |
| static constexpr char | cuttlefish::kMobileBridgeName [] = "mobile_bridge_name" |
| static constexpr char | cuttlefish::kMobileTapName [] = "mobile_tap_name" |
| static constexpr char | cuttlefish::kMobileMac [] = "mobile_mac" |
| static constexpr char | cuttlefish::kWifiTapName [] = "wifi_tap_name" |
| static constexpr char | cuttlefish::kHasWifi [] = "has_wifi_card" |
| static constexpr char | cuttlefish::kWifiBridgeName [] = "wifi_bridge_name" |
| static constexpr char | cuttlefish::kWifiMac [] = "wifi_mac" |
| static constexpr char | cuttlefish::kUseBridgedWifiTap [] = "use_bridged_wifi_tap" |
| static constexpr char | cuttlefish::kEthernetTapName [] = "ethernet_tap_name" |
| static constexpr char | cuttlefish::kEthernetBridgeName [] = "ethernet_bridge_name" |
| static constexpr char | cuttlefish::kEthernetMac [] = "ethernet_mac" |
| static constexpr char | cuttlefish::kEthernetIPV6 [] = "ethernet_ipv6" |
| static constexpr char | cuttlefish::kHasBluetooth [] = "has_bluetooth" |
| static constexpr char | cuttlefish::kRequiresHostBluetoothConnector [] |
| static constexpr char | cuttlefish::kEnableHostUwbConnector [] = "enable_host_uwb_connector" |
| static constexpr char | cuttlefish::kUseCvdalloc [] = "use_cvdalloc" |
| static constexpr char | cuttlefish::kSessionId [] = "session_id" |
| static constexpr char | cuttlefish::kVsockGuestCid [] = "vsock_guest_cid" |
| static constexpr char | cuttlefish::kVsockGuestGroup [] = "vsock_guest_group" |
| static constexpr char | cuttlefish::kUuid [] = "uuid" |
| static constexpr char | cuttlefish::kEnvironmentName [] = "environment_name" |
| static constexpr char | cuttlefish::kHostPort [] = "adb_host_port" |
| static constexpr char | cuttlefish::kFastbootHostPort [] = "fastboot_host_port" |
| static constexpr char | cuttlefish::kModemSimulatorId [] = "modem_simulator_host_id" |
| static constexpr char | cuttlefish::kAdbIPAndPort [] = "adb_ip_and_port" |
| static constexpr char | cuttlefish::kQemuVncServerPort [] = "qemu_vnc_server_port" |
| static constexpr char | cuttlefish::kTombstoneReceiverPort [] = "tombstone_receiver_port" |
| static constexpr char | cuttlefish::kAudioControlServerPort [] = "audiocontrol_server_port" |
| static constexpr char | cuttlefish::kLightsServerPort [] = "lights_server_port" |
| static constexpr char | cuttlefish::kCameraServerPort [] = "camera_server_port" |
| static constexpr char | cuttlefish::kWebrtcDeviceId [] = "webrtc_device_id" |
| static constexpr char | cuttlefish::kStartRootcanal [] = "start_rootcanal" |
| static constexpr char | cuttlefish::kStartCasimir [] = "start_casimir" |
| static constexpr char | cuttlefish::kStartPica [] = "start_pica" |
| static constexpr char | cuttlefish::kStartNetsim [] = "start_netsim" |
| static constexpr char | cuttlefish::kStartWmediumdInstance [] = "start_wmediumd_instance" |
| static constexpr char | cuttlefish::kMcu [] = "mcu" |
| static constexpr char | cuttlefish::kApBootFlow [] = "ap_boot_flow" |
| static constexpr char | cuttlefish::kCrosvmUseBalloon [] = "crosvm_use_balloon" |
| static constexpr char | cuttlefish::kCrosvmUseRng [] = "crosvm_use_rng" |
| static constexpr char | cuttlefish::kCrosvmSimpleMediaDevice [] = "crosvm_simple_media_device" |
| static constexpr char | cuttlefish::kCrosvmV4l2Proxy [] = "crosvm_v4l2_proxy" |
| static constexpr char | cuttlefish::kCrosvmUsePmem [] = "use_pmem" |
| static constexpr char | cuttlefish::kEnablePkvm [] = "enable_pkvm" |
| static constexpr char | cuttlefish::kCrosvmAcpiTable [] = "crosvm_acpi_table" |
| static constexpr char | cuttlefish::kCrosvmDeviceTreeOverlay [] = "crosvm_device_tree_overlay" |
| static constexpr char | cuttlefish::kCrosvmFileBackedMapping [] = "crosvm_file_backed_mapping" |
| static constexpr char | cuttlefish::kEnableTapDevices [] = "enable_tap_devices" |
| static constexpr char | cuttlefish::kFrameSockPath [] = "frame_sock_path" |
| static constexpr char | cuttlefish::kWifiMacPrefix [] = "wifi_mac_prefix" |
| static constexpr char | cuttlefish::kEnableVhalProxyServer [] = "enable_vhal_proxy_server" |
| static constexpr char | cuttlefish::kVhalProxyServerPort [] = "vhal_proxy_server_port" |
| static constexpr char | cuttlefish::kAudioOutputStreamsCount [] = "audio_output_streams_count" |
| static constexpr char | cuttlefish::kAudioSettingsTextProto [] = "audio_settings_textproto" |
| static constexpr char | cuttlefish::kMediaConfigs [] = "media_configs" |
| static constexpr char | cuttlefish::kMediaType [] = "type" |
| static constexpr char | cuttlefish::kMediaLensFacing [] = "lens_facing" |
| static constexpr char | cuttlefish::kMediaInputPath [] = "input_path" |
| static constexpr char | cuttlefish::kMediaInputWidth [] = "input_width" |
| static constexpr char | cuttlefish::kMediaInputHeight [] = "input_height" |
| static constexpr char | cuttlefish::kMediaInputFps [] = "input_fps" |