syslinux

package
v0.6.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2020 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AdvSize is the total size.
	AdvSize = 512
	// AdvLen is the usable data size.
	AdvLen = AdvSize - 3*4
	// AdvMagic1 is the head signature.
	AdvMagic1 = uint32(0x5a2d2fa5)
	// AdvMagic2 is the total checksum.
	AdvMagic2 = uint32(0xa3041767)
	// AdvMagic3 is the tail signature.
	AdvMagic3 = uint32(0xdd28bf64)
)
View Source
const (
	// AdvEnd is the noop tag.
	AdvEnd = iota
	// AdvBootonce is the bootonce tag.
	AdvBootonce
	// AdvMenusave is the menusave tag.
	AdvMenusave
	// AdvReserved1 is a reserved tag.
	AdvReserved1
	// AdvReserved2 is a reserved tag.
	AdvReserved2
	// AdvReserved3 is a reserved tag.
	AdvReserved3
	// AdvUpgrade is the upgrade tag.
	AdvUpgrade
)
View Source
const (
	// BootA is a syslinux label.
	BootA = "boot-a"

	// BootB is a syslinux label.
	BootB = "boot-b"

	// SyslinuxLdlinux is the path to ldlinux.sys.
	SyslinuxLdlinux = constants.BootMountPoint + "/syslinux/ldlinux.sys"

	// SyslinuxConfig is the path to the Syslinux config.
	SyslinuxConfig = constants.BootMountPoint + "/syslinux/syslinux.cfg"
)

Variables

This section is empty.

Functions

func Install

func Install(fallback string, config interface{}, sequence runtime.Sequence, bootPartitionFound bool) (err error)

Install implements the Bootloader interface. It sets up syslinux with the specified kernel parameters.

nolint: gocyclo

func Labels

func Labels() (current string, next string, err error)

Labels parses the syslinux config and returns the current active label, and what should be the next label.

func Prepare

func Prepare(dev string) (err error)

Prepare implements the Bootloader interface. It works by writing gptmbr.bin to a block device.

func Revert

func Revert() (err error)

Revert reverts the default syslinx label to the previous installation.

nolint: gocyclo

func RevertTo added in v0.6.0

func RevertTo(label string) (err error)

RevertTo reverts the default syslinx label to the previous installation.

nolint: gocyclo

Types

type ADV

type ADV []byte

ADV represents the Syslinux Auxiliary Data Vector.

func NewADV

func NewADV(r io.ReadSeeker) (adv ADV, err error)

NewADV returns the Auxiliary Data Vector.

func (ADV) DeleteTag

func (a ADV) DeleteTag(t uint8) (ok bool)

DeleteTag deletes a tag in the ADV.

func (ADV) ReadTag

func (a ADV) ReadTag(t uint8) (val string, ok bool)

ReadTag reads a tag in the ADV.

func (ADV) SetTag

func (a ADV) SetTag(t uint8, val string) (ok bool)

SetTag sets a tag in the ADV.

type Cfg

type Cfg struct {
	Default string
	Labels  []*Label
}

Cfg reprsents the cfg file.

type Label

type Label struct {
	Root   string
	Kernel string
	Initrd string
	Append string
}

Label reprsents a label in the cfg file.

type Syslinux

type Syslinux struct{}

Syslinux represents the syslinux bootloader.

Jump to

Keyboard shortcuts

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