{"modulePath":"github.com/kernel/hypeman","version":"v0.4.0","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package system\n\n## Constants\n\n```go\nconst (\n\tMacOSAgentVolume = \"HypemanAgent\"\n\tMacOSAgentBinary = \"hypeman-guest-agent\"\n)\n```\nMacOSAgentVolume is the volume name of the read-only guest agent disk attached to macOS guests. The launcher in a macOS image runs MacOSAgentBinary from it.\n\n## Variables\n\n```go\nvar (\n\t// ErrUnsupportedVersion is returned when a version is not supported\n\tErrUnsupportedVersion = errors.New(\"unsupported version\")\n\n\t// ErrDownloadFailed is returned when downloading system files fails\n\tErrDownloadFailed = errors.New(\"download failed\")\n\n\t// ErrBuildFailed is returned when building initrd fails\n\tErrBuildFailed = errors.New(\"build failed\")\n)\n```\n\n```go\nvar (\n\t// DefaultKernelVersion is the kernel version used for new instances\n\tDefaultKernelVersion = Kernel_202611131\n\n\t// SupportedKernelVersions lists all supported kernel versions\n\tSupportedKernelVersions = []KernelVersion{\n\t\tKernel_202611131,\n\t\tKernel_202610301,\n\t\tKernel_202605291,\n\t\tKernel_202603301,\n\t\tKernel_202603091,\n\t\tKernel_202602101,\n\t\tKernel_202601152,\n\t}\n)\n```\n\n```go\nvar GuestAgentBinary []byte\n```\nGuestAgentBinary contains the embedded guest-agent binary This is built by the Makefile before the main binary is compiled\n\n```go\nvar InitBinary []byte\n```\nInitBinary contains the embedded init binary for guest VMs. This is built by the Makefile before the main binary is compiled. The init binary is a statically-linked Go program that runs as PID 1 in the guest VM. It matches the architecture of the host (VMs run on the same arch as the host).\n\n```go\nvar InitWrapper []byte\n```\n\n```go\nvar KernelDownloadURLs = map[KernelVersion]map[string]string{\n\tKernel_202611131: {\n\t\t\"x86_64\":  \"https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-3.3-202611131/vmlinux-x86_64\",\n\t\t\"aarch64\": \"https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-3.3-202611131/Image-arm64\",\n\t},\n\tKernel_202610301: {\n\t\t\"x86_64\":  \"https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-3.2-202610301/vmlinux-x86_64\",\n\t\t\"aarch64\": \"https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-3.2-202610301/Image-arm64\",\n\t},\n\tKernel_202605291: {\n\t\t\"x86_64\":  \"https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-3.0-202605291/vmlinux-x86_64\",\n\t\t\"aarch64\": \"https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-3.0-202605291/Image-arm64\",\n\t},\n\tKernel_202603301: {\n\t\t\"x86_64\":  \"https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-1.6-202603301/vmlinux-x86_64\",\n\t\t\"aarch64\": \"https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-1.6-202603301/Image-arm64\",\n\t},\n\tKernel_202603091: {\n\t\t\"x86_64\":  \"https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-1.5-202603091/vmlinux-x86_64\",\n\t\t\"aarch64\": \"https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-1.5-202603091/Image-arm64\",\n\t},\n\tKernel_202602101: {\n\t\t\"x86_64\":  \"https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-1.4-202602101/vmlinux-x86_64\",\n\t\t\"aarch64\": \"https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-1.4-202602101/Image-arm64\",\n\t},\n\tKernel_202601152: {\n\t\t\"x86_64\":  \"https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-1.3-202601152/vmlinux-x86_64\",\n\t\t\"aarch64\": \"https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-1.3-202601152/Image-arm64\",\n\t},\n}\n```\nKernelDownloadURLs maps kernel versions and architectures to download URLs\n\n```go\nvar KernelHeaderURLs = map[KernelVersion]map[string]string{\n\tKernel_202611131: {\n\t\t\"x86_64\":  \"https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-3.3-202611131/kernel-headers-x86_64.tar.gz\",\n\t\t\"aarch64\": \"https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-3.3-202611131/kernel-headers-aarch64.tar.gz\",\n\t},\n\tKernel_202610301: {\n\t\t\"x86_64\":  \"https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-3.2-202610301/kernel-headers-x86_64.tar.gz\",\n\t\t\"aarch64\": \"https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-3.2-202610301/kernel-headers-aarch64.tar.gz\",\n\t},\n\tKernel_202605291: {\n\t\t\"x86_64\":  \"https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-3.0-202605291/kernel-headers-x86_64.tar.gz\",\n\t\t\"aarch64\": \"https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-3.0-202605291/kernel-headers-aarch64.tar.gz\",\n\t},\n\tKernel_202603301: {\n\t\t\"x86_64\":  \"https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-1.6-202603301/kernel-headers-x86_64.tar.gz\",\n\t\t\"aarch64\": \"https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-1.6-202603301/kernel-headers-aarch64.tar.gz\",\n\t},\n\tKernel_202603091: {\n\t\t\"x86_64\":  \"https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-1.5-202603091/kernel-headers-x86_64.tar.gz\",\n\t\t\"aarch64\": \"https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-1.5-202603091/kernel-headers-aarch64.tar.gz\",\n\t},\n\tKernel_202602101: {\n\t\t\"x86_64\":  \"https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-1.4-202602101/kernel-headers-x86_64.tar.gz\",\n\t\t\"aarch64\": \"https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-1.4-202602101/kernel-headers-aarch64.tar.gz\",\n\t},\n\tKernel_202601152: {\n\t\t\"x86_64\":  \"https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-1.3-202601152/kernel-headers-x86_64.tar.gz\",\n\t\t\"aarch64\": \"https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-1.3-202601152/kernel-headers-aarch64.tar.gz\",\n\t},\n}\n```\nKernelHeaderURLs maps kernel versions and architectures to kernel header tarball URLs These tarballs contain kernel headers needed for DKMS to build out-of-tree modules (e.g., NVIDIA vGPU drivers)\n\n## Functions\n\n```go\nfunc GetArch() string\n```\nGetArch returns the architecture string for the current platform\n\n```go\nfunc MacOSAgentDisk(context.Context, *paths.Paths) (string, error)\n```\nMacOSAgentDisk is only available on macOS hosts.\n\n## Types\n\n```go\ntype KernelVersion string\n```\nKernelVersion represents a Cloud Hypervisor kernel version\n\n```go\nconst (\n\t// ImageKernelVersionLabel lets images request a specific guest kernel artifact.\n\tImageKernelVersionLabel = \"io.kernel.kernel-version\"\n\n\t// Kernel_202601152 is the previous kernel version with vGPU support\n\tKernel_202601152 KernelVersion = \"ch-6.12.8-kernel-1.3-202601152\"\n\n\t// Kernel_202602101 is the previous kernel version with overlayfs redirect_dir and index support\n\tKernel_202602101 KernelVersion = \"ch-6.12.8-kernel-1.4-202602101\"\n\n\t// Kernel_202603091 is the current kernel version with iptables filter/xt match support for nested Hypeman networking\n\tKernel_202603091 KernelVersion = \"ch-6.12.8-kernel-1.5-202603091\"\n\n\t// Kernel_202603301 is the current kernel version with expanded nftables/raw support for Docker bridge networking\n\tKernel_202603301 KernelVersion = \"ch-6.12.8-kernel-1.6-202603301\"\n\n\t// Kernel_202605291 is the current kernel version with VMGenID support for snapshot resume detection\n\tKernel_202605291 KernelVersion = \"ch-6.12.8-kernel-3.0-202605291\"\n\n\t// Kernel_202610301 adds IPv4 TPROXY, policy routing, and IPv6 support.\n\tKernel_202610301 KernelVersion = \"ch-6.12.8-kernel-3.2-202610301\"\n\n\t// Kernel_202611131 fixes ARM64 guest boot under Virtualization.framework on macOS 27.\n\tKernel_202611131 KernelVersion = \"ch-6.12.8-kernel-3.3-202611131\"\n)\n```\n\n```go\nfunc ParseKernelVersion(version string) (KernelVersion, bool)\n```\nParseKernelVersion returns a supported kernel version by exact artifact name.\n\n```go\ntype Manager interface {\n\t// EnsureSystemFiles ensures all supported kernels and the current initrd exist.\n\tEnsureSystemFiles(ctx context.Context) error\n\n\t// GetKernelPath returns path to kernel file\n\tGetKernelPath(version KernelVersion) (string, error)\n\n\t// GetInitrdPath returns path to current initrd file\n\tGetInitrdPath() (string, error)\n\n\t// GetDefaultKernelVersion returns the default kernel version\n\tGetDefaultKernelVersion() KernelVersion\n}\n```\nManager handles system files (kernel, initrd)\n\n```go\nfunc NewManager(p *paths.Paths) Manager\n```\nNewManager creates a new system manager\n\n","path":"github.com/kernel/hypeman/lib/system","name":"system","synopsis":"","isRedistributable":true}
