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 ```bash
└───packages └───packages
└───x86_64-linux └───x86_64-linux
# Latest kernel, provide all LTO/CPU arch variants
├───linux-cachyos-latest ├───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
├───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
├───linux-cachyos-lts-lto ├───linux-cachyos-lts-lto
# Additional CachyOS kernel variants # Additional CachyOS kernel variants

View File

@ -65,6 +65,38 @@ with lib.kernel;
CPU_FREQ_DEFAULT_GOV_PERFORMANCE = yes; 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 = { tickrate = {
periodic = { periodic = {
NO_HZ_IDLE = no; NO_HZ_IDLE = no;

View File

@ -12,17 +12,72 @@ let
in in
builtins.listToAttrs ( builtins.listToAttrs (
builtins.map (v: lib.nameValuePair v.pname v) [ builtins.map (v: lib.nameValuePair v.pname v) [
# Latest kernel, provide all LTO/CPU arch variants
(mkCachyKernel { (mkCachyKernel {
pname = "linux-cachyos-latest"; pname = "linux-cachyos-latest";
inherit (linux_latest) version src; inherit (linux_latest) version src;
configVariant = "linux-cachyos"; 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 { (mkCachyKernel {
pname = "linux-cachyos-latest-lto"; pname = "linux-cachyos-latest-lto";
inherit (linux_latest) version src; inherit (linux_latest) version src;
configVariant = "linux-cachyos"; configVariant = "linux-cachyos";
lto = "thin"; 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 { (mkCachyKernel {
pname = "linux-cachyos-lts"; pname = "linux-cachyos-lts";
inherit (linux) version src; inherit (linux) version src;

View File

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