tools

package
v0.50.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArtifactURL

func ArtifactURL(version, artifact string) string

ArtifactURL returns the download URL for a named artifact at a given semver. version must be in "vMAJOR.MINOR.PATCH" form; artifact is e.g. "kernel.img". Passing version="latest" downloads from the rolling latest release.

func ClearCachedTools

func ClearCachedTools(toolsDir string) error

ClearCachedTools deletes the kernel artifacts and version file from toolsDir.

func DownloadVersion

func DownloadVersion(ctx context.Context, toolsDir, version string) error

DownloadVersion downloads all kernel artifacts for the given semver into toolsDir and saves the version file. Use version="latest" for the rolling release.

func EnsureFCKernel

func EnsureFCKernel(ctx context.Context, toolsDir string) (string, error)

EnsureFCKernel downloads kernel-fc.img from the latest release into toolsDir if it is not already present. Returns the local path to the kernel.

func Exist

func Exist(toolsDir string) bool

Exist returns true when all three kernel artifacts are present in toolsDir.

func FCKernelExists

func FCKernelExists(toolsDir string) bool

FCKernelExists returns true when the Firecracker kernel is present in toolsDir.

func FCKernelPath

func FCKernelPath(toolsDir string) string

FCKernelPath returns the path where the Firecracker-compatible kernel is cached.

func IsNewer

func IsNewer(local, remote string) bool

IsNewer reports whether remote is a strictly higher semver than local. Unknown/malformed versions are never treated as newer.

func ListRemoteVersions

func ListRemoteVersions(ctx context.Context) ([]string, error)

ListRemoteVersions returns all available kernel versions from GitHub releases, sorted newest-first by semver.

func LocalVersion

func LocalVersion(toolsDir string) string

LocalVersion returns the semver string (e.g. "v0.1.0") cached in toolsDir. Returns "(unknown)" if the file is absent or unreadable.

func RemoteVersion

func RemoteVersion(ctx context.Context) (string, error)

RemoteVersion returns the semver of the latest kernel release on GitHub.

func ResolveDump

func ResolveDump(ctx context.Context, toolsDir, override string) (string, error)

ResolveDump returns the path to the dump binary, downloading it from the kernel release if it is not already present in toolsDir. If override is non-empty it is returned as-is without any checks.

func ResolveMkfs

func ResolveMkfs(ctx context.Context, toolsDir, override string) (image.MkfsFunc, error)

ResolveMkfs returns an image.MkfsFunc ready to invoke.

Downloads the latest kernel artifacts to toolsDir on first use and caches them. If override is non-empty it is used as the mkfs binary path; kernel/boot still come from toolsDir.

func SaveLocalVersion

func SaveLocalVersion(toolsDir, version string) error

SaveLocalVersion writes version to toolsDir/kernel-version.txt.

Types

This section is empty.

Jump to

Keyboard shortcuts

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