Documentation ¶
Index ¶
- Constants
- func ShellCommand(command string) *exec.Cmd
- type Args
- type Artifact
- type Builder
- type CommandWrapper
- type Communicator
- func (c *Communicator) Download(src string, w io.Writer) error
- func (c *Communicator) DownloadDir(src string, dst string, exclude []string) error
- func (c *Communicator) Start(cmd *packer.RemoteCmd) error
- func (c *Communicator) Upload(dst string, r io.Reader, fi *os.FileInfo) error
- func (c *Communicator) UploadDir(dst string, src string, exclude []string) error
- type Config
- type StepChrootProvision
- type StepMountExtra
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 ¶
ShellCommand takes a command string and returns an *exec.Cmd to execute it within the context of a shell (/bin/sh).
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶
func NewBuilder() *Builder
type CommandWrapper ¶
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) DownloadDir ¶
func (c *Communicator) DownloadDir(src string, dst 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 ¶
func (s *StepChrootProvision) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
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 ¶
func (s *StepMountExtra) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
Click to show internal directories.
Click to hide internal directories.