From be5b9c91acaebe1e17d582a1f364995dadcc339d Mon Sep 17 00:00:00 2001 From: mexisme Date: Tue, 2 Feb 2021 23:57:54 +1300 Subject: [PATCH] Add kernel 5.10.10 --- .../surface/kernel/linux-5.10.10/default.nix | 127 ++++++++++++++++++ .../kernel/linux-5.10.10/linux-5.10.10.nix | 18 +++ 2 files changed, 145 insertions(+) create mode 100644 microsoft/surface/kernel/linux-5.10.10/default.nix create mode 100644 microsoft/surface/kernel/linux-5.10.10/linux-5.10.10.nix diff --git a/microsoft/surface/kernel/linux-5.10.10/default.nix b/microsoft/surface/kernel/linux-5.10.10/default.nix new file mode 100644 index 0000000..df1fa05 --- /dev/null +++ b/microsoft/surface/kernel/linux-5.10.10/default.nix @@ -0,0 +1,127 @@ +{ 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.10"; + patch = null; + extraConfig = '' + # + # Surface Aggregator Module + # + SURFACE_AGGREGATOR m + SURFACE_AGGREGATOR_ERROR_INJECTION n + 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 + + # + # These built-in modules are required for the Surface Aggregator Module + # See: https://github.com/linux-surface/surface-aggregator-module/wiki/Testing-and-Installing + # + SERIAL_DEV_BUS y + SERIAL_DEV_CTRL_TTYPORT y + + # + # Surface Hotplug + # + SURFACE_HOTPLUG m + + # + # IPTS touchscreen + # + # This only enables the user interface for IPTS data. + # For the touchscreen to work, you need to install iptsd. + # + MISC_IPTS m + + # + # Cameras: IPU3 + # + VIDEO_IPU3_IMGU m + VIDEO_IPU3_CIO2 m + CIO2_BRIDGE y + INT3472 m + + # + # Cameras: Sensor drivers + # + VIDEO_OV5693 m + VIDEO_OV8865 m + + # + # ALS Sensor for Surface Book 3, Surface Laptop 3, Surface Pro 7 + # + APDS9960 m + + # + # Other Drivers + # + INPUT_SOC_BUTTON_ARRAY m + SURFACE_3_BUTTON m + SURFACE_3_POWER_OPREGION m + SURFACE_PRO3_BUTTON m + SURFACE_GPE m + SURFACE_BOOK1_DGPU_SWITCH m + ''; + } + { + name = "ms-surface/0001-surface3-oemb"; + patch = patches + "/5.10/0001-surface3-oemb.patch"; + } + { + name = "ms-surface/0002-wifi"; + patch = patches + "/5.10/0002-wifi.patch"; + } + { + name = "ms-surface/0003-ipts"; + patch = patches + "/5.10/0003-ipts.patch"; + } + { + name = "ms-surface/0004-surface-gpe"; + patch = patches + "/5.10/0004-surface-gpe.patch"; + } + { + name = "ms-surface/0005-surface-sam-over-hid"; + patch = patches + "/5.10/0005-surface-sam-over-hid.patch"; + } + { + name = "ms-surface/0006-surface-sam"; + patch = patches + "/5.10/0006-surface-sam.patch"; + } + { + name = "ms-surface/0007-surface-hotplug"; + patch = patches + "/5.10/0007-surface-hotplug.patch"; + } + { + name = "ms-surface/0008-surface-typecover"; + patch = patches + "/5.10/0008-surface-typecover.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.10.nix { + kernelPatches = surface_kernelPatches; + ## Have to use "ignoreConfigErrors" to get past the following unused options in 5.10.10: + # DEBUG_STACKOVERFLOW n + # EXT4_ENCRYPTION n + # F2FS_FS_ENCRYPTION n + # INT3472 n + # KEXEC_FILE n + # RCU_PERF_TEST n + ignoreConfigErrors = true; + } + ))) diff --git a/microsoft/surface/kernel/linux-5.10.10/linux-5.10.10.nix b/microsoft/surface/kernel/linux-5.10.10/linux-5.10.10.nix new file mode 100644 index 0000000..c25fce3 --- /dev/null +++ b/microsoft/surface/kernel/linux-5.10.10/linux-5.10.10.nix @@ -0,0 +1,18 @@ +{ stdenv, buildPackages, fetchurl, perl, buildLinux, modDirVersionArg ? null, ... } @ args: + +with stdenv.lib; + +buildLinux (args // rec { + version = "5.10.10"; + + # 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; + + # branchVersion needs to be x.y + extraMeta.branch = versions.majorMinor version; + + src = fetchurl { + url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz"; + sha256 = "06fvgkrn9127xw9kly6l4ws3yv80q8xfqdzaam92lljim5pqdvb0"; + }; +} // (args.argsOverride or {}))