build

package
v0.0.0-...-7c0940c Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2016 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultImageSize is the size of the rootfs we try to create (4GB)
	DefaultImageSize = 4000
)

Variables

View Source
var (
	// ErrNotYetImplemented is just used until we actually implement some code....
	ErrNotYetImplemented = errors.New("Not yet implemented")
)

Functions

This section is empty.

Types

type Builder

type Builder interface {

	// Init will initialise the builder from the given configuration
	Init(img *libuspin.ImageSpec) error

	// PrepareWorkspace will attempt to do all prework for setting up the image
	// deployment areas and such.
	PrepareWorkspace() error

	// CreateStorage is used by implementations to create any initial backing storage
	// they will require, i.e. the place where we install packages to. No processes
	// should be spawned within it, nor should it be mounted, at this point.
	CreateStorage() error

	// MountStorage should be used by the implementation if it needs to do any mounting
	// to allow the package manager instance to start installing packages and such into
	// the rootfs.
	MountStorage() error

	// CollectAssets will be called after the package manager is finished, and prior to
	// UnmountStorage is invoked. This will give the implementation a chance to collect
	// and build any assets they need from the rootfs before it is sealed up.
	CollectAssets() error

	// UnmountStorage should be used by the implementation to tear down any mounts
	// previously erected in MountStorage() for package manager operations, prior
	// to image finalisation
	UnmountStorage() error

	// FinalizeImage will complete the stage2 part of the image construction, whereby
	// all manual input from package managers, etc, is no longer needed.
	FinalizeImage() error

	// GetRootDir is used by implementations to return the root directory for the
	// OS files
	GetRootDir() string

	// Cleanup should be used by implementations to do any required cleanup operations,
	// including killing processes, unmounting anything, etc.
	Cleanup()
}

A Builder is the contract definition for all image builders, and the implementations will worry about the exact particulars.

func NewBuilder

func NewBuilder(name config.ImageType) (Builder, error)

NewBuilder will try to return a builder for the given type

type LiveOSBuilder

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

A LiveOSBuilder is responsible for building ISO format images that are USB compatible. It is the "LiveCD" type of Builder

func NewLiveOSBuilder

func NewLiveOSBuilder() *LiveOSBuilder

NewLiveOSBuilder should only be used by builder.go

func (*LiveOSBuilder) Cleanup

func (l *LiveOSBuilder) Cleanup()

Cleanup currently does nothing within this builder

func (*LiveOSBuilder) CollectAssets

func (l *LiveOSBuilder) CollectAssets() error

CollectAssets will collect the kernel and create a new initramfs to be used during the boot process

func (*LiveOSBuilder) CreateStorage

func (l *LiveOSBuilder) CreateStorage() error

CreateStorage will create the rootfs.img in which we will contain the Live OS

func (*LiveOSBuilder) FinalizeImage

func (l *LiveOSBuilder) FinalizeImage() error

FinalizeImage will go ahead and finish up the ISO construction

func (*LiveOSBuilder) GetBootDevice

func (l *LiveOSBuilder) GetBootDevice() string

GetBootDevice always returns nil for LiveOS

func (*LiveOSBuilder) GetKernel

func (l *LiveOSBuilder) GetKernel() *boot.Kernel

GetKernel returns our stored kernel object

func (*LiveOSBuilder) GetRootDevice

func (l *LiveOSBuilder) GetRootDevice() string

GetRootDevice will actually return the cdlabel for ISO mode bootloaders

func (*LiveOSBuilder) GetRootDir

func (l *LiveOSBuilder) GetRootDir() string

GetRootDir returns the path to the mounted rootfs.img

func (*LiveOSBuilder) Init

func (l *LiveOSBuilder) Init(img *libuspin.ImageSpec) error

Init will initialise a LiveOSBuilder from the given spec

func (*LiveOSBuilder) JoinDeployPath

func (l *LiveOSBuilder) JoinDeployPath(paths ...string) string

JoinDeployPath will return a path within the LiveOS workspace

func (*LiveOSBuilder) JoinPath

func (l *LiveOSBuilder) JoinPath(paths ...string) string

JoinPath is a helper to join paths onto our root workspace directory

func (*LiveOSBuilder) JoinRootPath

func (l *LiveOSBuilder) JoinRootPath(paths ...string) string

JoinRootPath will return a path within the LiveOS rootfs image

func (*LiveOSBuilder) MountStorage

func (l *LiveOSBuilder) MountStorage() error

MountStorage will mount the rootfs.img so that the package manager can take over

func (*LiveOSBuilder) PrepareWorkspace

func (l *LiveOSBuilder) PrepareWorkspace() error

PrepareWorkspace sets up the required directories for the LiveOSBuilder

func (*LiveOSBuilder) UnmountStorage

func (l *LiveOSBuilder) UnmountStorage() error

UnmountStorage will unmount the rootfs.img from earlier This is the last point in which the storage is used, so we check the filesystem is OK here.

Jump to

Keyboard shortcuts

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