jsonboot

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: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BootConfig

type BootConfig struct {
	Name          string   `json:"name,omitempty"`
	Kernel        string   `json:"kernel"`
	Initramfs     string   `json:"initramfs,omitempty"`
	KernelArgs    string   `json:"kernel_args,omitempty"`
	DeviceTree    string   `json:"devicetree,omitempty"`
	Multiboot     string   `json:"multiboot_kernel,omitempty"`
	MultibootArgs string   `json:"multiboot_args,omitempty"`
	Modules       []string `json:"multiboot_modules,omitempty"`
}

BootConfig is a general-purpose boot configuration. It draws some characteristics from FIT but it's not compatible with it. It uses JSON for interoperability.

func NewBootConfig

func NewBootConfig(data []byte) (*BootConfig, error)

NewBootConfig parses a boot configuration in JSON format and returns a BootConfig object.

func (*BootConfig) Boot

func (bc *BootConfig) Boot() error

Boot tries to boot the kernel with optional initramfs and command line options. If a device-tree is specified, that will be used too

func (*BootConfig) ChangeFilePaths

func (bc *BootConfig) ChangeFilePaths(newPath string)

ChangeFilePaths modifies the filepaths inside BootConfig. It replaces the current paths with new path leaving the last element of the path unchanged.

func (*BootConfig) FileNames

func (bc *BootConfig) FileNames() []string

FileNames returns a slice of all filenames in the bootconfig.

func (*BootConfig) ID

func (bc *BootConfig) ID() string

ID retrurns an identifyer composed of bc's name and crc32 hash of bc. The ID is suitable to be used as part of a filepath.

func (*BootConfig) IsValid

func (bc *BootConfig) IsValid() bool

IsValid returns true if a BootConfig object has valid content, and false otherwise

func (*BootConfig) SetFilePathsPrefix

func (bc *BootConfig) SetFilePathsPrefix(prefix string)

SetFilePathsPrefix modifies the filepaths inside BootConfig. It appends prefix at the beginning of the current paths

Jump to

Keyboard shortcuts

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