lacrosservice

package
v0.0.0-...-604d171 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2024 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

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

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 (LaCrOSPostInstallState) Name

func (s LaCrOSPostInstallState) Name() string

func (LaCrOSPostInstallState) Next

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.

func (*LaCrOSService) RunVerity

func (l *LaCrOSService) RunVerity(ctx context.Context, payloadBlocks int) error

RunVerity generates the verity (hashtree and table) from Lacros image.

type LaCrOSVerifyState

type LaCrOSVerifyState struct {
	// contains filtered or unexported fields
}

Third step of LaCrOSInstall State Machine. Currently a noop, to be implemented

func (LaCrOSVerifyState) Execute

func (s LaCrOSVerifyState) Execute(ctx context.Context) error

func (LaCrOSVerifyState) Name

func (s LaCrOSVerifyState) Name() string

func (LaCrOSVerifyState) Next

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL