Hyper.Node.Vmlinux (Hyper v0.1.0)

Copy Markdown View Source

Resolves the guest kernel (vmlinux) image for this node.

Two sources, in priority order:

  1. An operator-configured path for the node's architecture, via config :hyper, Hyper.Cfg.VmLinux, amd64: ..., aarch64: ... (see Hyper.Cfg.VmLinux.images/0). If set, it wins - the operator can pin a custom kernel.
  2. Otherwise, the default kernel downloaded by Hyper.Node.FireVMM.VmLinux.Provider (highest version for the arch).

test_system/0 verifies that whichever source applies actually yields a file on disk for this node's architecture, so a misconfigured node aborts at boot instead of failing the first VM launch.

Summary

Functions

Absolute path to the kernel image for arch: the operator-configured path if set, otherwise the Provider's default kernel. Raises if neither resolves (boot's test_system/0 is expected to have caught that first).

Ensure this node's vmlinux image is present. With an operator-configured path, returns {:error, {:vmlinux_missing, path}} if that file is absent. Otherwise falls back to the Provider's default kernel and returns {:error, {:vmlinux_missing, path}} if it is absent, or {:error, {:no_kernel, arch}} if the manifest has no kernel for this architecture.

Functions

path(arch)

@spec path(Sys.Arch.t()) :: Path.t()

Absolute path to the kernel image for arch: the operator-configured path if set, otherwise the Provider's default kernel. Raises if neither resolves (boot's test_system/0 is expected to have caught that first).

test_system()

@spec test_system() :: :ok | {:error, term()}

Ensure this node's vmlinux image is present. With an operator-configured path, returns {:error, {:vmlinux_missing, path}} if that file is absent. Otherwise falls back to the Provider's default kernel and returns {:error, {:vmlinux_missing, path}} if it is absent, or {:error, {:no_kernel, arch}} if the manifest has no kernel for this architecture.