chroot

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2019 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunLocalCommands

func RunLocalCommands(commands []string, wrappedCommand common.CommandWrapper, ictx interpolate.Context, ui packer.Ui) error

Types

type Cleanup

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

Cleanup is an interface that some steps implement for early cleanup.

type Communicator

type Communicator struct {
	Chroot     string
	CmdWrapper common.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(ctx context.Context, 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 StepChrootProvision

type StepChrootProvision struct {
}

StepChrootProvision provisions the instance within a chroot.

func (*StepChrootProvision) Cleanup

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

func (*StepChrootProvision) Run

type StepCopyFiles

type StepCopyFiles struct {
	Files []string
	// contains filtered or unexported fields
}

StepCopyFiles copies some files from the host into the chroot environment.

Produces:

copy_files_cleanup CleanupFunc - A function to clean up the copied files
early.

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{}

StepEarlyCleanup performs some of the cleanup steps early in order to prepare for snapshotting and creating an AMI.

func (*StepEarlyCleanup) Cleanup

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

func (*StepEarlyCleanup) Run

type StepMountExtra

type StepMountExtra struct {
	ChrootMounts [][]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

type StepPostMountCommands

type StepPostMountCommands struct {
	Commands []string
}

StepPostMountCommands allows running arbitrary commands after mounting the device, but prior to the bind mount and copy steps.

func (*StepPostMountCommands) Cleanup

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

func (*StepPostMountCommands) Run

type StepPreMountCommands

type StepPreMountCommands struct {
	Commands []string
}

StepPreMountCommands sets up the a new block device when building from scratch

func (*StepPreMountCommands) Cleanup

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

func (*StepPreMountCommands) Run

Jump to

Keyboard shortcuts

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