From 17ad09c30ce18c97c1d93bc500867ac0af6a930c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20W=C3=A5gberg?= Date: Fri, 12 Apr 2024 21:53:47 +0200 Subject: [PATCH] apple/t2: update to kernel 6.7.7 --- apple/t2/default.nix | 9 ------ .../t2/fix-keyboard-backlight-and-touchbar.sh | 28 ------------------- apple/t2/pkgs/linux-t2.nix | 13 +++++---- 3 files changed, 7 insertions(+), 43 deletions(-) delete mode 100755 apple/t2/fix-keyboard-backlight-and-touchbar.sh diff --git a/apple/t2/default.nix b/apple/t2/default.nix index 33658d6..cbdba9d 100644 --- a/apple/t2/default.nix +++ b/apple/t2/default.nix @@ -74,15 +74,6 @@ in # Make sure post-resume.service exists powerManagement.enable = true; - systemd.services.fix-keyboard-backlight-and-touchbar = { - path = [ pkgs.kmod ]; - serviceConfig.ExecStart = ''${pkgs.systemd}/bin/systemd-inhibit --what=sleep --why="fixing keyboard backlight and touchbar must finish before sleep" --mode=delay ${./fix-keyboard-backlight-and-touchbar.sh}''; - serviceConfig.Type = "oneshot"; - description = "reload touchbar driver and restart upower"; - wantedBy = [ "display-manager.service" "post-resume.target" ]; - after = [ "post-resume.target" ]; - }; - # Activation script to install apple-set-os-loader in order to unlock the iGPU system.activationScripts.appleSetOsLoader = lib.optionalString t2Cfg.enableAppleSetOsLoader '' if [[ -e /boot/efi/efi/boot/bootx64_original.efi ]]; then diff --git a/apple/t2/fix-keyboard-backlight-and-touchbar.sh b/apple/t2/fix-keyboard-backlight-and-touchbar.sh deleted file mode 100755 index c8c6a09..0000000 --- a/apple/t2/fix-keyboard-backlight-and-touchbar.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -set -eux - -unload () { - if modprobe -r "$1" 2>&1; - then echo ok - else echo fail - fi -} - -wait_unload() { - while sleep 1; do - output="$(unload "$1")" - case "$output" in - *is\ in\ use*) :;; - *ok*) return 0;; - *) echo "modprobe said: $output"; echo giving up; return 1; - esac - done -} - -wait_unload apple_touchbar -modprobe apple_touchbar - -# After suspend, the inode for the backlight device has changed. This service -# simply restarts upower to inform it of that change. -systemctl restart upower.service diff --git a/apple/t2/pkgs/linux-t2.nix b/apple/t2/pkgs/linux-t2.nix index 40371fe..1838fb9 100644 --- a/apple/t2/pkgs/linux-t2.nix +++ b/apple/t2/pkgs/linux-t2.nix @@ -5,11 +5,11 @@ let patchRepo = fetchFromGitHub { owner = "t2linux"; repo = "linux-t2-patches"; - rev = "46dd873d1d9d12b26916790045008a91a95d0c11"; - hash = "sha256-YGUGuzsAJFtZYjIW9d2XU4eGKNvMKCaWXqgqJn5TdeY="; + rev = "7cd298e227e95bac9a704ffc8f5ff5e89a1bf4d7"; + hash = "sha256-Oi3CwQl0IwdVc9w+pbmJjBnyqwLFhbqFwxs5o0mqtbE="; }; - version = "6.5"; + version = "6.7.7"; majorVersion = with lib; (elemAt (take 1 (splitVersion version)) 0); in buildLinux (args // { @@ -22,7 +22,7 @@ buildLinux (args // { src = runCommand "patched-source" {} '' cp -r ${fetchzip { url = "mirror://kernel/linux/kernel/v${majorVersion}.x/linux-${version}.tar.xz"; - hash = "sha256-qJmVSju69WcvDIbgrbtMyCi+OXUNTzNX2G+/0zwsPR4="; + hash = "sha256-j+Ufl6C1Mqjthk18GPt2e7j+i7viauOgNnVy9dJSgaM="; }} $out chmod -R u+w $out cd $out @@ -40,10 +40,11 @@ buildLinux (args // { BT_HCIBCM4377 = module; BT_HCIUART_BCM = yes; BT_HCIUART = module; - HID_APPLE_IBRIDGE = module; + HID_APPLETB_BL = module; + HID_APPLETB_KBD = module; HID_APPLE = module; + DRM_APPLETBDRM = module; HID_APPLE_MAGIC_BACKLIGHT = module; - HID_APPLE_TOUCHBAR = module; HID_SENSOR_ALS = module; SND_PCM = module; STAGING = yes;