Documentation ¶
Overview ¶
Package crosservice state machine construction and helper
Fourth and final step in the CrOSInstall State Machine. Installs DLCs
First step of CrOSInstall State Machine. Responsible for partition and install
Second step of CrOSInstall State Machine. Responsible for stateful provisioning
Fourth and final step in the CrOSInstall State Machine. Installs DLCs
Third step in the CrOSInstall State Machine. Currently a noop, to be implemented
Index ¶
- type CrOSInstallMiniOSState
- type CrOSInstallState
- type CrOSPostInstallState
- type CrOSProvisionDLCState
- type CrOSService
- func (c *CrOSService) CanClearTPM(ctx context.Context) bool
- func (c *CrOSService) CleanupOnFailure(states []services.ServiceState, executionErr error) error
- func (c *CrOSService) ClearDLCArtifacts(ctx context.Context, rootPartNum string) error
- func (c *CrOSService) ClearTPM(ctx context.Context) error
- func (c *CrOSService) CorrectDLCPermissions(ctx context.Context) error
- func (c *CrOSService) CreateProvisionMarker(ctx context.Context) error
- func (c *CrOSService) GetFirstState() services.ServiceState
- func (c *CrOSService) GetRoot(ctx context.Context) (string, error)
- func (c *CrOSService) GetRootDisk(ctx context.Context) (string, error)
- func (c *CrOSService) GetRootPartNumber(ctx context.Context, root string) (string, error)
- func (c *CrOSService) InstallDLC(ctx context.Context, spec *api.InstallCrosRequest_DLCSpec, slot string) error
- func (c *CrOSService) InstallMiniOS(ctx context.Context, pi info.PartitionInfo) error
- func (c *CrOSService) InstallPartitions(ctx context.Context, pi info.PartitionInfo) error
- func (c *CrOSService) InstallStateful(ctx context.Context) error
- func (c *CrOSService) InstallZippedImage(ctx context.Context, remoteImagePath string, outputFile string) error
- func (c *CrOSService) IsDLCVerified(ctx context.Context, dlcID, slot string) (bool, error)
- func (c *CrOSService) IsMiniOSPartitionSupported(ctx context.Context, rootDisk string, rootPart string) (bool, error)
- func (c *CrOSService) OverwiteInstall(ctx context.Context) error
- func (c *CrOSService) PostInstall(ctx context.Context, inactiveRoot string) error
- func (c *CrOSService) ProvisionStateful(ctx context.Context) error
- func (c *CrOSService) RevertPostInstall(ctx context.Context, activeRoot string)
- func (c *CrOSService) RevertProvisionOS(ctx context.Context, activeRoot string)
- func (c *CrOSService) RevertStatefulInstall(ctx context.Context)
- func (c *CrOSService) StartDLCService(ctx context.Context)
- func (c *CrOSService) StopDLCService(ctx context.Context)
- func (c *CrOSService) StopSystemDaemons(ctx context.Context)
- func (c *CrOSService) WipeStateful(ctx context.Context) error
- type CrOSVerifyState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CrOSInstallMiniOSState ¶
type CrOSInstallMiniOSState struct {
// contains filtered or unexported fields
}
func (CrOSInstallMiniOSState) Execute ¶
func (s CrOSInstallMiniOSState) Execute(ctx context.Context) error
func (CrOSInstallMiniOSState) Name ¶
func (s CrOSInstallMiniOSState) Name() string
func (CrOSInstallMiniOSState) Next ¶
func (s CrOSInstallMiniOSState) Next() services.ServiceState
type CrOSInstallState ¶
type CrOSInstallState struct {
// contains filtered or unexported fields
}
func (CrOSInstallState) Name ¶
func (s CrOSInstallState) Name() string
func (CrOSInstallState) Next ¶
func (s CrOSInstallState) Next() services.ServiceState
type CrOSPostInstallState ¶
type CrOSPostInstallState struct {
// contains filtered or unexported fields
}
func (CrOSPostInstallState) Execute ¶
func (s CrOSPostInstallState) Execute(ctx context.Context) error
func (CrOSPostInstallState) Name ¶
func (s CrOSPostInstallState) Name() string
func (CrOSPostInstallState) Next ¶
func (s CrOSPostInstallState) Next() services.ServiceState
type CrOSProvisionDLCState ¶
type CrOSProvisionDLCState struct {
// contains filtered or unexported fields
}
func (CrOSProvisionDLCState) Execute ¶
func (s CrOSProvisionDLCState) Execute(ctx context.Context) error
func (CrOSProvisionDLCState) Name ¶
func (s CrOSProvisionDLCState) Name() string
func (CrOSProvisionDLCState) Next ¶
func (s CrOSProvisionDLCState) Next() services.ServiceState
type CrOSService ¶
type CrOSService struct {
// contains filtered or unexported fields
}
CrOSService inherits ServiceInterface
func NewCrOSService ¶
func NewCrOSService(dut *lab_api.Dut, dutClient api.DutServiceClient, req *api.InstallCrosRequest) CrOSService
NewCrOSService inherits CrOSService
func NewCrOSServiceFromExistingConnection ¶
func NewCrOSServiceFromExistingConnection(conn services.ServiceAdapterInterface, imagePath *conf.StoragePath, overwritePayload *conf.StoragePath, preserverStateful bool, dlcSpecs []*api.InstallCrosRequest_DLCSpec) CrOSService
NewCrOSServiceFromExistingConnection is equivalent to the above constructor, but recycles a ServiceAdapter. Generally useful for tests.
func (*CrOSService) CanClearTPM ¶
func (c *CrOSService) CanClearTPM(ctx context.Context) bool
CanClearTPM determines whether the current board can clear TPM
func (*CrOSService) CleanupOnFailure ¶
func (c *CrOSService) 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 (*CrOSService) ClearDLCArtifacts ¶
func (c *CrOSService) ClearDLCArtifacts(ctx context.Context, rootPartNum string) error
ClearDLCArtifacts will clear the verified marks for all DLCs in the inactive slots.
func (*CrOSService) ClearTPM ¶
func (c *CrOSService) ClearTPM(ctx context.Context) error
ClearTPM runs crosssystem clear tpm request
func (*CrOSService) CorrectDLCPermissions ¶
func (c *CrOSService) CorrectDLCPermissions(ctx context.Context) error
CorrectDLCPermissions changes the permission and ownership of DLC cache to the correct one. As part of the transition to using tmpfiles.d, dlcservice paths must have correct permissions/owners set. Simply starting the dlcservice daemon will not fix this due to security concerns.
func (*CrOSService) CreateProvisionMarker ¶
func (c *CrOSService) CreateProvisionMarker(ctx context.Context) error
CreateProvisionMarker Creates a marker, whose existance signals a failure in provisioning
func (*CrOSService) GetFirstState ¶
func (c *CrOSService) GetFirstState() services.ServiceState
GetFirstState returns the first state of this state machine
func (*CrOSService) GetRoot ¶
func (c *CrOSService) GetRoot(ctx context.Context) (string, error)
GetRoot returns the rootdev outoput for root
func (*CrOSService) GetRootDisk ¶
func (c *CrOSService) GetRootDisk(ctx context.Context) (string, error)
GetRootDisk returns the rootdev output for disk
func (*CrOSService) GetRootPartNumber ¶
GetRootPartNumber parses the root number for a specific root
func (*CrOSService) InstallDLC ¶
func (c *CrOSService) InstallDLC(ctx context.Context, spec *api.InstallCrosRequest_DLCSpec, slot string) error
InstallDLC installs all relevant DLCs
func (*CrOSService) InstallMiniOS ¶
func (c *CrOSService) InstallMiniOS(ctx context.Context, pi info.PartitionInfo) error
InstallMiniOS downloads and installs the minios images
func (*CrOSService) InstallPartitions ¶
func (c *CrOSService) InstallPartitions(ctx context.Context, pi info.PartitionInfo) error
InstallPartitions installs the kernel and root images in parallel
func (*CrOSService) InstallStateful ¶
func (c *CrOSService) InstallStateful(ctx context.Context) error
InstallStateful updates the stateful partition on disk (finalized after a reboot).
func (*CrOSService) InstallZippedImage ¶
func (c *CrOSService) InstallZippedImage(ctx context.Context, remoteImagePath string, outputFile string) error
InstallZippedImage installs a remote zipped image to disk.
func (*CrOSService) IsDLCVerified ¶
IsDLCVerified checks if the desired DLC already exists within the system
func (*CrOSService) IsMiniOSPartitionSupported ¶
func (c *CrOSService) IsMiniOSPartitionSupported(ctx context.Context, rootDisk string, rootPart string) (bool, error)
IsMiniOSPartitionSupported determines whether the device has the partitions
func (*CrOSService) OverwiteInstall ¶
func (c *CrOSService) OverwiteInstall(ctx context.Context) error
OverwiteInstall will over write the existing install
func (*CrOSService) PostInstall ¶
func (c *CrOSService) PostInstall(ctx context.Context, inactiveRoot string) error
PostInstall mounts and runs post installation items.
func (*CrOSService) ProvisionStateful ¶
func (c *CrOSService) ProvisionStateful(ctx context.Context) error
ProvisionStateful runs a stateful install, reverting if it fails.
func (*CrOSService) RevertPostInstall ¶
func (c *CrOSService) RevertPostInstall(ctx context.Context, activeRoot string)
RevertPostInstall literally reverses a PostInstall
func (*CrOSService) RevertProvisionOS ¶
func (c *CrOSService) RevertProvisionOS(ctx context.Context, activeRoot string)
RevertProvisionOS literally reverts a full OS provisioning
func (*CrOSService) RevertStatefulInstall ¶
func (c *CrOSService) RevertStatefulInstall(ctx context.Context)
RevertStatefulInstall literally reverses a stateful installation
func (*CrOSService) StartDLCService ¶
func (c *CrOSService) StartDLCService(ctx context.Context)
StartDLCService starts a DLC service
func (*CrOSService) StopDLCService ¶
func (c *CrOSService) StopDLCService(ctx context.Context)
StopDLCService stops a DLC service
func (*CrOSService) StopSystemDaemons ¶
func (c *CrOSService) StopSystemDaemons(ctx context.Context)
StopSystemDaemon stops system daemons than can interfere with provisioning.
func (*CrOSService) WipeStateful ¶
func (c *CrOSService) WipeStateful(ctx context.Context) error
WipeStateful removes all things relevant to a stateful install
type CrOSVerifyState ¶
type CrOSVerifyState struct {
// contains filtered or unexported fields
}
func (CrOSVerifyState) Name ¶
func (s CrOSVerifyState) Name() string
func (CrOSVerifyState) Next ¶
func (s CrOSVerifyState) Next() services.ServiceState