builder

package
v0.0.0-...-91e0a3c Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShellCommand

func ShellCommand(command string) *exec.Cmd

ShellCommand takes a command string and returns an *exec.Cmd to execute it within the context of a shell (/bin/sh)

Types

type Artifact

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

Artifact represents the image produced by packer-builder-arm

func (*Artifact) BuilderId

func (a *Artifact) BuilderId() string

BuilderId returns builder ID

func (*Artifact) Destroy

func (a *Artifact) Destroy() error

Destroy removes the image from disk

func (*Artifact) Files

func (a *Artifact) Files() []string

Files returns list of images (in that case just one) built

func (*Artifact) Id

func (a *Artifact) Id() string

Id returns empty string

func (*Artifact) State

func (a *Artifact) State(name string) interface{}

State N/A

func (*Artifact) String

func (a *Artifact) String() string

String returns the image path

type Builder

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

Builder builds (or modifies) arm system images

func NewBuilder

func NewBuilder() *Builder

NewBuilder default Builder constructor

func (*Builder) Prepare

func (b *Builder) Prepare(args ...interface{}) ([]string, error)

Prepare setup configuration (ex. ImageConfig)

func (*Builder) Run

func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (packer.Artifact, error)

Run executes steps in order to produce the system image

type Communicator

type Communicator struct {
	Chroot string
	Env    []string
}

Communicator is a special communicator that works by executing commands locally but within a chroot.

func (*Communicator) Download

func (c *Communicator) Download(src string, w io.Writer) error

Download copies file from chroot

func (*Communicator) DownloadDir

func (c *Communicator) DownloadDir(src string, dst string, exclude []string) error

DownloadDir N/A

func (*Communicator) Start

func (c *Communicator) Start(ctx context.Context, cmd *packer.RemoteCmd) error

Start spawns and instance of exec.Command

func (*Communicator) Upload

func (c *Communicator) Upload(dst string, r io.Reader, fi *os.FileInfo) error

Upload copies files into chroot

func (*Communicator) UploadDir

func (c *Communicator) UploadDir(dst string, src string, exclude []string) error

UploadDir copies directory into chroot

type StepChrootProvision

type StepChrootProvision struct {
	ImageMountPointKey string
	Hook               packer.Hook
}

StepChrootProvision provisions the instance within a chroot

func (*StepChrootProvision) Cleanup

func (s *StepChrootProvision) Cleanup(state multistep.StateBag)

Cleanup after step execution

func (*StepChrootProvision) Run

Run the step

type StepCompressArtifact

type StepCompressArtifact struct {
	ImageMountPointKey string
	// contains filtered or unexported fields
}

StepCompressArtifact generates rootfs archive if required

func (*StepCompressArtifact) Cleanup

func (s *StepCompressArtifact) Cleanup(state multistep.StateBag)

Cleanup after step execution

func (*StepCompressArtifact) Run

Run the step

type StepCreateBaseImage

type StepCreateBaseImage struct{}

StepCreateBaseImage creates the base image (empty file of given size via dd)

func (*StepCreateBaseImage) Cleanup

func (s *StepCreateBaseImage) Cleanup(state multistep.StateBag)

Cleanup after step execution

func (*StepCreateBaseImage) Run

Run the step

type StepExtractAndCopyImage

type StepExtractAndCopyImage struct {
	FromKey string
}

StepExtractAndCopyImage creates filesystem on already partitioned image

func (*StepExtractAndCopyImage) Cleanup

func (s *StepExtractAndCopyImage) Cleanup(state multistep.StateBag)

Cleanup after step execution

func (*StepExtractAndCopyImage) Run

Run the step

type StepMapImage

type StepMapImage struct {
	ResultKey string
	// contains filtered or unexported fields
}

StepMapImage maps system image to /dev/loopX

func (*StepMapImage) Cleanup

func (s *StepMapImage) Cleanup(state multistep.StateBag)

Cleanup after step execution

func (*StepMapImage) Run

Run the step

type StepMkfsImage

type StepMkfsImage struct {
	FromKey string
}

StepMkfsImage creates filesystem on already partitioned image

func (*StepMkfsImage) Cleanup

func (s *StepMkfsImage) Cleanup(state multistep.StateBag)

Cleanup after step execution

func (*StepMkfsImage) Run

Run the step

type StepMountImage

type StepMountImage struct {
	FromKey   string
	ResultKey string
	MouthPath string
	// contains filtered or unexported fields
}

StepMountImage mounts partition to selected mountpoints

func (*StepMountImage) Cleanup

func (s *StepMountImage) Cleanup(state multistep.StateBag)

Cleanup after step execution

func (*StepMountImage) Run

Run the step

type StepPartitionImage

type StepPartitionImage struct{}

StepPartitionImage creates partitions on raw image

func (*StepPartitionImage) Cleanup

func (s *StepPartitionImage) Cleanup(state multistep.StateBag)

Cleanup after step execution

func (*StepPartitionImage) Run

Run the step

type StepPopulateFilesystem

type StepPopulateFilesystem struct {
	RootfsArchiveKey   string
	ImageMountPointKey string
}

StepPopulateFilesystem unpacks system files from previously downloaded archive onto mounted partitions

func (*StepPopulateFilesystem) Cleanup

func (s *StepPopulateFilesystem) Cleanup(state multistep.StateBag)

Cleanup after step execution

func (*StepPopulateFilesystem) Run

Run the step

type StepSetupChroot

type StepSetupChroot struct {
	ImageMountPointKey string
}

StepSetupChroot prepares chroot environment by mounting specific locations (/dev /proc etc.)

func (*StepSetupChroot) Cleanup

func (s *StepSetupChroot) Cleanup(state multistep.StateBag)

Cleanup after step execution

func (*StepSetupChroot) Run

Run the step

type StepSetupExtra

type StepSetupExtra struct {
	FromKey string
}

StepSetupExtra creates filesystem on already partitioned image

func (*StepSetupExtra) Cleanup

func (s *StepSetupExtra) Cleanup(state multistep.StateBag)

Cleanup after step execution

func (*StepSetupExtra) Run

Run the step

type StepSetupQemu

type StepSetupQemu struct {
	ImageMountPointKey string
}

StepSetupQemu configures chroot environment to run binaries via qemu

func (*StepSetupQemu) Cleanup

func (s *StepSetupQemu) Cleanup(state multistep.StateBag)

Cleanup after step execution

func (*StepSetupQemu) Run

Run the step

Jump to

Keyboard shortcuts

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