chroot

package
v0.0.0-...-368c43c Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const BuilderId = "insanemal.rhel-chroot"

Variables

This section is empty.

Functions

func NewShellCommand

func NewShellCommand(command string) *exec.Cmd

Types

type Artifact

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

func (*Artifact) BuilderId

func (*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
}

Builder represents a builder plugin for Packer.

func NewBuilder

func NewBuilder() *Builder

NewBuilder returns a Builder.

func (*Builder) Cancel

func (b *Builder) Cancel()

Cancel executes processing at cancel.

func (*Builder) Prepare

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

Prepare validates given configuration.

func (*Builder) Run

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

Run runs each step of the plugin in order.

type Cleaner

type Cleaner interface {
	CleanupFunc(multistep.StateBag) error
}

Cleaner is an interface with a function for cleanup.

type CommandWrapper

type CommandWrapper func(string) (string, error)

func NewCommandWrapper

func NewCommandWrapper(config Config) CommandWrapper

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(rc *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 {
	common.PackerConfig `mapstructure:",squash"`

	OutputDir      string     `mapstructure:"output_directory"`
	WorkDir        string     `mapstructure:"tmp_directory"`
	ImageName      string     `mapstructure:"image_name"`
	MountPath      string     `mapstructure:"mount_path"`
	ExportFolder   string     `mapstructure:"export_folder"`
	MountOptions   []string   `mapstructure:"mount_options"`
	BaseRPMS       []string   `mapstructure:"base_rpms"`
	ChrootMounts   [][]string `mapstructure:"chroot_mounts"`
	CopyFiles      []string   `mapstructure:"copy_files"`
	ExportFiles    [][]string `mapstructure:"export_files"`
	CommandWrapper string     `mapstructure:"command_wrapper"`
	InitChroot     bool       `mapstructure:"init_chroot"`
	MakeSquash     bool       `mapstructure:"make_squash"`
	ExportBuild    bool       `mapstructure:"export_build"`
	NewImage       bool       `mapstructure:"new_image"`
	DontRsync      bool       `mapstructure:"dont_rsync"`
	BaseIamge      string     `mapstructure:"base_image"`
	// contains filtered or unexported fields
}

Config represents a configuration of builder.

type StepChrootProvision

type StepChrootProvision struct{}

func (*StepChrootProvision) Cleanup

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

func (*StepChrootProvision) Run

type StepCompressImage

type StepCompressImage struct{}

func (*StepCompressImage) Cleanup

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

func (*StepCompressImage) Run

type StepCopyFiles

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

func (*StepCopyFiles) Cleanup

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

func (*StepCopyFiles) CleanupFunc

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

func (*StepCopyFiles) Run

type StepEarlyCleanup

type StepEarlyCleanup struct{}

func (*StepEarlyCleanup) Cleanup

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

func (*StepEarlyCleanup) Run

type StepMountExtra

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

func (*StepMountExtra) Cleanup

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

func (*StepMountExtra) CleanupFunc

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

func (*StepMountExtra) Run

type StepPrepareImage

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

func (*StepPrepareImage) Cleanup

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

func (*StepPrepareImage) Run

type StepPrepareOutputDir

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

func (*StepPrepareOutputDir) Cleanup

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

func (*StepPrepareOutputDir) Run

Jump to

Keyboard shortcuts

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