initos

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoDrive = errors.New("no NoCloud drive: attach a cloud-init drive with user-data (fqdn) and network-config")

ErrNoDrive is a machine without a NoCloud drive.

View Source
var ErrNotBaked = errors.New("no " + config.EdgeFile + " in the ISO: this is the release ISO; boot one made with fortressctl bake")

ErrNotBaked is the release ISO booted as it ships: it has no fortress.yml, so it trusts nobody.

Functions

func LoadPolicy

func LoadPolicy(path string) ([]byte, error)

LoadPolicy reads the policy fortressctl apply stored at path. An edge nobody applied a policy to has none: nil, and no error.

func MountSource

func MountSource(dir string) (string, bool)

MountSource reports what device is mounted at dir, if any.

func MountVar

func MountVar(dev string) (string, error)

MountVar mounts the persistent disk at /var, formatting it ext4 if blank. An empty dev uses /dev/vda when it exists and /dev/sda otherwise. State lives in /var/fortressedge, logs in /var/log/fortressedge. Idempotent. The returned path is the device that is mounted.

func Setup

func Setup() error

func StorePolicy

func StorePolicy(path string, b []byte) error

StorePolicy replaces the policy at path whole: a power cut leaves the old one or the new one, never part of either.

func WatchPower

func WatchPower(press func())

WatchPower calls press once when the ACPI power button is pressed. Proxmox Shutdown and Reboot are that button (QMP system_powerdown); Reboot starts the VM again only after it has powered off. The goroutines block in read until the process exits on poweroff.

Types

type Seed

type Seed struct {
	UserData      []byte
	NetworkConfig []byte
	Edge          []byte
}

Seed is the config boot reads: fortress.yml from the ISO, user-data and network-config from the NoCloud drive. The policy is on the /var disk, read once that is mounted.

func FindSeed

func FindSeed() (Seed, error)

FindSeed reads fortress.yml from the initramfs and waits for the NoCloud drive. The drive stays attached: every boot reads it, as cloud-init does, so a change made on the platform (Proxmox's Cloud-Init tab, a Terraform apply) takes effect at the next start.

Jump to

Keyboard shortcuts

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