Add latest kernel variants with processor specific tuning

This commit is contained in:
Lan Tian 2025-12-28 02:55:05 -08:00
parent 5e9dafb25c
commit 4c556e1bc0
No known key found for this signature in database
GPG Key ID: 04E66B6B25A0862B
4 changed files with 99 additions and 0 deletions

View File

@ -13,8 +13,18 @@ This repo provides the following kernel variants, consistent with the [upstream
```bash
└───packages
└───x86_64-linux
# Latest kernel, provide all LTO/CPU arch variants
├───linux-cachyos-latest
├───linux-cachyos-latest-x86_64-v2
├───linux-cachyos-latest-x86_64-v3
├───linux-cachyos-latest-x86_64-v4
├───linux-cachyos-latest-zen4
├───linux-cachyos-latest-lto
├───linux-cachyos-latest-lto-x86_64-v2
├───linux-cachyos-latest-lto-x86_64-v3
├───linux-cachyos-latest-lto-x86_64-v4
├───linux-cachyos-latest-lto-zen4
# LTS kernel, provide LTO variants
├───linux-cachyos-lts
├───linux-cachyos-lts-lto
# Additional CachyOS kernel variants

View File

@ -65,6 +65,38 @@ with lib.kernel;
CPU_FREQ_DEFAULT_GOV_PERFORMANCE = yes;
};
processorOpt = {
x86_64-v1 = {
GENERIC_CPU = yes;
MZEN4 = no;
X86_NATIVE_CPU = no;
X86_64_VERSION = freeform "1";
};
x86_64-v2 = {
GENERIC_CPU = yes;
MZEN4 = no;
X86_NATIVE_CPU = no;
X86_64_VERSION = freeform "2";
};
x86_64-v3 = {
GENERIC_CPU = yes;
MZEN4 = no;
X86_NATIVE_CPU = no;
X86_64_VERSION = freeform "3";
};
x86_64-v4 = {
GENERIC_CPU = yes;
MZEN4 = no;
X86_NATIVE_CPU = no;
X86_64_VERSION = freeform "4";
};
zen4 = {
GENERIC_CPU = no;
MZEN4 = yes;
X86_NATIVE_CPU = no;
};
};
tickrate = {
periodic = {
NO_HZ_IDLE = no;

View File

@ -12,17 +12,72 @@ let
in
builtins.listToAttrs (
builtins.map (v: lib.nameValuePair v.pname v) [
# Latest kernel, provide all LTO/CPU arch variants
(mkCachyKernel {
pname = "linux-cachyos-latest";
inherit (linux_latest) version src;
configVariant = "linux-cachyos";
})
(mkCachyKernel {
pname = "linux-cachyos-latest-x86_64-v2";
inherit (linux_latest) version src;
configVariant = "linux-cachyos";
processorOpt = "x86_64-v2";
})
(mkCachyKernel {
pname = "linux-cachyos-latest-x86_64-v3";
inherit (linux_latest) version src;
configVariant = "linux-cachyos";
processorOpt = "x86_64-v3";
})
(mkCachyKernel {
pname = "linux-cachyos-latest-x86_64-v4";
inherit (linux_latest) version src;
configVariant = "linux-cachyos";
processorOpt = "x86_64-v4";
})
(mkCachyKernel {
pname = "linux-cachyos-latest-zen4";
inherit (linux_latest) version src;
configVariant = "linux-cachyos";
processorOpt = "zen4";
})
(mkCachyKernel {
pname = "linux-cachyos-latest-lto";
inherit (linux_latest) version src;
configVariant = "linux-cachyos";
lto = "thin";
})
(mkCachyKernel {
pname = "linux-cachyos-latest-lto-x86_64-v2";
inherit (linux_latest) version src;
configVariant = "linux-cachyos";
lto = "thin";
processorOpt = "x86_64-v2";
})
(mkCachyKernel {
pname = "linux-cachyos-latest-lto-x86_64-v3";
inherit (linux_latest) version src;
configVariant = "linux-cachyos";
lto = "thin";
processorOpt = "x86_64-v3";
})
(mkCachyKernel {
pname = "linux-cachyos-latest-lto-x86_64-v4";
inherit (linux_latest) version src;
configVariant = "linux-cachyos";
lto = "thin";
processorOpt = "x86_64-v4";
})
(mkCachyKernel {
pname = "linux-cachyos-latest-lto-zen4";
inherit (linux_latest) version src;
configVariant = "linux-cachyos";
lto = "thin";
processorOpt = "zen4";
})
# LTS kernel
(mkCachyKernel {
pname = "linux-cachyos-lts";
inherit (linux) version src;

View File

@ -39,6 +39,7 @@ lib.makeOverridable (
ccHarder ? true,
bbr3 ? false,
hugepage ? "always",
processorOpt ? "x86_64-v1",
# CachyOS additional patch settings
hardened ? false,
@ -126,6 +127,7 @@ lib.makeOverridable (
// (lib.optionalAttrs ccHarder cachySettings.ccHarder)
// (lib.optionalAttrs bbr3 cachySettings.bbr3)
// (lib.optionalAttrs (hugepage != null) cachySettings.hugepage."${hugepage}")
// (lib.optionalAttrs (processorOpt != null) cachySettings.processorOpt.${processorOpt})
))
# Apply user custom settings