Documentation ¶
Index ¶
- type LaCrOSInstallState
- type LaCrOSMetadata
- type LaCrOSPostInstallState
- type LaCrOSService
- func (l *LaCrOSService) AlignImageToPage(ctx context.Context) (int, error)
- func (l *LaCrOSService) AppendHashtree(ctx context.Context) error
- func (c *LaCrOSService) CleanupOnFailure(states []services.ServiceState, executionErr error) error
- func (l *LaCrOSService) CopyImageToDUT(ctx context.Context) error
- func (l *LaCrOSService) ExtractLacrosMetadata(ctx context.Context) (*LaCrOSMetadata, error)
- func (l *LaCrOSService) FixOwnership(ctx context.Context) error
- func (l *LaCrOSService) GetComponentManifestPath() string
- func (l *LaCrOSService) GetComponentPath() string
- func (l *LaCrOSService) GetCompressedImagePath() string
- func (l *LaCrOSService) GetDeviceCompressedImagePath() string
- func (c *LaCrOSService) GetFirstState() services.ServiceState
- func (l *LaCrOSService) GetHashTreePath() string
- func (l *LaCrOSService) GetLatestVersionPath() string
- func (l *LaCrOSService) GetLocalImagePath() string
- func (l *LaCrOSService) GetManifestPath() string
- func (l *LaCrOSService) GetMetatadaPath() string
- func (l *LaCrOSService) GetTablePath() string
- func (l *LaCrOSService) PublishVersion(ctx context.Context) error
- func (l *LaCrOSService) RunVerity(ctx context.Context, payloadBlocks int) error
- type LaCrOSVerifyState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LaCrOSInstallState ¶
type LaCrOSInstallState struct {
// contains filtered or unexported fields
}
First step of LaCrOSInstall State Machine. Responsible for partition and install
func (LaCrOSInstallState) Execute ¶
func (s LaCrOSInstallState) Execute(ctx context.Context) error
Execute will download and install the Lacros image into the imageloader component directory with the version from the metadata.json file. The Lacros image will also be modified with the correct verity output.
func (LaCrOSInstallState) Name ¶
func (s LaCrOSInstallState) Name() string
func (LaCrOSInstallState) Next ¶
func (s LaCrOSInstallState) Next() services.ServiceState
type LaCrOSMetadata ¶
type LaCrOSMetadata struct { Content struct { Version string `json:"version"` } `json:"content"` }
The following consists of helper structs
type LaCrOSPostInstallState ¶
type LaCrOSPostInstallState struct {
// contains filtered or unexported fields
}
Second step of LaCrOSInstall State Machine. Responsible for stateful provisioning
func (LaCrOSPostInstallState) Execute ¶
func (s LaCrOSPostInstallState) Execute(ctx context.Context) error
func (LaCrOSPostInstallState) Name ¶
func (s LaCrOSPostInstallState) Name() string
func (LaCrOSPostInstallState) Next ¶
func (s LaCrOSPostInstallState) Next() services.ServiceState
type LaCrOSService ¶
type LaCrOSService struct {
// contains filtered or unexported fields
}
LaCrOSService inherits ServiceInterface
func NewLaCrOSService ¶
func NewLaCrOSService(dut *lab_api.Dut, dutClient api.DutServiceClient, req *api.InstallLacrosRequest) (LaCrOSService, error)
func NewLaCrOSServiceFromExistingConnection ¶
func NewLaCrOSServiceFromExistingConnection(conn services.ServiceAdapterInterface, imagePath *conf.StoragePath, metadata *LaCrOSMetadata, overrideVersion string, overrideInstallPath string) LaCrOSService
NewLaCrOSServiceFromExistingConnection is equivalent to the above constructor, but recycles a ServiceAdapter. Generally useful for tests.
func (*LaCrOSService) AlignImageToPage ¶
func (l *LaCrOSService) AlignImageToPage(ctx context.Context) (int, error)
AlignImageToPage will align the file to LacrosPageSize page alignment and return the number of page blocks.
func (*LaCrOSService) AppendHashtree ¶
func (l *LaCrOSService) AppendHashtree(ctx context.Context) error
Append the hashtree (merkle tree) onto the end of the Lacros image.
func (*LaCrOSService) CleanupOnFailure ¶
func (c *LaCrOSService) CleanupOnFailure(states []services.ServiceState, executionErr error) error
CleanupOnFailure is called if one of service's states failes to Execute() and should clean up the temporary files, and undo the execution, if feasible.
func (*LaCrOSService) CopyImageToDUT ¶
func (l *LaCrOSService) CopyImageToDUT(ctx context.Context) error
CopyImageToDUT copies the desired image to the DUT, passing through the caching layer.
func (*LaCrOSService) ExtractLacrosMetadata ¶
func (l *LaCrOSService) ExtractLacrosMetadata(ctx context.Context) (*LaCrOSMetadata, error)
extractLacrosMetadata will unmarshal the metadata.json in the GS path into the state.
func (*LaCrOSService) FixOwnership ¶
func (l *LaCrOSService) FixOwnership(ctx context.Context) error
FixOwnership changes file mode and owner of provisioned files if the path is prefixed with the CrOS component path.
func (*LaCrOSService) GetComponentManifestPath ¶
func (l *LaCrOSService) GetComponentManifestPath() string
func (*LaCrOSService) GetComponentPath ¶
func (l *LaCrOSService) GetComponentPath() string
func (*LaCrOSService) GetCompressedImagePath ¶
func (l *LaCrOSService) GetCompressedImagePath() string
func (*LaCrOSService) GetDeviceCompressedImagePath ¶
func (l *LaCrOSService) GetDeviceCompressedImagePath() string
func (*LaCrOSService) GetFirstState ¶
func (c *LaCrOSService) GetFirstState() services.ServiceState
GetFirstState returns the first state of this state machine
func (*LaCrOSService) GetHashTreePath ¶
func (l *LaCrOSService) GetHashTreePath() string
func (*LaCrOSService) GetLatestVersionPath ¶
func (l *LaCrOSService) GetLatestVersionPath() string
func (*LaCrOSService) GetLocalImagePath ¶
func (l *LaCrOSService) GetLocalImagePath() string
func (*LaCrOSService) GetManifestPath ¶
func (l *LaCrOSService) GetManifestPath() string
func (*LaCrOSService) GetMetatadaPath ¶
func (l *LaCrOSService) GetMetatadaPath() string
func (*LaCrOSService) GetTablePath ¶
func (l *LaCrOSService) GetTablePath() string
func (*LaCrOSService) PublishVersion ¶
func (l *LaCrOSService) PublishVersion(ctx context.Context) error
PublishVersion writes the Lacros version to the latest-version file.
type LaCrOSVerifyState ¶
type LaCrOSVerifyState struct {
// contains filtered or unexported fields
}
Third step of LaCrOSInstall State Machine. Currently a noop, to be implemented
func (LaCrOSVerifyState) Name ¶
func (s LaCrOSVerifyState) Name() string
func (LaCrOSVerifyState) Next ¶
func (s LaCrOSVerifyState) Next() services.ServiceState