Documentation ¶
Overview ¶
Package config provides parsing for the armory-boot configuration file format.
Index ¶
Constants ¶
const DefaultConfigPath = "/boot/armory-boot.conf"
DefaultConfigPath is the default armory-boot configuration file path.
const DefaultSignaturePath = "/boot/armory-boot.conf.sig"
DefaultSignaturePath is the default armory-boot configuration file signature path.
Variables ¶
This section is empty.
Functions ¶
func CompareHash ¶
CompareHash computes a SHA256 checksum of the input data, using hardware acceleration (NXP DCP), and compares the computed hash with the one passed as a string with only hexadecimal characters and even length.
As this function is meant for pre-boot use, the entire input buffer is copied in a DMA region for DCP consumption in a single pass, rather than buffering over multiple passes, to reduce DCP command overhead. When used in other contexts callers must ensure that enough DMA space is available.
This function is only meant to be used with `GOOS=tamago GOARCH=arm` on i.MX6 targets.
Types ¶
type Config ¶
type Config struct { // KernelPath is the path to a Linux kernel image. KernelPath []string `json:"kernel"` // DeviceTreeBlobPath is the path to a Linux DTB file. DeviceTreeBlobPath []string `json:"dtb"` // InitialRamDiskPath is the path to a Linux initrd file. InitialRamDiskPath []string `json:"initrd"` // CmdLine is the Linux kernel command-line parameters. CmdLine string `json:"cmdline"` // Unikernel is the path to an ELF unikernel image (e.g. TamaGo). UnikernelPath []string `json:"unikernel"` // ELF indicates whether the loaded kernel is a unikernel or not. ELF bool // JSON holds the configuration file contents JSON []byte // contains filtered or unexported fields }
Config represents the armory-boot configuration.
func Load ¶
func Load(part *disk.Partition, configPath string, sigPath string, pubKey string) (c *Config, err error)
Load reads an armory-boot configuration file, and optionally its signature, from a disk partition. The public key argument is used for signature authentication, a valid signature path must be present if a key is set.
func (*Config) DeviceTreeBlob ¶
DeviceTreeBlob returns the contents of the dtb file previously loaded by a successful Load().
func (*Config) InitialRamDisk ¶
InitialRamDisk returns the contents of the initrd image previously loaded by a successful Load().