jsonboot

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2021 License: BSD-3-Clause Imports: 11 Imported by: 10 modules, 15 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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