aboutsummaryrefslogtreecommitdiffci
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
-rw-r--r--fixups/0003-hid-surfacego2-fix-touchcover.patch.sed24
-rw-r--r--kernel-surface.spec1
-rwxr-xr-xmake-sources.sh20
3 files changed, 45 insertions, 0 deletions
diff --git a/fixups/0003-hid-surfacego2-fix-touchcover.patch.sed b/fixups/0003-hid-surfacego2-fix-touchcover.patch.sed
new file mode 100644
index 0000000..72e8ca8
--- /dev/null
+++ b/fixups/0003-hid-surfacego2-fix-touchcover.patch.sed
@@ -0,0 +1,24 @@
+# Stable backports since then collide with the patch:
+# - 7.2.9 "HID: multitouch: Add report ID mismatch quirk for ASUS ROG Z13
+# Folio" took MT_QUIRK BIT(26) and class IDs 0x0115-0x0117, so
+# MT_QUIRK_HAS_TYPE_COVER_BACKLIGHT becomes BIT(27) (with the new quirk
+# as context) and MT_CLS_WIN_8_MS_SURFACE_TYPE_COVER becomes 0x0118 (with
+# the three new classes as context, dropping the now-stale RAZER/SMART
+# context lines).
+# - 7.2.10 "HID: multitouch: stop the release timer from being rearmed on
+# remove" renamed timer_delete_sync -> timer_shutdown_sync in mt_remove.
+
+# hunk 3: stale count 12/15 -> 14/17, BIT(26) collision -> BIT(27)
+s/^@@ -78,12 +78,15 @@/@@ -78,14 +78,17 @@/
+s/^ #define MT_QUIRK_KEEP_LATENCY_ON_CLOSE\tBIT(25)$/&\n #define MT_QUIRK_IGNORE_FEATURE_ID_MISMATCH\tBIT(26)/
+s/^+#define MT_QUIRK_HAS_TYPE_COVER_BACKLIGHT\tBIT(26)$/+#define MT_QUIRK_HAS_TYPE_COVER_BACKLIGHT\tBIT(27)/
+
+# hunk 5: class id 0x0115 taken -> 0x0118, context updated to 7.2.15
+s/^@@ -212,6 +221,7 @@/@@ -212,7 +221,8 @@/
+/^ #define MT_CLS_RAZER_BLADE_STEALTH\t\t0x0112$/d
+/^ #define MT_CLS_SMART_TECH\t\t\t0x0113$/d
+s/^ #define MT_CLS_APPLE_TOUCHBAR\t\t\t0x0114$/&\n #define MT_CLS_YOGABOOK9I\t\t\t0x0115\n #define MT_CLS_EGALAX_P80H84\t\t\t0x0116\n #define MT_CLS_ASUS_ROG_Z13_FOLIO\t\t0x0117/
+s/^+#define MT_CLS_WIN_8_MS_SURFACE_TYPE_COVER\t0x0115$/+#define MT_CLS_WIN_8_MS_SURFACE_TYPE_COVER\t0x0118/
+
+# hunk 11: 7.2.10 rename in mt_remove
+s/timer_delete_sync(&td->release_timer)/timer_shutdown_sync(\&td->release_timer)/
diff --git a/kernel-surface.spec b/kernel-surface.spec
index dc59df4..ae04e3b 100644
--- a/kernel-surface.spec
+++ b/kernel-surface.spec
@@ -250,6 +250,7 @@ fi
%changelog
* Wed Nov 04 2026 Saya Andy 7.2.15-1
- Update Linux kernel from 7.2.8 to 7.2.15
+- Repair the overlay Type Cover patch with fixup
* Sun Sep 27 2026 Saya Andy 7.2.8-1
- Update Linux kernel from 7.2.6 to 7.2.8
diff --git a/make-sources.sh b/make-sources.sh
index 5c11ee2..53e213a 100755
--- a/make-sources.sh
+++ b/make-sources.sh
@@ -130,6 +130,26 @@ while read -r dir; do
total=$((total + count))
done < "${order_file}"
+# fixups/<patch>.sed is applied to the staged copy of that overlay patch.
+shopt -s nullglob
+for fixup in "${script_dir}"/fixups/*.sed; do
+ fixup_name=${fixup##*/}
+ target=${fixup_name%.sed}
+ staged=$(find "${staging}/patches" -type f -name "${target}" -print -quit)
+ if [[ -z ${staged} ]]; then
+ echo "ERROR: fixups/${fixup_name} matches no staged patch; delete it" >&2
+ exit 1
+ fi
+ sed -f "${fixup}" "${staged}" > "${staging}/.fixed.patch"
+ if cmp -s "${staged}" "${staging}/.fixed.patch"; then
+ echo "ERROR: fixups/${fixup_name} changed nothing (overlay patch repaired?); delete it" >&2
+ exit 1
+ fi
+ mv "${staging}/.fixed.patch" "${staged}"
+ echo " fixup applied: ${target}"
+done
+shopt -u nullglob
+
tarball="${output_dir}/kernel-surface-patches-${upstream_ver}-${patchset_ver}.tar.gz"
# COPYFILE_DISABLE stops macOS tar from adding ._ AppleDouble members, which
# would show up as bogus patch files in the spec's glob.