1// Copyright 2021 The ChromiumOS Authors 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5syntax = "proto3"; 6 7package chromiumos.test.api; 8 9option go_package = "go.chromium.org/chromiumos/config/go/test/api"; 10 11import "chromiumos/build/api/firmware_config.proto"; 12import "chromiumos/longrunning/operations.proto"; 13import "chromiumos/storage_path.proto"; 14 15// Stable (build-agnostic) interface for installing software (provisioning) 16// on a Chrome OS device. 17service ProvisionService { 18 // InstallCros installs a specified version of Chrome OS on the DUT, along 19 // with any specified DLCs. 20 // 21 // If the DUT is already on the specified version of Chrome OS, the OS will 22 // not be installed. 23 // 24 // If the DUT already has the specified list of DLCs, only the missing DLCs 25 // will be installed. 26 rpc InstallCros(InstallCrosRequest) 27 returns (longrunning.Operation) { 28 option (longrunning.operation_info) = { 29 response_type: "InstallCrosResponse", 30 metadata_type: "InstallCrosMetadata" 31 }; 32 } 33 34 // InstallAsh installs a specified version of ash-chrome on the DUT. 35 // 36 // This directly overwrites the version of ash-chrome on the current root 37 // disk partition. 38 rpc InstallAsh(InstallAshRequest) 39 returns (longrunning.Operation) { 40 option (longrunning.operation_info) = { 41 response_type: "InstallAshResponse", 42 metadata_type: "InstallAshMetadata" 43 }; 44 } 45 46 // InstallArc installs a specified version of ARC on the DUT. 47 // 48 // This directly overwrites the version of ARC on the current root 49 // disk partition. 50 rpc InstallArc(InstallArcRequest) 51 returns (longrunning.Operation) { 52 option (longrunning.operation_info) = { 53 response_type: "InstallArcResponse", 54 metadata_type: "InstallArcMetadata" 55 }; 56 } 57 58 // InstallFirmware installs all of the firmware images specified. 59 rpc InstallFirmware(InstallFirmwareRequest) 60 returns (longrunning.Operation) { 61 option (longrunning.operation_info) = { 62 response_type: "InstallFirmwareResponse", 63 metadata_type: "InstallFirmwareMetadata" 64 }; 65 } 66} 67 68message InstallSuccess { 69} 70 71message InstallFailure { 72 // When the status code is other than OK, details in Status message should be 73 // parsed for ErrorInfo message with the following Reasons as the reason. 74 enum Reason { 75 // status code: INVALID_ARGUMENT 76 REASON_INVALID_REQUEST = 0; 77 // status code: FAILED_PRECONDITION 78 REASON_DUT_UNREACHABLE_PRE_PROVISION = 1; 79 // status code: FAILED_PRECONDITION 80 REASON_DOWNLOADING_IMAGE_FAILED = 2; 81 // status code: DEADLINE_EXCEEDED 82 REASON_PROVISIONING_TIMEDOUT = 3; 83 // status code: ABORTED 84 REASON_PROVISIONING_FAILED = 4; 85 // status code: ABORTED 86 REASON_DUT_UNREACHABLE_POST_PROVISION = 5; 87 // status code: ABORTED 88 REASON_UPDATE_FIRMWARE_FAILED = 6; 89 // status code: ABORTED 90 REASON_FIRMWARE_MISMATCH_POST_FIRMWARE_UPDATE = 7; 91 // status code: ABORTED 92 REASON_DUT_UNREACHABLE_POST_FIRMWARE_UPDATE = 8; 93 // status code: ABORTED 94 REASON_UPDATE_MINIOS_FAILED = 9; 95 // status code: ABORTED 96 REASON_POST_PROVISION_SETUP_FAILED = 10; 97 // status code: ABORTED 98 REASON_CLEAR_TPM_FAILED = 11; 99 // status code: ABORTED 100 REASON_STABLIZE_DUT_FAILED = 12; 101 // status code: ABORTED 102 REASON_INSTALL_DLC_FAILED = 13; 103 // status code: ABORTED 104 REASON_PRE_PROVISION_SETUP_FAILED = 14; 105 // status code: ABORTED 106 REASON_CIPD_PACKAGE_LOOKUP_FAILED = 15; 107 // status code: ABORTED 108 REASON_CIPD_PACKAGE_FETCH_FAILED = 16; 109 // status code: ABORTED 110 REASON_GS_UPLOAD_FAILED = 17; 111 // status code: ABORTED 112 REASON_GS_DOWNLOAD_FAILED = 18; 113 // status code: ABORTED 114 // TODO (b/266634996) Remove once CTRv1 is deprecated and move into TR. 115 REASON_DOCKER_UNABLE_TO_START = 19; 116 // TODO (b/266634996) Remove once CTRv1 is deprecated and move into TR. 117 // status code: ABORTED 118 REASON_SERVICE_UNABLE_TO_START = 20; 119 // TODO (b/266634996) Remove once CTRv1 is deprecated and move into TR. 120 // status:code ABORT 121 REASON_SERVICE_CONTAINER_UNABLE_TO_PULL = 21; 122 // status code: ABORTED 123 REASON_IMAGE_MISMATCH_POST_PROVISION_UPDATE = 22; 124 } 125 126 Reason reason = 1; 127} 128 129message InstallCrosRequest { 130 StoragePath cros_image_path = 1; 131 132 // Reference DLCs developer documentation: 133 // https://source.corp.google.com/chromeos_public/src/platform2/dlcservice/docs/developer.md 134 message DLCSpec { 135 // id is the DLC ID which is a unique identifier. 136 // The DLC ID must follow a specific format that can be found in the DLC 137 // developer doc below. 138 string id = 1; 139 } 140 // dlc_specs specifies which DLCs to install on the DUT after provisioning. 141 repeated DLCSpec dlc_specs = 2; 142 // preserve_stateful specifies whether the stateful partition should be preserved during 143 // provisioning. If preserve_stateful is not set to true, the stateful partition is 144 // block-level wiped and reset during provisioning. 145 bool preserve_stateful = 3; 146 // Prevents device reboot during system image provisioning. 147 bool prevent_reboot = 4; 148 149 // Provides a possible tar file to overwrite current install files 150 StoragePath overwrite_payload = 5; 151 152 // update_firmware will update OS bundled firmware(RW only) during the provision. 153 // Please note this firmware update only update RW firmware that built in the 154 // target_build OS image and it is different from firmware provision which 155 // download and update a separate firmware image based on request. 156 bool update_firmware = 6; 157} 158 159message InstallCrosResponse { 160 oneof outcome { 161 InstallSuccess success = 1; 162 InstallFailure failure = 2; 163 } 164} 165 166message InstallCrosMetadata { 167} 168 169message InstallLacrosRequest { 170 StoragePath lacros_image_path = 1; 171 string override_version = 2; 172 string override_install_path = 3; 173} 174 175message InstallLacrosResponse { 176 oneof outcome { 177 InstallSuccess success = 1; 178 InstallFailure failure = 2; 179 } 180} 181 182message InstallLacrosMetadata { 183} 184 185message InstallAshRequest { 186 StoragePath ash_image_path = 1; 187} 188 189message InstallAshResponse { 190 oneof outcome { 191 InstallSuccess success = 1; 192 InstallFailure failure = 2; 193 } 194} 195 196message InstallAshMetadata { 197} 198 199message InstallArcRequest { 200 StoragePath ash_image_path = 1; 201} 202 203message InstallArcResponse { 204 oneof outcome { 205 InstallSuccess success = 1; 206 InstallFailure failure = 2; 207 } 208} 209 210message InstallArcMetadata { 211} 212 213message InstallFirmwareRequest { 214 chromiumos.build.api.FirmwareConfig firmware_config = 1; 215 216 // Use force to pass "--force" to futility, which skips the TPM checks. 217 bool force = 8; 218 219 // If True, provision firmware over servo; information about 220 // servo to use will be pulled from a `Dut` proto, that will be 221 // requested from InventoryService. 222 // If False, SSH to the DUT and provision it directly. 223 bool use_servo = 9; 224} 225 226message InstallFirmwareResponse { 227 oneof outcome { 228 InstallSuccess success = 1; 229 InstallFailure failure = 2; 230 } 231} 232 233message InstallFirmwareMetadata { 234} 235