builder

package
v0.1.1-alpha.0...-ca1f1e3 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2019 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const BuilderId = "yuval-k.arm-image"
View Source
const SectorShift = 9

sector size is 512 bytes

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 Args

type Args struct {
	Args               []string
	PathToQemuInChroot string
}

type Artifact

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

func (*Artifact) BuilderId

func (a *Artifact) BuilderId() string

func (*Artifact) Destroy

func (a *Artifact) Destroy() error

func (*Artifact) Files

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

func (*Artifact) Id

func (a *Artifact) Id() string

func (*Artifact) State

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

func (*Artifact) String

func (a *Artifact) String() string

type Builder

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

func NewBuilder

func NewBuilder() *Builder

func (*Builder) Cancel

func (b *Builder) Cancel()

func (*Builder) Prepare

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

func (*Builder) Run

func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packer.Artifact, error)

type CommandWrapper

type CommandWrapper func(string) (string, error)

CommandWrapper is a type that given a command, will possibly modify that command in-flight. This might return an error.

type Communicator

type Communicator struct {
	Chroot     string
	CmdWrapper CommandWrapper
}

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

func (*Communicator) DownloadDir

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

func (*Communicator) Start

func (c *Communicator) Start(cmd *packer.RemoteCmd) error

func (*Communicator) Upload

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

func (*Communicator) UploadDir

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

type Config

type Config struct {
	packer_common.PackerConfig `mapstructure:",squash"`
	// While arm image are not ISOs, we resuse the ISO logic as it basically has no ISO specific code.
	// Provide the arm image in the iso_url fields.
	packer_common.ISOConfig `mapstructure:",squash"`

	// Lets you prefix all builder commands, such as with ssh for a remote build host. Defaults to "".
	// Copied from other builders :)
	CommandWrapper string `mapstructure:"command_wrapper"`

	// Output directory, where the final image will be stored.
	OutputDir string `mapstructure:"output_directory"`

	// Image type. this is used to deduce other settings like image mounts and qemu args.
	// If not provided, we will try to deduce it from the image url. (see autoDetectType())
	ImageType utils.KnownImageType `mapstructure:"image_type"`

	// Where to mounts the image partitions in the chroot.
	// first entry is the mount point of the first partition. etc..
	ImageMounts []string `mapstructure:"image_mounts"`

	// The path where the volume will be mounted. This is where the chroot environment will be.
	// Will be a temporary directory if left unspecified.
	MountPath string `mapstructure:"mount_path"`

	// What directories mount from the host to the chroot.
	// leave it empty for reasonable deafults.
	// array of triplets: [type, device, mntpoint].
	ChrootMounts [][]string `mapstructure:"chroot_mounts"`
	// Should the last partition be extended? this only works for the last partition in the
	// dos partition table, and ext filesystem
	LastPartitionExtraSize uint64 `mapstructure:"last_partition_extra_size"`
	// The target size of the final image. The last partiation will be extended to
	// fill up this much room. I.e. if the generated image is 256MB and TargetImageSize
	// is set to 384MB the last partition will be extended with an additional 128MB.
	TargetImageSize uint64 `mapstructure:"target_image_size"`

	// Qemu binary to use. default is qemu-arm-static
	QemuBinary string `mapstructure:"qemu_binary"`
	// Arguments to qemu binary. default depends on the image type. see init() function above.
	QemuArgs []string `mapstructure:"qemu_args"`
	// contains filtered or unexported fields
}

type StepChrootProvision

type StepChrootProvision struct {
	ChrootKey string
}

StepChrootProvision provisions the instance within a chroot.

func (*StepChrootProvision) Cleanup

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

func (*StepChrootProvision) Run

type StepMountExtra

type StepMountExtra struct {
	ChrootKey string
	// contains filtered or unexported fields
}

StepMountExtra mounts the attached device.

Produces:

mount_extra_cleanup CleanupFunc - To perform early cleanup

func (*StepMountExtra) Cleanup

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

func (*StepMountExtra) CleanupFunc

func (s *StepMountExtra) CleanupFunc(state multistep.StateBag) error

func (*StepMountExtra) Run

Jump to

Keyboard shortcuts

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