Documentation
¶
Index ¶
- func Boot(ctx context.Context, t tftp.Client, imgs []Image, cmdlineArgs []string, ...) error
- func DownloadWithRetries(ctx context.Context, dest string, download func() error) error
- func ValidateBoard(ctx context.Context, t tftp.Client, boardName string) error
- type Image
- func ConvertFromBuildImages(buildImages []build.Image, bootMode Mode, imageDir string) ([]Image, func() error, error)
- func GetImages(ctx context.Context, imageManifest string, bootMode Mode) ([]Image, func() error, error)
- func ImagesFromGCS(ctx context.Context, manifest *url.URL, bootMode Mode) ([]Image, func() error, error)
- func ImagesFromLocalFS(manifest string, bootMode Mode) ([]Image, func() error, error)
- type Mode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Boot ¶
func Boot(ctx context.Context, t tftp.Client, imgs []Image, cmdlineArgs []string, authorizedKeys []byte) error
Boot prepares and boots a device at the given IP address.
func DownloadWithRetries ¶
DownloadWithRetries runs a function that downloads a blob from GCS, and retries if the function returns an error that corresponds to a failure mode that's known to be transient.
Types ¶
type Image ¶
type Image struct { // Name is an identifier for this image that usually derives from its target partition. // TODO(fxbug.dev/38517): Remove when BootZedbootShim is deprecated. Name string // Path is the relative location of the image with respect to the image manifest // or the absolute location of the image on disk. Path string // Reader is a reader to the image. Reader io.ReaderAt // Size is the size of the reader in bytes. Size int64 // Args correspond to the bootserver args that map to this image type. Args []string // IsExecutable is true if the image is actually a script or executable. IsExecutable bool }
Image is a fuchsia image as viewed by bootserver; a simplified version of build.Image.
func ConvertFromBuildImages ¶
func ConvertFromBuildImages(buildImages []build.Image, bootMode Mode, imageDir string) ([]Image, func() error, error)
ConvertFromBuildImages filters and returns Images corresponding to build Images of a given bootMode.
func GetImages ¶
func GetImages(ctx context.Context, imageManifest string, bootMode Mode) ([]Image, func() error, error)
GetImages parses the imageManifest and gets a list of images with readers to each image. It returns the images as well as a func to close the image readers.
func ImagesFromGCS ¶
func ImagesFromGCS(ctx context.Context, manifest *url.URL, bootMode Mode) ([]Image, func() error, error)
ImagesFromGCS returns Images of a given bootMode that exist in GCS. The image paths provided in the manifest at the given url are expected to be relative paths to the same directory of the manifest.
type Mode ¶
type Mode int
Mode determines the arguments to use when booting/paving images.
const ( // ModeNull is a null default that can be error checked against. ModeNull Mode = iota // ModePave is a directive to pave when booting. ModePave // ModeNetboot is a directive to netboot when booting. ModeNetboot // ModePaveZedboot is a directive to pave zedboot to partition A (the initial boot partition) when booting. ModePaveZedboot )