Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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.
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 ¶
LoadPolicy reads the policy fortressctl apply stored at path. An edge nobody applied a policy to has none: nil, and no error.
func MountSource ¶
MountSource reports what device is mounted at dir, if any.
func MountVar ¶
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 StorePolicy ¶
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. It watches every input device, as its node appears, until the one named "Power Button" is among them or powerSearch is up: the keyboard's node can appear before the button's, which is why it does not stop at the first. It returns once the button is watched, or after powerWait, and goes on looking in the background. The readers block until the process exits on poweroff.
Types ¶
type Seed ¶
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.