realm

package
v0.0.0-...-c8a9721 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LeasedAddress string

LeasedAddress is the currently leased address

Functions

func ApplyNetplan

func ApplyNetplan(chroot string) error

ApplyNetplan - this will be done through an /etc/rc.local (TODO)

func DHCPClient

func DHCPClient() error

DHCPClient starts the DHCP client listening for a lease

func EnableLVM

func EnableLVM() error

EnableLVM - will enable any volumes

func GetMAC

func GetMAC() (string, error)

GetMAC will return a mac address

func GrowLVMRoot

func GrowLVMRoot(drive, volume string, partition int) error

GrowLVMRoot will grow the root filesystem

func Halt

func Halt()

Halt will instruct the CPU to enter a halt state (no-power off (usually))

func PartProbe

func PartProbe(device string) error

PartProbe will update partitions - will enable any volumes

func PowerOff

func PowerOff()

PowerOff will result in the host using an ACPI power off

func Reboot

func Reboot()

Reboot a host

func Shell

func Shell()

Shell will Start a userland shell

func Suspend

func Suspend()

Suspend will instruct the CPU to enter a suspended state (no-power off (usually))

func Wipe

func Wipe(device string) error

Wipe will clean the beginning of the disk

func WriteNetPlan

func WriteNetPlan(chroot string, cfg *types.BootyConfig) error

WriteNetPlan - will write a netplan to disk

Types

type Device

type Device struct {
	// Create the device within the ramdisk
	CreateDevice bool

	// Configuration for the device
	Name  string
	Path  string
	Mode  uint32
	Major int64
	Minor int64
}

Device contains the configuration for a single device within the initramfs

type Devices

type Devices struct {
	Device []Device
}

Devices are the devices that can be created on boot

func DefaultDevices

func DefaultDevices() *Devices

DefaultDevices will return the defult mounts

func (*Devices) CreateDevice

func (d *Devices) CreateDevice() error

CreateDevice -

func (*Devices) GetDevice

func (d *Devices) GetDevice(name string) *Device

GetDevice -

type Ethernets

type Ethernets struct {
	Match struct {
		Macaddress string `yaml:"macaddress,omitempty"`
	} `yaml:"match,omitempty"`
	Addresses   []string `yaml:"addresses,omitempty"`
	Dhcp4       bool     `yaml:"dhcp4"`
	Optional    bool     `yaml:"optional,omitempty"`
	SetName     string   `yaml:"set-name,omitempty"`
	Gateway4    string   `yaml:"gateway4,omitempty"`
	Nameservers struct {
		Search    []string `yaml:"search,omitempty"`
		Addresses []string `yaml:"addresses,omitempty"`
	} `yaml:"nameservers,omitempty"`
}

Ethernets defines a connection

type Mount

type Mount struct {
	// Create the location on disk
	CreateMount bool

	// Enable the mount Source -> Path w/options
	EnableMount bool

	// Configurations
	Name    string
	Source  string
	Path    string
	Mode    os.FileMode
	FSType  string
	Flags   uintptr
	Options string
}

Mount contains the configuration for a single mount within the initramfs

type Mounts

type Mounts struct {
	Mount []Mount
}

Mounts are the paths that can be mounted or created on boot

func DefaultMounts

func DefaultMounts() *Mounts

DefaultMounts will return the defult mounts

func MountRootVolume

func MountRootVolume(rootVolume string) (*Mounts, error)

MountRootVolume - will create a mountpoint and mount the root volume

func (*Mounts) CreateFolder

func (m *Mounts) CreateFolder() error

CreateFolder -

func (*Mounts) GetMount

func (m *Mounts) GetMount(name string) *Mount

GetMount -

func (*Mounts) MountAll

func (m *Mounts) MountAll() error

MountAll -

func (*Mounts) MountNamed

func (m *Mounts) MountNamed(name string, remove bool) error

MountNamed -

func (*Mounts) UnMountAll

func (m *Mounts) UnMountAll() error

UnMountAll - will unmount all partitions

func (*Mounts) UnMountNamed

func (m *Mounts) UnMountNamed(name string) error

UnMountNamed - will unmount a partition

type Netplan

type Netplan struct {
	Network struct {
		Ethernets map[string]interface{} `yaml:"ethernets"`
		Version   int                    `yaml:"version"`
		Renderer  string                 `yaml:"renderer"`
	} `yaml:"network"`
}

Netplan outlines the Debian netplan configuration

Jump to

Keyboard shortcuts

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