diskboot

package
v3.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2018 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MountPath    string
	ConfigPath   string
	Entries      []Entry
	DefaultEntry int
}

Config contains boot entries for a single configuration file (grub, syslinux, etc.)

func FindConfigs

func FindConfigs(mountPath string) []*Config

FindConfigs searching the path for valid boot configuration files and returns a Config for each valid instance found.

func ParseConfig

func ParseConfig(mountPath, configPath string, lines []string) *Config

ParseConfig attempts to construct a valid boot Config from the location and lines contents passed in.

type Device

type Device struct {
	DevPath   string
	MountPath string
	Fstype    string
	Configs   []*Config
}

Device contains the path to a block filesystem along with its type

func FindDevice

func FindDevice(devPath string) (*Device, error)

FindDevice attempts to construct a boot device at the given path

func FindDevices

func FindDevices(devicesGlob string) (devices []*Device)

FindDevices searches for devices with bootable configs

type Entry

type Entry struct {
	Name    string
	Type    EntryType
	Modules []Module
}

Entry contains the necessary info to kexec into a new kernel

func (*Entry) KexecLoad

func (e *Entry) KexecLoad(mountPath, appendCmdline string, dryrun bool) error

KexecLoad calls the appropriate kexec load routines based on the type of Entry

type EntryType

type EntryType int

EntryType dictates the method by which kexec should use to load the new kernel

const (
	Elf EntryType = iota
	Multiboot
)

EntryType can be either Elf or Multiboot

func (EntryType) String

func (i EntryType) String() string

type Module

type Module struct {
	Path   string
	Params string
}

Module represents a path to a binary along with arguments for its xecution. The path in the module is relative to the mount path

func NewModule

func NewModule(path string, args []string) Module

NewModule constructs a module for a boot entry

func (Module) String

func (m Module) String() string

Jump to

Keyboard shortcuts

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