Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion lib/system/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,18 @@ const (

// Kernel_202605291 is the current kernel version with VMGenID support for snapshot resume detection
Kernel_202605291 KernelVersion = "ch-6.12.8-kernel-3.0-202605291"

// Kernel_202610301 adds IPv4 TPROXY, policy routing, and IPv6 support.
Kernel_202610301 KernelVersion = "ch-6.12.8-kernel-3.2-202610301"
)

var (
// DefaultKernelVersion is the kernel version used for new instances
DefaultKernelVersion = Kernel_202605291
DefaultKernelVersion = Kernel_202610301

// SupportedKernelVersions lists all supported kernel versions
SupportedKernelVersions = []KernelVersion{
Kernel_202610301,
Kernel_202605291,
Kernel_202603301,
Kernel_202603091,
Expand All @@ -41,6 +45,10 @@ var (

// KernelDownloadURLs maps kernel versions and architectures to download URLs
var KernelDownloadURLs = map[KernelVersion]map[string]string{
Kernel_202610301: {
"x86_64": "https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-3.2-202610301/vmlinux-x86_64",
"aarch64": "https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-3.2-202610301/Image-arm64",
},
Kernel_202605291: {
"x86_64": "https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-3.0-202605291/vmlinux-x86_64",
"aarch64": "https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-3.0-202605291/Image-arm64",
Expand All @@ -66,6 +74,10 @@ var KernelDownloadURLs = map[KernelVersion]map[string]string{
// KernelHeaderURLs 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)
var KernelHeaderURLs = map[KernelVersion]map[string]string{
Kernel_202610301: {
"x86_64": "https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-3.2-202610301/kernel-headers-x86_64.tar.gz",
"aarch64": "https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-3.2-202610301/kernel-headers-aarch64.tar.gz",
},
Kernel_202605291: {
"x86_64": "https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-3.0-202605291/kernel-headers-x86_64.tar.gz",
"aarch64": "https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-3.0-202605291/kernel-headers-aarch64.tar.gz",
Expand Down
22 changes: 22 additions & 0 deletions lib/system/versions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,25 @@ func TestParseKernelVersion(t *testing.T) {
_, ok = ParseKernelVersion("ch-6.12.8-kernel-9.9-20990101")
assert.False(t, ok)
}

func TestKernel202610301Registration(t *testing.T) {
version, ok := ParseKernelVersion("ch-6.12.8-kernel-3.2-202610301")
assert.True(t, ok)
assert.Equal(t, Kernel_202610301, version)
assert.Equal(t, Kernel_202610301, DefaultKernelVersion)
assert.Equal(t, DefaultKernelVersion, SupportedKernelVersions[0])

previous, ok := ParseKernelVersion(string(Kernel_202605291))
assert.True(t, ok)
assert.Equal(t, Kernel_202605291, previous)

baseURL := "https://github.com/kernel/linux/releases/download/ch-6.12.8-kernel-3.2-202610301/"
assert.Equal(t, map[string]string{
"x86_64": baseURL + "vmlinux-x86_64",
"aarch64": baseURL + "Image-arm64",
}, KernelDownloadURLs[version])
assert.Equal(t, map[string]string{
"x86_64": baseURL + "kernel-headers-x86_64.tar.gz",
"aarch64": baseURL + "kernel-headers-aarch64.tar.gz",
}, KernelHeaderURLs[version])
}
Loading