From 61210f5e44a816294ec8544a406185beb937e0f9 Mon Sep 17 00:00:00 2001 From: mexisme Date: Sat, 6 Mar 2021 17:33:35 +1300 Subject: [PATCH 1/4] Update to kernel 5.10.19 - Add kernel 5.10.19 and latest linux-surface patches - Remove kernel 5.10.2 commit 7250b8cbb40bc001109b1032b426ce9923335de0 Author: mexisme Date: Fri Feb 5 08:38:10 2021 +1300 commit 90b210dfeeaf6f625e1b7f47dfc3a0b60f4172a6 Author: mexisme Date: Fri Feb 5 08:37:41 2021 +1300 commit bbb5dec0e353f841612a1c3a3f933c56ede418b2 Author: mexisme Date: Tue Feb 2 23:58:51 2021 +1300 commit bde79616d2795fcedc2d88161933713a9f37e3a7 Author: mexisme Date: Tue Feb 2 23:58:35 2021 +1300 commit be5b9c91acaebe1e17d582a1f364995dadcc339d Author: mexisme Date: Tue Feb 2 23:57:54 2021 +1300 --- microsoft/surface/TODO.org | 3 ++- microsoft/surface/kernel/default.nix | 2 +- .../default.nix | 26 ++++++++++++------- .../linux-5.10.19.nix} | 4 +-- microsoft/surface/repos.nix | 4 +-- 5 files changed, 24 insertions(+), 15 deletions(-) rename microsoft/surface/kernel/{linux-5.10.2 => linux-5.10.19}/default.nix (82%) rename microsoft/surface/kernel/{linux-5.10.2/linux-5.10.2.nix => linux-5.10.19/linux-5.10.19.nix} (85%) diff --git a/microsoft/surface/TODO.org b/microsoft/surface/TODO.org index 7db7ea4..125ec7d 100644 --- a/microsoft/surface/TODO.org +++ b/microsoft/surface/TODO.org @@ -3,9 +3,10 @@ - Latest from linux-surface - [X] Download github.com/linux-surface/linux-surface kernel patches - [X] Build kernel using downloaded patches -** TODO Create a function for selecting preferred kernel +** CANCELLED Create a function for selecting preferred kernel ** DONE Fix how Keyboard & Trackpad are not being enabled on SL3 - https://github.com/linux-surface/surface-aggregator-module/wiki/Testing-and-Installing +** DOING Update to kernel 5.10.19 * Firmware ** DONE Remove old firmware binaries - Looks like the ath10k files aren't needed, any more diff --git a/microsoft/surface/kernel/default.nix b/microsoft/surface/kernel/default.nix index b280f2d..8240153 100644 --- a/microsoft/surface/kernel/default.nix +++ b/microsoft/surface/kernel/default.nix @@ -1,5 +1,5 @@ { config, lib, pkgs, ... }: { - boot.kernelPackages = pkgs.callPackage ./linux-5.10.2 {}; + boot.kernelPackages = pkgs.callPackage ./linux-5.10.19 {}; } diff --git a/microsoft/surface/kernel/linux-5.10.2/default.nix b/microsoft/surface/kernel/linux-5.10.19/default.nix similarity index 82% rename from microsoft/surface/kernel/linux-5.10.2/default.nix rename to microsoft/surface/kernel/linux-5.10.19/default.nix index d4f6eb4..ab3dc8c 100644 --- a/microsoft/surface/kernel/linux-5.10.2/default.nix +++ b/microsoft/surface/kernel/linux-5.10.19/default.nix @@ -1,10 +1,9 @@ { config, lib, pkgs, ... }: let repos = (pkgs.callPackage ../../repos.nix {}); - # TODO: Can I append the path ./patches instead of a string? patches = repos.linux-surface + "/patches"; surface_kernelPatches = [ - { name = "microsoft-surface-patches-linux-5.10.2"; + { name = "microsoft-surface-patches-linux-5.10.19"; patch = null; extraConfig = '' # @@ -44,8 +43,8 @@ let # # Cameras: IPU3 # - ## TODO: Fix for kernel 5.10.2: - ##VIDEO_IPU3_IMGU m + ## Not yet supported in the patches? + # VIDEO_IPU3_IMGU m VIDEO_IPU3_CIO2 m CIO2_BRIDGE y INT3472 m @@ -54,8 +53,13 @@ let # Cameras: Sensor drivers # VIDEO_OV5693 m - ## TODO: Fix for kernel 5.10.2: - ##VIDEO_OV8865 m + ## Not yet supported in the patches? + # VIDEO_OV8865 m + + # + # ALS Sensor for Surface Book 3, Surface Laptop 3, Surface Pro 7 + # + APDS9960 m # # Other Drivers @@ -101,12 +105,16 @@ let patch = patches + "/5.10/0008-surface-typecover.patch"; } { - name = "ms-surface/0009-cameras"; - patch = patches + "/5.10/0009-cameras.patch"; + name = "ms-surface/0009-surface-sensors"; + patch = patches + "/5.10/0009-surface-sensors.patch"; + } + { + name = "ms-surface/0010-cameras"; + patch = patches + "/5.10/0010-cameras.patch"; } ]; in (with pkgs; recurseIntoAttrs (linuxPackagesFor ( - callPackage ./linux-5.10.2.nix { + callPackage ./linux-5.10.19.nix { kernelPatches = surface_kernelPatches; } ))) diff --git a/microsoft/surface/kernel/linux-5.10.2/linux-5.10.2.nix b/microsoft/surface/kernel/linux-5.10.19/linux-5.10.19.nix similarity index 85% rename from microsoft/surface/kernel/linux-5.10.2/linux-5.10.2.nix rename to microsoft/surface/kernel/linux-5.10.19/linux-5.10.19.nix index 411a88d..04b97d2 100644 --- a/microsoft/surface/kernel/linux-5.10.2/linux-5.10.2.nix +++ b/microsoft/surface/kernel/linux-5.10.19/linux-5.10.19.nix @@ -3,7 +3,7 @@ with stdenv.lib; buildLinux (args // rec { - version = "5.10.2"; + version = "5.10.19"; # modDirVersion needs to be x.y.z, will automatically add .0 if needed modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg; @@ -13,6 +13,6 @@ buildLinux (args // rec { src = fetchurl { url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz"; - sha256 = "18l1ywp99inm90434fm74w8rjfl4yl974kfcpizg2sp2p8xf311v"; + sha256 = "1mml5a30ky0khzj3r6ahybycbbszk86agq62qclwq2kzvsqbprr7"; }; } // (args.argsOverride or {})) diff --git a/microsoft/surface/repos.nix b/microsoft/surface/repos.nix index 8642416..1f715b7 100644 --- a/microsoft/surface/repos.nix +++ b/microsoft/surface/repos.nix @@ -2,7 +2,7 @@ { linux-surface = fetchgit { url="https://github.com/linux-surface/linux-surface.git"; - rev="25ab2cf75e5eda5ab9739db1907300010c06dacf"; - sha256="0h8624d7ix1p6ysw9bllmnnwnv164z8xkx56zj3vdczn91vmqcf9"; + rev="f8fab978a480a4ed57e9ebb6928683b2e443c1c5"; + sha256="0zwybprwjckpapxm6gxzh6hwdd1w91g5sjxn6z52zlvvjpkmw959"; }; } From be4115ae23b52a6614a3e64c6d9e3667ae38dce4 Mon Sep 17 00:00:00 2001 From: mexisme Date: Sat, 6 Mar 2021 17:49:59 +1300 Subject: [PATCH 2/4] Update the module options --- microsoft/surface/kernel/linux-5.10.19/default.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/microsoft/surface/kernel/linux-5.10.19/default.nix b/microsoft/surface/kernel/linux-5.10.19/default.nix index ab3dc8c..25d6418 100644 --- a/microsoft/surface/kernel/linux-5.10.19/default.nix +++ b/microsoft/surface/kernel/linux-5.10.19/default.nix @@ -14,12 +14,17 @@ let SURFACE_AGGREGATOR_BUS y SURFACE_AGGREGATOR_CDEV m SURFACE_AGGREGATOR_REGISTRY m + SURFACE_ACPI_NOTIFY m - SURFACE_BATTERY m SURFACE_DTX m - SURFACE_HID m SURFACE_PERFMODE m + SURFACE_HID m + SURFACE_KBD m + + BATTERY_SURFACE m + CHARGER_SURFACE m + # # These built-in modules are required for the Surface Aggregator Module # See: https://github.com/linux-surface/surface-aggregator-module/wiki/Testing-and-Installing @@ -43,17 +48,15 @@ let # # Cameras: IPU3 # - ## Not yet supported in the patches? # VIDEO_IPU3_IMGU m VIDEO_IPU3_CIO2 m CIO2_BRIDGE y - INT3472 m + INTEL_SKL_INT3472 m # # Cameras: Sensor drivers # VIDEO_OV5693 m - ## Not yet supported in the patches? # VIDEO_OV8865 m # From 920bffdfbc8237f8f60f774bf807ff5549bd1d55 Mon Sep 17 00:00:00 2001 From: mexisme Date: Sat, 6 Mar 2021 17:58:57 +1300 Subject: [PATCH 3/4] Disable some modules that aren't yet fully supported by the patches --- microsoft/surface/kernel/linux-5.10.19/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/microsoft/surface/kernel/linux-5.10.19/default.nix b/microsoft/surface/kernel/linux-5.10.19/default.nix index 25d6418..e13e872 100644 --- a/microsoft/surface/kernel/linux-5.10.19/default.nix +++ b/microsoft/surface/kernel/linux-5.10.19/default.nix @@ -48,6 +48,7 @@ let # # Cameras: IPU3 # + ## Not yet supported in the patches # VIDEO_IPU3_IMGU m VIDEO_IPU3_CIO2 m CIO2_BRIDGE y @@ -57,6 +58,7 @@ let # Cameras: Sensor drivers # VIDEO_OV5693 m + ## Not yet supported in the patches # VIDEO_OV8865 m # From 94f7c2cb9cfef8ff04b4725bc3ad0ae64f844b19 Mon Sep 17 00:00:00 2001 From: mexisme Date: Sat, 6 Mar 2021 20:56:06 +1300 Subject: [PATCH 4/4] Mark as done --- microsoft/surface/TODO.org | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/microsoft/surface/TODO.org b/microsoft/surface/TODO.org index 125ec7d..6343451 100644 --- a/microsoft/surface/TODO.org +++ b/microsoft/surface/TODO.org @@ -6,7 +6,10 @@ ** CANCELLED Create a function for selecting preferred kernel ** DONE Fix how Keyboard & Trackpad are not being enabled on SL3 - https://github.com/linux-surface/surface-aggregator-module/wiki/Testing-and-Installing -** DOING Update to kernel 5.10.19 +** DONE Update to kernel 5.10.19 +:LOGBOOK: +- State "DONE" from "DOING" [2021-03-06 Sat 20:55] +:END: * Firmware ** DONE Remove old firmware binaries - Looks like the ath10k files aren't needed, any more