Skip to content

Commit

Permalink
Merge pull request NixOS#218418 from xfix/kernel-6.2
Browse files Browse the repository at this point in the history
[22.11] linux: init 6.2
  • Loading branch information
Ma27 authored Mar 3, 2023
2 parents dcab12b + de6aa65 commit 737be8f
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 7 deletions.
15 changes: 15 additions & 0 deletions lib/tests/misc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,21 @@ runTests {
expected = [ "1" "2" "3" ];
};

testPadVersionLess = {
expr = versions.pad 3 "1.2";
expected = "1.2.0";
};

testPadVersionLessExtra = {
expr = versions.pad 3 "1.3-rc1";
expected = "1.3.0-rc1";
};

testPadVersionMore = {
expr = versions.pad 3 "1.2.3.4";
expected = "1.2.3";
};

testIsStorePath = {
expr =
let goodPath =
Expand Down
15 changes: 15 additions & 0 deletions lib/versions.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,19 @@ rec {
builtins.concatStringsSep "."
(lib.take 2 (splitVersion v));

/* Pad a version string with zeros to match the given number of components.
Example:
pad 3 "1.2"
=> "1.2.0"
pad 3 "1.3-rc1"
=> "1.3.0-rc1"
pad 3 "1.2.3.4"
=> "1.2.3"
*/
pad = n: version: let
numericVersion = lib.head (lib.splitString "-" version);
versionSuffix = lib.removePrefix numericVersion version;
in lib.concatStringsSep "." (lib.take n (lib.splitVersion numericVersion ++ lib.genList (_: "0") n)) + versionSuffix;

}
12 changes: 6 additions & 6 deletions pkgs/os-specific/linux/kernel/common-config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ let
DRM_GMA500 = whenAtLeast "5.12" module;
DRM_GMA600 = whenOlder "5.13" yes;
DRM_GMA3600 = whenOlder "5.12" yes;
DRM_VMWGFX_FBCON = yes;
DRM_VMWGFX_FBCON = whenOlder "6.2" yes;
# (experimental) amdgpu support for verde and newer chipsets
DRM_AMDGPU_SI = yes;
# (stable) amdgpu support for bonaire and newer chipsets
Expand Down Expand Up @@ -434,7 +434,7 @@ let
F2FS_FS_COMPRESSION = whenAtLeast "5.6" yes;
UDF_FS = module;

NFSD_V2_ACL = yes;
NFSD_V2_ACL = whenOlder "6.2" yes;
NFSD_V3 = whenOlder "5.18" yes;
NFSD_V3_ACL = yes;
NFSD_V4 = yes;
Expand All @@ -461,7 +461,7 @@ let
CEPH_FS_POSIX_ACL = yes;

SQUASHFS_FILE_DIRECT = yes;
SQUASHFS_DECOMP_MULTI_PERCPU = yes;
SQUASHFS_DECOMP_MULTI_PERCPU = whenOlder "6.2" yes;
SQUASHFS_XATTR = yes;
SQUASHFS_ZLIB = yes;
SQUASHFS_LZO = yes;
Expand Down Expand Up @@ -508,8 +508,8 @@ let
SECURITY_APPARMOR = yes;
DEFAULT_SECURITY_APPARMOR = yes;

RANDOM_TRUST_CPU = whenAtLeast "4.19" yes; # allow RDRAND to seed the RNG
RANDOM_TRUST_BOOTLOADER = whenAtLeast "5.4" yes; # allow the bootloader to seed the RNG
RANDOM_TRUST_CPU = whenOlder "6.2" (whenAtLeast "4.19" yes); # allow RDRAND to seed the RNG
RANDOM_TRUST_BOOTLOADER = whenOlder "6.2" (whenAtLeast "5.4" yes); # allow the bootloader to seed the RNG

MODULE_SIG = no; # r13y, generates a random key during build and bakes it in
# Depends on MODULE_SIG and only really helps when you sign your modules
Expand Down Expand Up @@ -834,7 +834,7 @@ let

EFI_STUB = yes; # EFI bootloader in the bzImage itself
EFI_GENERIC_STUB_INITRD_CMDLINE_LOADER =
whenAtLeast "5.8" yes; # initrd kernel parameter for EFI
whenOlder "6.2" (whenAtLeast "5.8" yes); # initrd kernel parameter for EFI
CGROUPS = yes; # used by systemd
FHANDLE = yes; # used by systemd
SECCOMP = yes; # used by systemd >= 231
Expand Down
18 changes: 18 additions & 0 deletions pkgs/os-specific/linux/kernel/linux-6.2.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{ lib, buildPackages, fetchurl, perl, buildLinux, nixosTests, ... } @ args:

with lib;

buildLinux (args // rec {
version = "6.2";

# modDirVersion needs to be x.y.z, will automatically add .0 if needed
modDirVersion = versions.pad 3 version;

# branchVersion needs to be x.y
extraMeta.branch = versions.majorMinor version;

src = fetchurl {
url = "mirror://kernel/linux/kernel/v6.x/linux-${version}.tar.xz";
sha256 = "sha256-dIYvqKtA7a6FuzOFwLcf4QMoi85RhSbWMZeACzy97LE=";
};
} // (args.argsOverride or { }))
2 changes: 2 additions & 0 deletions pkgs/top-level/aliases.nix
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,7 @@ mapAliases ({
linuxPackages_5_4 = linuxKernel.packages.linux_5_4;
linuxPackages_6_0 = linuxKernel.packages.linux_6_0;
linuxPackages_6_1 = linuxKernel.packages.linux_6_1;
linuxPackages_6_2 = linuxKernel.packages.linux_6_2;
linuxPackages_hardkernel_4_14 = linuxKernel.packages.hardkernel_4_14;
linuxPackages_rpi0 = linuxKernel.packages.linux_rpi1;
linuxPackages_rpi02w = linuxKernel.packages.linux_rpi3;
Expand All @@ -841,6 +842,7 @@ mapAliases ({
linux_5_4 = linuxKernel.kernels.linux_5_4;
linux_6_0 = linuxKernel.kernels.linux_6_0;
linux_6_1 = linuxKernel.kernels.linux_6_1;
linux_6_2 = linuxKernel.kernels.linux_6_2;
linuxPackages_mptcp = throw "'linuxPackages_mptcp' has been moved to https://github.com/teto/mptcp-flake"; # Converted to throw 2022-10-04
linux_mptcp = throw "'linux_mptcp' has been moved to https://github.com/teto/mptcp-flake"; # Converted to throw 2022-10-04
linux_mptcp_95 = throw "'linux_mptcp_95' has been moved to https://github.com/teto/mptcp-flake"; # Converted to throw 2022-10-04
Expand Down
11 changes: 10 additions & 1 deletion pkgs/top-level/linux-kernels.nix
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,14 @@ in {
];
};

linux_6_2 = callPackage ../os-specific/linux/kernel/linux-6.2.nix {
kernelPatches = [
kernelPatches.bridge_stp_helper
kernelPatches.request_key_helper
kernelPatches.fix-em-ice-bonding
];
};

linux_testing = let
testing = callPackage ../os-specific/linux/kernel/linux-testing.nix {
kernelPatches = [
Expand Down Expand Up @@ -522,6 +530,7 @@ in {
linux_5_19 = throw "linux 5.19 was removed because it reached its end of life upstream"; # Added 2022-11-01
linux_6_0 = throw "linux 6.0 was removed because it reached its end of life upstream"; # Added 2023-01-20
linux_6_1 = recurseIntoAttrs (packagesFor kernels.linux_6_1);
linux_6_2 = recurseIntoAttrs (packagesFor kernels.linux_6_2);
};

rtPackages = {
Expand Down Expand Up @@ -581,7 +590,7 @@ in {
packageAliases = {
linux_default = packages.linux_5_15;
# Update this when adding the newest kernel major version!
linux_latest = packages.linux_6_1;
linux_latest = packages.linux_6_2;
linux_mptcp = packages.linux_mptcp_95;
linux_rt_default = packages.linux_rt_5_4;
linux_rt_latest = packages.linux_rt_5_10;
Expand Down

0 comments on commit 737be8f

Please sign in to comment.