Documentation ¶
Index ¶
- type Artifact
- type Builder
- func (b *Builder) ConfigSpec() hcldec.ObjectSpec
- func (b *Builder) InitConfig(ctx *interpolate.Context) (warnings []string, errors []error)
- func (b *Builder) Prepare(args ...interface{}) ([]string, []string, error)
- func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (packer.Artifact, error)
- type Config
- type FlatConfig
- type StepChrootProvision
- type StepCompressArtifact
- type StepCreateBaseImage
- type StepExpandPartition
- type StepExtractAndCopyImage
- type StepMapImage
- type StepMkfsImage
- type StepMountImage
- type StepPartitionImage
- type StepPopulateFilesystem
- type StepResizePartitionFs
- type StepResizeQemuImage
- type StepSetupChroot
- type StepSetupExtra
- type StepSetupQemu
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Artifact ¶
type Artifact struct {
// contains filtered or unexported fields
}
Artifact represents the image produced by packer-builder-arm
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder builds (or modifies) arm system images
func (*Builder) ConfigSpec ¶
func (b *Builder) ConfigSpec() hcldec.ObjectSpec
ConfigSpec returns the config spec
func (*Builder) InitConfig ¶
func (b *Builder) InitConfig(ctx *interpolate.Context) (warnings []string, errors []error)
InitConfig prepares relevant config structures
type Config ¶
type Config struct { cfg.RemoteFileConfig `mapstructure:",squash"` cfg.ImageConfig `mapstructure:",squash"` cfg.QemuConfig `mapstructure:",squash"` // contains filtered or unexported fields }
Config top-level holder for more specific configurations used while building packer-builder-arm
type FlatConfig ¶
type FlatConfig struct { FileChecksum *string `mapstructure:"file_checksum" required:"true" cty:"file_checksum" hcl:"file_checksum"` FileChecksumURL *string `mapstructure:"file_checksum_url" cty:"file_checksum_url" hcl:"file_checksum_url"` FileChecksumType *string `mapstructure:"file_checksum_type" cty:"file_checksum_type" hcl:"file_checksum_type"` FileUrls []string `mapstructure:"file_urls" cty:"file_urls" hcl:"file_urls"` FileUnarchiveCmd []string `mapstructure:"file_unarchive_cmd" cty:"file_unarchive_cmd" hcl:"file_unarchive_cmd"` TargetPath *string `mapstructure:"file_target_path" cty:"file_target_path" hcl:"file_target_path"` TargetExtension *string `mapstructure:"file_target_extension" cty:"file_target_extension" hcl:"file_target_extension"` TmpDirLocation *string `mapstructure:"file_tmp_dir_location" cty:"file_tmp_dir_location" hcl:"file_tmp_dir_location"` ImagePath *string `mapstructure:"image_path" required:"true" cty:"image_path" hcl:"image_path"` ImageSize *string `mapstructure:"image_size" cty:"image_size" hcl:"image_size"` ImageType *string `mapstructure:"image_type" cty:"image_type" hcl:"image_type"` ImageMountPath *string `mapstructure:"image_mount_path" cty:"image_mount_path" hcl:"image_mount_path"` ImageBuildMethod *string `mapstructure:"image_build_method" cty:"image_build_method" hcl:"image_build_method"` ImageSizeBytes *uint64 `mapstructure:"image_size_bytes" cty:"image_size_bytes" hcl:"image_size_bytes"` ImagePartitions []config.FlatPartition `mapstructure:"image_partitions" cty:"image_partitions" hcl:"image_partitions"` ImageChrootMounts []config.FlatChrootMount `mapstructure:"image_chroot_mounts" cty:"image_chroot_mounts" hcl:"image_chroot_mounts"` AdditionalChrootMounts []config.FlatChrootMount `mapstructure:"additional_chroot_mounts" cty:"additional_chroot_mounts" hcl:"additional_chroot_mounts"` ImageSetupExtra [][]string `mapstructure:"image_setup_extra" cty:"image_setup_extra" hcl:"image_setup_extra"` ImageChrootEnv []string `mapstructure:"image_chroot_env" cty:"image_chroot_env" hcl:"image_chroot_env"` QemuBinarySourcePath *string `mapstructure:"qemu_binary_source_path" required:"true" cty:"qemu_binary_source_path" hcl:"qemu_binary_source_path"` QemuBinaryDestinationPath *string `mapstructure:"qemu_binary_destination_path" cty:"qemu_binary_destination_path" hcl:"qemu_binary_destination_path"` }
FlatConfig is an auto-generated flat version of Config. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type StepChrootProvision ¶
StepChrootProvision provisions the instance within a chroot
func (*StepChrootProvision) Cleanup ¶
func (s *StepChrootProvision) Cleanup(_ multistep.StateBag)
Cleanup after step execution
func (*StepChrootProvision) Run ¶
func (s *StepChrootProvision) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
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(_ multistep.StateBag)
Cleanup after step execution
func (*StepCompressArtifact) Run ¶
func (s *StepCompressArtifact) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
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(_ multistep.StateBag)
Cleanup after step execution
func (*StepCreateBaseImage) Run ¶
func (s *StepCreateBaseImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
Run the step
type StepExpandPartition ¶
type StepExpandPartition struct {
ResultKey string
}
StepExpandPartition expand already partitioned image
func (*StepExpandPartition) Cleanup ¶
func (s *StepExpandPartition) Cleanup(_ multistep.StateBag)
Cleanup after step execution
func (*StepExpandPartition) Run ¶
func (s *StepExpandPartition) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
Run the step
type StepExtractAndCopyImage ¶
type StepExtractAndCopyImage struct {
FromKey string
}
StepExtractAndCopyImage creates filesystem on already partitioned image
func (*StepExtractAndCopyImage) Cleanup ¶
func (s *StepExtractAndCopyImage) Cleanup(_ multistep.StateBag)
Cleanup after step execution
func (*StepExtractAndCopyImage) Run ¶
func (s *StepExtractAndCopyImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
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 ¶
func (s *StepMapImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
Run the step
type StepMkfsImage ¶
type StepMkfsImage struct {
FromKey string
}
StepMkfsImage creates filesystem on already partitioned image
func (*StepMkfsImage) Cleanup ¶
func (s *StepMkfsImage) Cleanup(_ multistep.StateBag)
Cleanup after step execution
func (*StepMkfsImage) Run ¶
func (s *StepMkfsImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
Run the step
type StepMountImage ¶
type StepMountImage struct { FromKey string ResultKey string MountPath 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 ¶
func (s *StepMountImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
Run the step
type StepPartitionImage ¶
type StepPartitionImage struct{}
StepPartitionImage creates partitions on raw image
func (*StepPartitionImage) Cleanup ¶
func (s *StepPartitionImage) Cleanup(_ multistep.StateBag)
Cleanup after step execution
func (*StepPartitionImage) Run ¶
func (s *StepPartitionImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
Run the step
type StepPopulateFilesystem ¶
StepPopulateFilesystem unpacks system files from previously downloaded archive onto mounted partitions
func (*StepPopulateFilesystem) Cleanup ¶
func (s *StepPopulateFilesystem) Cleanup(_ multistep.StateBag)
Cleanup after step execution
func (*StepPopulateFilesystem) Run ¶
func (s *StepPopulateFilesystem) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
Run the step
type StepResizePartitionFs ¶
StepResizePartitionFs expand already partitioned image
func (*StepResizePartitionFs) Cleanup ¶
func (s *StepResizePartitionFs) Cleanup(_ multistep.StateBag)
Cleanup after step execution
func (*StepResizePartitionFs) Run ¶
func (s *StepResizePartitionFs) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
Run the step
type StepResizeQemuImage ¶
type StepResizeQemuImage struct { }
StepResizeQemuImage expand already partitioned image
func (*StepResizeQemuImage) Cleanup ¶
func (s *StepResizeQemuImage) Cleanup(_ multistep.StateBag)
Cleanup after step execution
func (*StepResizeQemuImage) Run ¶
func (s *StepResizeQemuImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
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 ¶
func (s *StepSetupChroot) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
Run the step
type StepSetupExtra ¶
type StepSetupExtra struct {
FromKey string
}
StepSetupExtra creates filesystem on already partitioned image
func (*StepSetupExtra) Cleanup ¶
func (s *StepSetupExtra) Cleanup(_ multistep.StateBag)
Cleanup after step execution
func (*StepSetupExtra) Run ¶
func (s *StepSetupExtra) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
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 ¶
func (s *StepSetupQemu) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
Run the step
Source Files ¶
- artifact.go
- builder.go
- builder.hcl2spec.go
- step_chroot_provision.go
- step_compress_artifact.go
- step_create_base_image.go
- step_expand_partition.go
- step_extract_and_copy_image.go
- step_map_image.go
- step_mkfs_image.go
- step_mount_image.go
- step_partition_image.go
- step_populate_filesystem.go
- step_resize_partition_fs.go
- step_resize_qemu_img.go
- step_setup_chroot.go
- step_setup_extra.go
- step_setup_qemu.go