Documentation
¶
Overview ¶
CBI corruption detection and repair logic. go/cbi-auto-recovery-dd
Index ¶
- Constants
- Variables
- func CrasAudioNodeTypeIsPlugged(ctx context.Context, r execs.Runner, nodeType string) (bool, error)
- func FindSingleUsbDeviceFSDir(ctx context.Context, r execs.Runner, basePath string, vid string, pid string) (string, error)
- func GetCr50FwKeyID(ctx context.Context, r execs.Runner, region CR50Region) (string, error)
- func GetCr50FwVersion(ctx context.Context, r execs.Runner, region CR50Region) (string, error)
- func ReadCryptoHomeStatusInfo(ctx context.Context, rawOutput string) (*cryptoHomeStatus, error)
- func ReadFirmwareManifest(ctx context.Context, r execs.Runner, dutModel string) (*modelFirmware, error)
- func ServoNICMacAddress(ctx context.Context, r execs.Runner, nicPath string) (string, error)
- func UpdateStorageInfoToInvExec(ctx context.Context, info *execs.ExecInfo) error
- type CR50Region
Constants ¶
const ( // Servo's DUT side HUB vendor id SERVO_DUT_HUB_VID = "04b4" // Servo's DUT side HUB product id SERVO_DUT_HUB_PID = "6502" // Servo's DUT side NIC vendor id SERVO_DUT_NIC_VID = "0bda" // Servo's DUT side NIC product id SERVO_DUT_NIC_PID = "8153" )
const ( // CrasAudioHeadphone is the string value for finding the nodeType of audio headphone // in the output of the crasAudioNodesQueryCmd. CrasAudioHeadphone = "HEADPHONE" // CrasAudioMic is the string value for finding the nodeType of audio mic // in the output of the crasAudioNodesQueryCmd. CrasAudioMic = "MIC" )
const ( // Time to wait a rebooting ChromeOS, in seconds. NormalBootingTime = 150 * time.Second )
Variables ¶
var RwVPDMap = map[string]string{
"should_send_rlz_ping": "0",
"gbind_attribute": "=CikKIKxeOtv7AqiCHCDBHkyLN-HF0S7JRcZgsoIRvkPlfMqaEAAaA2V2ZRCX0O3NBg==",
"ubind_attribute": "=CikKILiLqJanLAzsXFuVPmfc_aOZxnyNirT9iesdM6kt59x6EAEaA2V2ZRCIkb3GCQ==",
}
RwVPDMap are the default requared values for RW_VPD
Functions ¶
func CrasAudioNodeTypeIsPlugged ¶
CrasAudioNodeTypeIsPlugged finds if the specified audio type node is present in the list of all plugged Cras Audio Nodes.
Example of the type "INTERNAL_MIC" Cras Audio Nodes present on the DUT:
dict entry(
string "Type" variant string "INTERNAL_MIC"
)
@param nodeType : A string representing Cras Audio Node Type @returns:
if the err == nil, the boolean value returned represents whether the given audio node type is found in the output. if the err != nil, the execution of this function is not successful, the boolean value returned is set as default.
func FindSingleUsbDeviceFSDir ¶
func FindSingleUsbDeviceFSDir(ctx context.Context, r execs.Runner, basePath string, vid string, pid string) (string, error)
FindSingleUsbDeviceFSDir find the common parent directory where the unique device with VID and PID is enumerated by file system.
- Get path to the unique idVendor file with VID
- Get path to the unique idProduct file with PID
- Get directions of both files and compare them
@param basePath: Path to the directory where to look for the device. @param vid: Vendor ID of the looking device. @param pid: Product ID of the looking device.
@returns: path to the folder of the device.
func GetCr50FwKeyID ¶
GetCr50FwKeyID gets the cr 50 firmware RO/RW key id based on the region parameter. @param region: "RW" or "RO"
func GetCr50FwVersion ¶
GetCr50FwVersion gets the cr 50 firmware RO/RW version based on the region parameter. @param region: "RW" or "RO"
func ReadCryptoHomeStatusInfo ¶
ReadCryptoHomeStatusInfo read and parse TPM status information and return cryptoHomeStatus struct to access this information. The cryptohome command emits status information in JSON format. It looks something like this:
{ "installattrs": { ... }, "mounts": [ { ... } ], "tpm": { "being_owned": false, "can_connect": true, "can_decrypt": false, "can_encrypt": false, "can_load_srk": true, "can_load_srk_pubkey": true, "enabled": true, "has_context": true, "has_cryptohome_key": false, "has_key_handle": false, "last_error": 0, "owned": true } }
func ReadFirmwareManifest ¶
func ReadFirmwareManifest(ctx context.Context, r execs.Runner, dutModel string) (*modelFirmware, error)
ReadFirmwareManifest reads the firmware update manifest info and return a modelFirmware struct.
func ServoNICMacAddress ¶
ServoNICMacAddress read servo NIC mac address visible from DUT side.
@param nic_path: Path to network device on the host
Types ¶
type CR50Region ¶
type CR50Region string
CR50Region describes either the RO or RW of the firmware.
const ( CR50RegionRO CR50Region = "RO" CR50RegionRW CR50Region = "RW" )
Source Files
¶
- battery_execs.go
- bluetooth_execs.go
- cache_execs.go
- camera_execs.go
- carrier_execs.go
- cellular_execs.go
- cros.go
- cros_audio_loop_back.go
- cros_battery_exec.go
- cros_boot_exec.go
- cros_cbi.go
- cros_cr50.go
- cros_cr50_execs.go
- cros_ectool_execs.go
- cros_execs.go
- cros_fingerprint_execs.go
- cros_fingerprint_mcu_execs.go
- cros_firmware_execs.go
- cros_gpu_id_execs.go
- cros_install_exec.go
- cros_labels_execs.go
- cros_logs_execs.go
- cros_stateful.go
- cros_ui_execs.go
- cros_uptime_execs.go
- cros_usb.go
- crypto_home_status.go
- dut_info_exec.go
- enrollment_execs.go
- firmware_by_servo_execs.go
- firmware_execs.go
- firmware_update_info.go
- flex_execs.go
- hwid_execs.go
- in_use_execs.go
- kernel_execs.go
- keyboard_execs.go
- labels_execs.go
- labstation_execs.go
- power_execs.go
- provision_execs.go
- provision_info_execs.go
- reboot_request_execs.go
- release_info_execs.go
- ro_vpd_execs.go
- rootfs_execs.go
- rw_vpd_execs.go
- serial_number_execs.go
- starfish_execs.go
- storage_execs.go
- tpm_execs.go
- wifi_execs.go