Documentation ¶
Overview ¶
Package device contains functions for dealing with the armored witness hardware device.
Index ¶
Constants ¶
View Source
const ( // USB vendor ID for all supported devices FreescaleVendorID = 0x15a2 // SDP HID report IDs // (p327, 8.9.3.1 SDP commands, IMX6ULLRM). H2D_COMMAND = 1 // Command - Host to Device H2D_DATA = 2 // Data - Host to Device D2H_RESPONSE = 3 // Response - Device to Host D2H_RESPONSE_LAST = 4 // Response - Device to Host )
Variables ¶
View Source
var (
Timeout = 10 * time.Second
)
Functions ¶
func ActivateHAB ¶
ActivateHAB issues the HAB command to the armored witness via HID.
Types ¶
type Target ¶
type Target struct { sync.Mutex // DeviceInfo allows callers to inspect details of the device (e.g. to differentiate // between multiple units connected at once). DeviceInfo hid.DeviceInfo // contains filtered or unexported fields }
Target represents a valid device to be SDP booted
func BootIntoRecovery ¶
func BootIntoRecovery(ctx context.Context, recoveryFirmware []byte, blockDeviceGlob string) (*Target, string, error)
BootIntoRecovery attempts to boot an armored witness device in SDP (Serial Boot) mode with the recovery firmware image, and then watches for a matching new block device to be presented to the host.
If no armored witness device is present, this function will wait until either a device is plugged in/rebooted into SDP mode by the user, or the context becomes done.
Returns the HID device and detected block device path, or an error.
Click to show internal directories.
Click to hide internal directories.