Bsdkrun.System (bsdkrun_ex v0.1.0)

Copy Markdown View Source

Host-level toolchain + image operations.

Summary

Functions

Download + prepare a BSD image ahead of time. Returns {:ok, output}. Opts: :version, :dir, :force.

Grow a raw disk image (the guest expands its root FS on next boot).

Sanity-check the toolchain: verify libkrun links and a context can be created/configured. Does not boot. Returns true on success.

List the arm64 builds available to fetch for a BSD. Returns {:ok, lines} — the raw non-empty output lines.

Functions

fetch_image(os, opts \\ [])

@spec fetch_image(
  :freebsd | :netbsd,
  keyword()
) :: {:ok, String.t()} | {:error, Bsdkrun.Error.t()}

Download + prepare a BSD image ahead of time. Returns {:ok, output}. Opts: :version, :dir, :force.

grow_disk(disk, size)

@spec grow_disk(String.t(), String.t()) :: :ok | {:error, Bsdkrun.Error.t()}

Grow a raw disk image (the guest expands its root FS on next boot).

probe()

@spec probe() :: boolean()

Sanity-check the toolchain: verify libkrun links and a context can be created/configured. Does not boot. Returns true on success.

versions(os)

@spec versions(:freebsd | :netbsd) ::
  {:ok, [String.t()]} | {:error, Bsdkrun.Error.t()}

List the arm64 builds available to fetch for a BSD. Returns {:ok, lines} — the raw non-empty output lines.