boot

package
v7.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Package boot is the high-level interface for booting another operating system from Linux using kexec.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CatInitrds

func CatInitrds(initrds ...io.ReaderAt) io.ReaderAt

CatInitrds concatenates initrds on first ReadAt call from a list of io.ReaderAts, pads them to a 512 byte boundary.

func Execute

func Execute() error

Execute executes a previously loaded OSImage.

This will only work if OSImage.Load was called on some OSImage.

Types

type LinuxImage

type LinuxImage struct {
	Name string

	Kernel  io.ReaderAt
	Initrd  io.ReaderAt
	Cmdline string
}

LinuxImage implements OSImage for a Linux kernel + initramfs.

func (*LinuxImage) Label

func (li *LinuxImage) Label() string

Label returns either the Name or a short description.

func (*LinuxImage) Load

func (li *LinuxImage) Load(verbose bool) error

Load implements OSImage.Load and kexec_load's the kernel with its initramfs.

func (*LinuxImage) String

func (li *LinuxImage) String() string

String prints a human-readable version of this linux image.

type MultibootImage

type MultibootImage struct {
	Name string

	Kernel  io.ReaderAt
	Cmdline string
	Modules []multiboot.Module
	IBFT    *ibft.IBFT
}

MultibootImage is a multiboot-formated OSImage, such as ESXi, Xen, Akaros, tboot.

func (*MultibootImage) Label

func (mi *MultibootImage) Label() string

Label returns either Name or a short description.

func (*MultibootImage) Load

func (mi *MultibootImage) Load(verbose bool) error

Load implements OSImage.Load.

func (*MultibootImage) String

func (mi *MultibootImage) String() string

String implements fmt.Stringer.

type OSImage

type OSImage interface {
	fmt.Stringer

	// Label is a name or short description for this OSImage.
	//
	// Label is intended for boot menus.
	Label() string

	// Load loads the OS image into kernel memory, ready for execution.
	//
	// After Load is called, call boot.Execute() to stop Linux and boot the
	// loaded OSImage.
	Load(verbose bool) error
}

OSImage represents a bootable OS package.

Directories

Path Synopsis
Package acpi can find and parse the RSDP pointer and struct.
Package acpi can find and parse the RSDP pointer and struct.
Package bls parses systemd Boot Loader Spec config files.
Package bls parses systemd Boot Loader Spec config files.
Package bootcmd handles common cleanup functions and flags that all boot commands should support.
Package bootcmd handles common cleanup functions and flags that all boot commands should support.
Package boottest contains methods for comparing boot.OSImages to each other and to JSON representations of themselves for use in tests.
Package boottest contains methods for comparing boot.OSImages to each other and to JSON representations of themselves for use in tests.
Package bzImage implements decoding for bzImage files.
Package bzImage implements decoding for bzImage files.
Package ebda looks for the Extended Bios Data Area (EBDA) pointer in /dev/mem, and provides access to the EBDA.
Package ebda looks for the Extended Bios Data Area (EBDA) pointer in /dev/mem, and provides access to the EBDA.
Package esxi contains an ESXi boot config parser for disks and CDROMs.
Package esxi contains an ESXi boot config parser for disks and CDROMs.
Package grub implements a grub config file parser.
Package grub implements a grub config file parser.
Package ibft defines the iSCSI Boot Firmware Table.
Package ibft defines the iSCSI Boot Firmware Table.
Package localboot contains helper functions for booting off local disks.
Package localboot contains helper functions for booting off local disks.
Package menu displays a Terminal UI based text menu to choose boot options from.
Package menu displays a Terminal UI based text menu to choose boot options from.
Package multiboot implements bootloading multiboot kernels as defined by https://www.gnu.org/software/grub/manual/multiboot/multiboot.html.
Package multiboot implements bootloading multiboot kernels as defined by https://www.gnu.org/software/grub/manual/multiboot/multiboot.html.
internal/trampoline
Package trampoline sets machine to a specific state defined by multiboot v1 spec and jumps to the intended kernel.
Package trampoline sets machine to a specific state defined by multiboot v1 spec and jumps to the intended kernel.
Package netboot provides a one-stop shop for netboot parsing needs.
Package netboot provides a one-stop shop for netboot parsing needs.
ipxe
Package ipxe implements a trivial IPXE config file parser.
Package ipxe implements a trivial IPXE config file parser.
pxe
Package pxe implements the PXE config file parsing.
Package pxe implements the PXE config file parsing.
Package syslinux implements a syslinux config file parser.
Package syslinux implements a syslinux config file parser.
Package zimage contains a Parser for the arm zImage Linux format.
Package zimage contains a Parser for the arm zImage Linux format.

Jump to

Keyboard shortcuts

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