config

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

package config contains all the logic around kcrypt config This config includes everything below `kcrypt:` in the kairos config yaml

Index

Constants

This section is empty.

Variables

View Source
var ConfigScanDirs = []string{"/oem", "/sysroot/oem"}

There are the directories under which we expect to find kairos configuration. When we are booted from an iso (during installation), configuration is expected under `/oem`. When we are booting an installed system (in initramfs phase), the path is `/sysroot/oem`.

View Source
var MappingsFile = "/oem/91-kcrypt-mappings.yaml"

This file is "hardcoded" to `/oem` because we only use this at install time in which case the config is in `/oem`.

Functions

func PartitionToString

func PartitionToString(p *block.Partition) string

Types

type Config

type Config struct {
	Kcrypt struct {
		UUIDLabelMappings map[string]string `yaml:"uuid_label_mappings,omitempty"`
	}
}

func GetConfiguration

func GetConfiguration(configDirs []string) (Config, error)

func (Config) GetLabelForUUID added in v0.6.0

func (c Config) GetLabelForUUID(uuidCheck string) (string, error)

GetLabelForUUID returns the partition label for a known UUID UUIDS are generated on luksify method They are generated by setting the namespace to DNS and the name to the fs label, so they are always the same

func (Config) LookupLabelForUUID

func (c Config) LookupLabelForUUID(uuid string) string

func (Config) LookupUUIDForLabel

func (c Config) LookupUUIDForLabel(l string) string

func (*Config) SetMapping

func (c *Config) SetMapping(partitionInfo string) error

SetMapping updates the Config with partition information for one partition. This doesn't persist on the file. WriteMappings needs to be called after all mapping are in the Config (possibly with multiple calls to this function).

func (*Config) WriteMappings

func (c *Config) WriteMappings(fileName string) error

WriteMappings will create or replace the MappingsFile It's called by kairos agent, at installation time, after the partitions have been created (and we have the UUIDs available).

Jump to

Keyboard shortcuts

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