1 /* 2 * Copyright (C) 2022 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 #pragma once 17 #define CF_DEFAULTS_DYNAMIC_STRING "" 18 #define CF_DEFAULTS_DYNAMIC_INT 0 19 20 // Common configs paramneters 21 #define CF_DEFAULTS_NUM_INSTANCES 1 22 #define CF_DEFAULTS_INSTANCE_NUMS CF_DEFAULTS_DYNAMIC_STRING 23 #define CF_DEFAULTS_BASE_INSTANCE_NUM cuttlefish::GetInstance() 24 #define CF_DEFAULTS_ASSEMBLY_DIR \ 25 (StringFromEnv("HOME", ".") + "/cuttlefish_assembly") 26 #define CF_DEFAULTS_INSTANCE_DIR (StringFromEnv("HOME", ".") + "/cuttlefish") 27 28 #define CF_DEFAULTS_SYSTEM_IMAGE_DIR CF_DEFAULTS_DYNAMIC_STRING 29 30 // Instance specific parameters 31 // VM default parameters 32 #define CF_DEFAULTS_DISPLAY_DPI 320 33 #define CF_DEFAULTS_DISPLAY_REFRESH_RATE 60 34 #define CF_DEFAULTS_DISPLAY_WIDTH 720 35 #define CF_DEFAULTS_DISPLAY_HEIGHT 1280 36 #define CF_DEFAULTS_DISPLAYS_TEXTPROTO "" 37 #define CF_DEFAULTS_CPUS 2 38 #define CF_DEFAULTS_RESUME true 39 #define CF_DEFAULTS_DAEMON false 40 #define CF_DEFAULTS_VM_MANAGER CF_DEFAULTS_DYNAMIC_STRING 41 #define CF_DEFAULTS_VSOCK_GUEST_CID cuttlefish::GetDefaultVsockCid() 42 #define CF_DEFAULTS_ENABLE_MINIMAL_MODE false 43 #define CF_DEFAULTS_RESTART_SUBPROCESSES false 44 #define CF_DEFAULTS_SETUPWIZARD_MODE "DISABLED" 45 #define CF_DEFAULTS_SMT false 46 #define CF_DEFAULTS_USE_ALLOCD false 47 #define CF_DEFAULTS_USE_SDCARD true 48 #define CF_DEFAULTS_UUID \ 49 cuttlefish::ForCurrentInstance(cuttlefish::kDefaultUuidPrefix) 50 #define CF_DEFAULTS_FILE_VERBOSITY "DEBUG" 51 #define CF_DEFAULTS_VERBOSITY "INFO" 52 #define CF_DEFAULTS_RUN_FILE_DISCOVERY true 53 #define CF_DEFAULTS_MEMORY_MB CF_DEFAULTS_DYNAMIC_INT 54 #define CF_DEFAULTS_SHARE_SCHED_CORE false 55 // TODO: defined twice, please remove redundant definitions 56 #define CF_DEFAULTS_USE_OVERLAY true 57 58 // crosvm default parameters 59 #define CF_DEFAULTS_CROSVM_BINARY HostBinaryPath("crosvm") 60 #define CF_DEFAULTS_SECCOMP_POLICY_DIR cuttlefish::GetSeccompPolicyDir() 61 #define CF_DEFAULTS_ENABLE_SANDBOX false 62 63 // Qemu default parameters 64 #define CF_DEFAULTS_QEMU_BINARY_DIR "/usr/bin" 65 66 // Gem5 default parameters 67 #define CF_DEFAULTS_GEM5_BINARY_DIR HostBinaryPath("gem5") 68 #define CF_DEFAULTS_GEM5_CHECKPOINT_DIR CF_DEFAULTS_DYNAMIC_STRING 69 #define CF_DEFAULTS_GEM5_DEBUG_FILE CF_DEFAULTS_DYNAMIC_STRING 70 #define CF_DEFAULTS_GEM5_DEBUG_FLAGS CF_DEFAULTS_DYNAMIC_STRING 71 72 // Boot default parameters 73 #define CF_DEFAULTS_BOOT_SLOT CF_DEFAULTS_DYNAMIC_STRING 74 #define CF_DEFAULTS_BOOTLOADER CF_DEFAULTS_DYNAMIC_STRING 75 #define CF_DEFAULTS_ENABLE_BOOTANIMATION true 76 #define CF_DEFAULTS_EXTRA_BOOTCONFIG_ARGS CF_DEFAULTS_DYNAMIC_STRING 77 #define CF_DEFAULTS_PAUSE_IN_BOOTLOADER false 78 #define CF_DEFAULTS_REBOOT_NOTIFICATION_FD (-1) 79 80 // Security default parameters 81 #define CF_DEFAULTS_GUEST_ENFORCE_SECURITY true 82 #define CF_DEFAULTS_USE_RANDOM_SERIAL false 83 #define CF_DEFAULTS_SERIAL_NUMBER \ 84 cuttlefish::ForCurrentInstance("CUTTLEFISHCVD") 85 #define CF_DEFAULTS_SECURE_HALS "keymint,gatekeeper" 86 #define CF_DEFAULTS_PROTECTED_VM false 87 #define CF_DEFAULTS_MTE false 88 89 // Kernel default parameters 90 #define CF_DEFAULTS_ENABLE_KERNEL_LOG true 91 #define CF_DEFAULTS_KGDB false 92 #define CF_DEFAULTS_GDB_PORT CF_DEFAULTS_DYNAMIC_INT 93 #define CF_DEFAULTS_CONSOLE false 94 #define CF_DEFAULTS_EXTRA_KERNEL_CMDLINE CF_DEFAULTS_DYNAMIC_STRING 95 #define CF_DEFAULTS_INITRAMFS_PATH CF_DEFAULTS_DYNAMIC_STRING 96 #define CF_DEFAULTS_KERNEL_PATH CF_DEFAULTS_DYNAMIC_STRING 97 98 // Disk default parameters 99 #define CF_DEFAULTS_BLANK_METADATA_IMAGE_MB "64" 100 #define CF_DEFAULTS_BLANK_SDCARD_IMAGE_MB "2048" 101 #define CF_DEFAULTS_BOOT_IMAGE CF_DEFAULTS_DYNAMIC_STRING 102 #define CF_DEFAULTS_DATA_IMAGE CF_DEFAULTS_DYNAMIC_STRING 103 #define CF_DEFAULTS_INIT_BOOT_IMAGE CF_DEFAULTS_DYNAMIC_STRING 104 #define CF_DEFAULTS_METADATA_IMAGE CF_DEFAULTS_DYNAMIC_STRING 105 #define CF_DEFAULTS_MISC_IMAGE CF_DEFAULTS_DYNAMIC_STRING 106 #define CF_DEFAULTS_LINUX_INITRAMFS_PATH CF_DEFAULTS_DYNAMIC_STRING 107 #define CF_DEFAULTS_LINUX_KERNEL_PATH CF_DEFAULTS_DYNAMIC_STRING 108 #define CF_DEFAULTS_LINUX_ROOT_IMAGE CF_DEFAULTS_DYNAMIC_STRING 109 #define CF_DEFAULTS_FUCHSIA_ZEDBOOT_PATH CF_DEFAULTS_DYNAMIC_STRING 110 #define CF_DEFAULTS_FUCHSIA_MULTIBOOT_BIN_PATH CF_DEFAULTS_DYNAMIC_STRING 111 #define CF_DEFAULTS_FUCHSIA_ROOT_IMAGE CF_DEFAULTS_DYNAMIC_STRING 112 #define CF_DEFAULTS_CUSTOM_PARTITION_PATH CF_DEFAULTS_DYNAMIC_STRING 113 #define CF_DEFAULTS_SUPER_IMAGE CF_DEFAULTS_DYNAMIC_STRING 114 #define CF_DEFAULTS_VBMETA_IMAGE CF_DEFAULTS_DYNAMIC_STRING 115 #define CF_DEFAULTS_VBMETA_SYSTEM_IMAGE CF_DEFAULTS_DYNAMIC_STRING 116 #define CF_DEFAULTS_VBMETA_VENDOR_DLKM_IMAGE CF_DEFAULTS_DYNAMIC_STRING 117 #define CF_DEFAULTS_VENDOR_BOOT_IMAGE CF_DEFAULTS_DYNAMIC_STRING 118 119 // Policy default parameters 120 #define CF_DEFAULTS_DATA_POLICY "use_existing" 121 #define CF_DEFAULTS_USERDATA_FORMAT "f2fs" 122 #define CF_DEFAULTS_BLANK_DATA_IMAGE_MB CF_DEFAULTS_DYNAMIC_INT 123 124 // Graphics default parameters 125 #define CF_DEFAULTS_HWCOMPOSER cuttlefish::kHwComposerAuto 126 #define CF_DEFAULTS_GPU_MODE cuttlefish::kGpuModeAuto 127 #define CF_DEFAULTS_RECORD_SCREEN false 128 #define CF_DEFAULTS_GPU_CAPTURE_BINARY CF_DEFAULTS_DYNAMIC_STRING 129 #define CF_DEFAULTS_ENABLE_GPU_UDMABUF false 130 #define CF_DEFAULTS_DISPLAY0 CF_DEFAULTS_DYNAMIC_STRING 131 #define CF_DEFAULTS_DISPLAY1 CF_DEFAULTS_DYNAMIC_STRING 132 #define CF_DEFAULTS_DISPLAY2 CF_DEFAULTS_DYNAMIC_STRING 133 #define CF_DEFAULTS_DISPLAY3 CF_DEFAULTS_DYNAMIC_STRING 134 135 // Camera default parameters 136 #define CF_DEFAULTS_CAMERA_SERVER_PORT CF_DEFAULTS_DYNAMIC_INT 137 138 // Connectivity default parameters 139 #define CF_DEFAULTS_RIL_DNS "8.8.8.8" 140 #define CF_DEFAULTS_NETSIM false 141 #define CF_DEFAULTS_NETSIM_BT false 142 143 // Wifi default parameters 144 #define CF_DEFAULTS_AP_KERNEL_IMAGE CF_DEFAULTS_DYNAMIC_STRING 145 #define CF_DEFAULTS_AP_ROOTFS_IMAGE CF_DEFAULTS_DYNAMIC_STRING 146 #define CF_DEFAULTS_VHOST_NET false 147 #define CF_DEFAULTS_VHOST_USER_MAC80211_HWSIM CF_DEFAULTS_DYNAMIC_STRING 148 #define CF_DEFAULTS_WMEDIUMD_CONFIG CF_DEFAULTS_DYNAMIC_STRING 149 150 // UWB default parameters 151 #define CF_DEFAULTS_ENABLE_HOST_UWB false 152 #define CF_DEFAULTS_ENABLE_PICA_INSTANCE_NUM 0 153 154 // Bluetooth default parameters 155 #define CF_DEFAULTS_BLUETOOTH_CONTROLLER_PROPERTIES_FILE \ 156 "etc/rootcanal/data/controller_properties.json" 157 #define CF_DEFAULTS_BLUETOOTH_DEFAULT_COMMANDS_FILE \ 158 "etc/rootcanal/data/default_commands" 159 #define CF_DEFAULTS_ENABLE_HOST_BLUETOOTH true 160 #define CF_DEFAULTS_ENABLE_ROOTCANAL_INSTANCE_NUM 0 161 #define CF_DEFAULTS_ROOTCANAL_ARGS CF_DEFAULTS_DYNAMIC_STRING 162 163 // Modem Simulator default parameters 164 #define CF_DEFAULTS_ENABLE_MODEM_SIMULATOR true 165 #define CF_DEFAULTS_MODEM_SIMULATOR_SIM_TYPE 1 166 #define CF_DEFAULTS_MODEM_SIMULATOR_COUNT 1 167 168 // Audio default parameters 169 #define CF_DEFAULTS_ENABLE_AUDIO true 170 171 // Streaming default parameters 172 #define CF_DEFAULTS_START_WEBRTC false 173 #define CF_DEFAULTS_START_WEBRTC_SIG_SERVER true 174 #define CF_DEFAULTS_WEBRTC_DEVICE_ID "cvd-{num}" 175 #define CF_DEFAULTS_VERIFY_SIG_SERVER_CERTIFICATE false 176 #define CF_DEFAULTS_WEBRTC_ASSETS_DIR \ 177 DefaultHostArtifactsPath("usr/share/webrtc/assets") 178 #define CF_DEFAULTS_WEBRTC_CERTS_DIR \ 179 DefaultHostArtifactsPath("usr/share/webrtc/certs") 180 #define CF_DEFAULTS_WEBRTC_SIG_SERVER_ADDR CF_DEFAULTS_DYNAMIC_STRING 181 #define CF_DEFAULTS_WEBRTC_SIG_SERVER_PATH "/register_device" 182 #define CF_DEFAULTS_WEBRTC_SIG_SERVER_PORT 443 183 #define CF_DEFAULTS_WEBRTC_SIG_SERVER_SECURE true 184 #define CF_DEFAULTS_TCP_PORT_RANGE "15550:15599" 185 #define CF_DEFAULTS_UDP_PORT_RANGE "15550:15599" 186 187 // Adb default parameters 188 // TODO : Replaceconstants with these flags, they're currently defined throug 189 // GflagsCompatFlag 190 #define CF_DEFAULTS_RUN_ADB_CONNECTOR true 191 #define CF_DEFAULTS_ADB_MODE "vsock_half_tunnel" 192 193 // Location default parameters 194 #define CF_DEFAULTS_START_GNSS_PROXY true 195 #define CF_DEFAULTS_FIXED_LOCATION_FILE_PATH CF_DEFAULTS_DYNAMIC_STRING 196 #define CF_DEFAULTS_GNSS_FILE_PATH CF_DEFAULTS_DYNAMIC_STRING 197 198 // Metrics default parameters 199 // TODO: Defined twice , please remove redundant definitions 200 #define CF_DEFAULTS_REPORT_ANONYMOUS_USAGE_STATS CF_DEFAULTS_DYNAMIC_STRING 201