Skip to content

Commit

Permalink
linux/common-config: update for 6.12
Browse files Browse the repository at this point in the history
- refactor Rust checks to prepare for enablement
- enable DRM panic QR codes when Rust is enabled
- enable I2C_DESIGNWARE_CORE explicitly for all the Bay Trail things
- enable all the zram backends because they're separate options now and basically free
- enable the new and returning module compression related options
- enable scx and NFS local IO

(cherry picked from commit 88746a7)
  • Loading branch information
K900 committed Sep 30, 2024
1 parent e8a8a3d commit 4aef69c
Showing 1 changed file with 30 additions and 8 deletions.
38 changes: 30 additions & 8 deletions pkgs/os-specific/linux/kernel/common-config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ let
(stdenv.hostPlatform.isPower && stdenv.hostPlatform.is64bit) ||
(stdenv.hostPlatform.isMips && stdenv.hostPlatform.is64bit));

forceRust = features.rust or false;
kernelSupportsRust = lib.versionAtLeast version "6.7";

# Currently not enabling Rust by default, as upstream requires rustc 1.81
defaultRust = false;
withRust = (forceRust || defaultRust) && kernelSupportsRust;

options = {

debug = {
Expand Down Expand Up @@ -140,6 +147,7 @@ let

# Required to bring up some Bay Trail devices properly
I2C = yes;
I2C_DESIGNWARE_CORE = yes;
I2C_DESIGNWARE_PLATFORM = yes;
PMIC_OPREGION = whenAtLeast "5.10" yes;
INTEL_SOC_PMIC = whenAtLeast "5.10" yes;
Expand Down Expand Up @@ -487,14 +495,16 @@ let
DRM_VC4_HDMI_CEC = yes;
};

# Enables Rust support in the Linux kernel. This is currently not enabled by default, because it occasionally requires
# patching the Linux kernel for the specific Rust toolchain in nixpkgs. These patches usually take a bit
# of time to appear and this would hold up Linux kernel and Rust toolchain updates.
#
# Once Rust in the kernel has more users, we can reconsider enabling it by default.
rust = optionalAttrs ((features.rust or false) && versionAtLeast version "6.7") {
# Enable Rust and features that depend on it
rust = lib.optionalAttrs withRust {
RUST = yes;
GCC_PLUGINS = no;

# These don't technically require Rust but we probably want to get some more testing
# on the whole DRM panic setup before shipping it by default.
DRM_PANIC = whenAtLeast "6.12" yes;
DRM_PANIC_SCREEN = whenAtLeast "6.12" (freeform "kmsg");

DRM_PANIC_SCREEN_QR_CODE = whenAtLeast "6.12" yes;
};

sound = {
Expand Down Expand Up @@ -633,6 +643,7 @@ let
NFS_V4_1 = yes; # NFSv4.1 client support
NFS_V4_2 = yes;
NFS_V4_SECURITY_LABEL = yes;
NFS_LOCALIO = whenAtLeast "6.12" yes;

CIFS_XATTR = yes;
CIFS_POSIX = option yes;
Expand Down Expand Up @@ -884,6 +895,12 @@ let
ZRAM = module;
ZRAM_WRITEBACK = option yes;
ZRAM_MULTI_COMP = whenAtLeast "6.2" yes;
ZRAM_BACKEND_842 = whenAtLeast "6.12" yes;
ZRAM_BACKEND_DEFLATE = whenAtLeast "6.12" yes;
ZRAM_BACKEND_LZ4 = whenAtLeast "6.12" yes;
ZRAM_BACKEND_LZ4HC = whenAtLeast "6.12" yes;
ZRAM_BACKEND_LZO = whenAtLeast "6.12" yes;
ZRAM_BACKEND_ZSTD = whenAtLeast "6.12" yes;
ZRAM_DEF_COMP_ZSTD = whenAtLeast "5.11" yes;
ZSWAP = option yes;
ZSWAP_COMPRESSOR_DEFAULT_ZSTD = whenAtLeast "5.7" (mkOptionDefault yes);
Expand Down Expand Up @@ -962,7 +979,11 @@ let
THRUSTMASTER_FF = yes;
ZEROPLUS_FF = yes;

MODULE_COMPRESS = whenOlder "5.13" yes;
MODULE_COMPRESS = lib.mkMerge [
(whenOlder "5.13" yes)
(whenAtLeast "6.12" yes)
];
MODULE_COMPRESS_ALL = whenAtLeast "6.12" yes;
MODULE_COMPRESS_XZ = yes;

SYSVIPC = yes; # System-V IPC
Expand Down Expand Up @@ -1159,6 +1180,7 @@ let
LIRC = yes;

SCHED_CORE = whenAtLeast "5.14" yes;
SCHED_CLASS_EXT = whenAtLeast "6.12" yes;

LRU_GEN = whenAtLeast "6.1" yes;
LRU_GEN_ENABLED = whenAtLeast "6.1" yes;
Expand Down

0 comments on commit 4aef69c

Please sign in to comment.