From 5d482f422346cc59ab6c4bf92a542c3705e098df Mon Sep 17 00:00:00 2001 From: corning-croak-cable Date: Sat, 9 May 2026 00:59:59 -0700 Subject: [PATCH 1/9] surface: add main profile config --- mkosi.profiles/surface/mkosi.conf | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 mkosi.profiles/surface/mkosi.conf diff --git a/mkosi.profiles/surface/mkosi.conf b/mkosi.profiles/surface/mkosi.conf new file mode 100644 index 00000000..caf7cebc --- /dev/null +++ b/mkosi.profiles/surface/mkosi.conf @@ -0,0 +1,29 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# Surface profile - Microsoft Surface Pro / Surface Laptop (standard UEFI x86-64) +# Activate with: mkosi --profile surface + +[Content] +Packages= + iptsd + libwacom + thermald + iw + intel-media-driver + libva-intel-driver + alsa-firmware + sof-firmware + powertop + +# Disable Panel Self Refresh (fixes screen flicker on many Surface models) +# Enable deep sleep where supported; fall back to s2idle +# Fix lid detection on some models +KernelCommandLine= + i915.enable_psr=0 + mem_sleep_default=deep + button.lid_init_state=open + acpi_backlight=native + +# DRM modules needed for Surface display pipeline +KernelInitrdModules=/drivers/gpu/drm + /drivers/hid/hid-multitouch.ko + /drivers/hid/hid-generic.ko From ec45e2341d638a2e534d3eac21cfd4d8a702b424 Mon Sep 17 00:00:00 2001 From: corning-croak-cable Date: Sat, 9 May 2026 01:00:01 -0700 Subject: [PATCH 2/9] surface: add fedora distro config (linux-surface COPR) --- .../surface/mkosi.conf.d/fedora/mkosi.conf | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 mkosi.profiles/surface/mkosi.conf.d/fedora/mkosi.conf diff --git a/mkosi.profiles/surface/mkosi.conf.d/fedora/mkosi.conf b/mkosi.profiles/surface/mkosi.conf.d/fedora/mkosi.conf new file mode 100644 index 00000000..9957d127 --- /dev/null +++ b/mkosi.profiles/surface/mkosi.conf.d/fedora/mkosi.conf @@ -0,0 +1,22 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# Fedora surface config - pulls in the linux-surface kernel and iptsd from COPR + +[Content] +Repositories= + id:linux-surface + url:https://pkg.surfacelinux.com/fedora/linux-surface.repo + +Packages= + kernel-surface + iptsd + libwacom-surface + surface-control + +# The surface kernel replaces the stock kernel; remove the base one to avoid +# having two boot entries on the ESP. +RemovePackages= + kernel + kernel-core + kernel-modules + kernel-modules-core + kernel-modules-extra From 38768869c54bb3e7f700bb526dca23ce8e4f7e2d Mon Sep 17 00:00:00 2001 From: corning-croak-cable Date: Sat, 9 May 2026 01:00:01 -0700 Subject: [PATCH 3/9] surface: add debian distro config (linux-surface repo) --- .../surface/mkosi.conf.d/debian/mkosi.conf | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 mkosi.profiles/surface/mkosi.conf.d/debian/mkosi.conf diff --git a/mkosi.profiles/surface/mkosi.conf.d/debian/mkosi.conf b/mkosi.profiles/surface/mkosi.conf.d/debian/mkosi.conf new file mode 100644 index 00000000..490060e2 --- /dev/null +++ b/mkosi.profiles/surface/mkosi.conf.d/debian/mkosi.conf @@ -0,0 +1,22 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# Debian surface config - uses the linux-surface apt repo for the patched kernel + +[Content] +Repositories= + id:linux-surface + url:https://pkg.surfacelinux.com/debian/linux-surface.list + Architectures:amd64 + SignedBy=/usr/share/keyrings/linux-surface.gpg + +Packages= + linux-image-surface + linux-headers-surface + iptsd + libwacom + firmware-iwlwifi + firmware-intel-sound + +# Drop the generic kernel in favour of the surface one +RemovePackages= + linux-image-amd64 + linux-image-generic From 13a64a6da0d2c9fcae3d4de375e8fb8a62574a91 Mon Sep 17 00:00:00 2001 From: corning-croak-cable Date: Sat, 9 May 2026 01:00:02 -0700 Subject: [PATCH 4/9] surface: add arch distro config (linux-surface repo) --- .../surface/mkosi.conf.d/arch/mkosi.conf | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 mkosi.profiles/surface/mkosi.conf.d/arch/mkosi.conf diff --git a/mkosi.profiles/surface/mkosi.conf.d/arch/mkosi.conf b/mkosi.profiles/surface/mkosi.conf.d/arch/mkosi.conf new file mode 100644 index 00000000..7ee582b5 --- /dev/null +++ b/mkosi.profiles/surface/mkosi.conf.d/arch/mkosi.conf @@ -0,0 +1,18 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# Arch surface config - linux-surface from the linux-surface pacman repo + +[Content] +Repositories= + id:linux-surface + url:https://pkg.surfacelinux.com/arch/linux-surface.repo + +Packages= + linux-surface + linux-surface-headers + iptsd + libwacom + surface-control + +RemovePackages= + linux + linux-headers From 69d4587ecc527e48360b98a653cc5dec720e5397 Mon Sep 17 00:00:00 2001 From: corning-croak-cable Date: Sat, 9 May 2026 01:00:03 -0700 Subject: [PATCH 5/9] surface: add modprobe options for Surface hardware --- .../mkosi.extra/usr/lib/modprobe.d/surface.conf | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 mkosi.profiles/surface/mkosi.extra/usr/lib/modprobe.d/surface.conf diff --git a/mkosi.profiles/surface/mkosi.extra/usr/lib/modprobe.d/surface.conf b/mkosi.profiles/surface/mkosi.extra/usr/lib/modprobe.d/surface.conf new file mode 100644 index 00000000..d11b65f7 --- /dev/null +++ b/mkosi.profiles/surface/mkosi.extra/usr/lib/modprobe.d/surface.conf @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# Kernel module options tuned for Microsoft Surface hardware + +# Reduce USB polling latency for the Type Cover keyboard/trackpad +options usbhid mousepoll=1 + +# Enable ACPI platform profile support (for surface-control performance modes) +options platform_profile enabled=1 + +# Disable PC speaker (no hardware speaker on Surface) +blacklist pcspkr +blacklist snd_pcsp From ae1444e8454d5e162265bba8594689d3ad1aaa46 Mon Sep 17 00:00:00 2001 From: corning-croak-cable Date: Sat, 9 May 2026 01:00:04 -0700 Subject: [PATCH 6/9] surface: add udev rule to enable Type Cover wakeup --- .../usr/lib/udev/rules.d/99-surface-typecover.rules | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 mkosi.profiles/surface/mkosi.extra/usr/lib/udev/rules.d/99-surface-typecover.rules diff --git a/mkosi.profiles/surface/mkosi.extra/usr/lib/udev/rules.d/99-surface-typecover.rules b/mkosi.profiles/surface/mkosi.extra/usr/lib/udev/rules.d/99-surface-typecover.rules new file mode 100644 index 00000000..0bc0edf4 --- /dev/null +++ b/mkosi.profiles/surface/mkosi.extra/usr/lib/udev/rules.d/99-surface-typecover.rules @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# Enable wakeup from suspend via the Surface Type Cover +ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{power/wakeup}=="disabled", ATTR{power/wakeup}="enabled" From 4067c28297eb2219f1cc1b4850a0aa1d5d06b64b Mon Sep 17 00:00:00 2001 From: corning-croak-cable Date: Sat, 9 May 2026 01:00:05 -0700 Subject: [PATCH 7/9] surface: add iptsd touch daemon config --- mkosi.profiles/surface/mkosi.extra/etc/iptsd.conf | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 mkosi.profiles/surface/mkosi.extra/etc/iptsd.conf diff --git a/mkosi.profiles/surface/mkosi.extra/etc/iptsd.conf b/mkosi.profiles/surface/mkosi.extra/etc/iptsd.conf new file mode 100644 index 00000000..494373ff --- /dev/null +++ b/mkosi.profiles/surface/mkosi.extra/etc/iptsd.conf @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# iptsd configuration for Surface touchscreen / pen daemon +# See: https://github.com/linux-surface/iptsd + +[Touch] +DisableOnStylus = false + +[Stylus] +DisableTouch = false From 43327d06705218600286eae9b1264a55a216f465 Mon Sep 17 00:00:00 2001 From: corning-croak-cable Date: Sat, 9 May 2026 01:00:06 -0700 Subject: [PATCH 8/9] surface: add systemd sleep config for Surface power management --- .../mkosi.extra/usr/lib/systemd/sleep.conf.d/surface.conf | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 mkosi.profiles/surface/mkosi.extra/usr/lib/systemd/sleep.conf.d/surface.conf diff --git a/mkosi.profiles/surface/mkosi.extra/usr/lib/systemd/sleep.conf.d/surface.conf b/mkosi.profiles/surface/mkosi.extra/usr/lib/systemd/sleep.conf.d/surface.conf new file mode 100644 index 00000000..15b355dc --- /dev/null +++ b/mkosi.profiles/surface/mkosi.extra/usr/lib/systemd/sleep.conf.d/surface.conf @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# Prefer S3 (deep) sleep on Surface; fall back to s2idle if unavailable +[Sleep] +SuspendState=mem standby freeze +HibernateMode=shutdown From ce4470fd6ff973cfe3e499384e3da21cda461fa2 Mon Sep 17 00:00:00 2001 From: corning-croak-cable Date: Sat, 9 May 2026 01:00:07 -0700 Subject: [PATCH 9/9] surface: add README for Surface profile --- mkosi.profiles/surface/README.md | 49 ++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 mkosi.profiles/surface/README.md diff --git a/mkosi.profiles/surface/README.md b/mkosi.profiles/surface/README.md new file mode 100644 index 00000000..4a7b47fc --- /dev/null +++ b/mkosi.profiles/surface/README.md @@ -0,0 +1,49 @@ +# Surface Profile + +Builds ParticleOS for Microsoft Surface Pro and Surface Laptop devices on +standard x86-64 UEFI firmware (no custom bootloader required). + +## What it adds + +| Layer | Details | +|---|---| +| Kernel | Replaces the stock distro kernel with the linux-surface patched kernel (touch / Type Cover / pen / camera fixes) | +| Touch daemon | iptsd - processes IPTS touch/pen frames from the firmware | +| Firmware | SOF audio firmware, Intel WiFi firmware, Surface-specific libwacom database | +| Power | Deep sleep preference, lid-state fix, PSR disabled (prevents flicker) | +| Type Cover | udev wakeup rule so suspend/resume works with the keyboard | + +## Build + +```sh +# Fedora base (recommended - best Surface kernel COPR coverage) +mkosi --profile obs-repos --profile desktop --profile gnome --profile surface build + +# Debian base +mkosi --distribution debian --profile desktop --profile gnome --profile surface build +``` + +## Installing on a Surface + +1. Boot the generated disk image from USB (or write it directly to the NVMe). +2. Secure Boot: either enroll the ParticleOS certificate in the Surface UEFI, + or disable Secure Boot temporarily in **Surface UEFI -> Security -> Secure Boot**. +3. The image uses **systemd-boot** as the EFI bootloader - it registers itself + with the UEFI boot manager automatically; no manual EFI entry needed. +4. First boot runs `preset-global` to enable all default services. + +## Supported models + +Tested targets (linux-surface patch coverage): + +- Surface Pro 7, 7+, 8, 9, 10 +- Surface Laptop 3, 4, 5, 6 +- Surface Go 2, 3 +- Surface Pro X (ARM - not covered by this x86 profile) + +## Known limitations + +- **Camera**: MIPI cameras on Pro 9/10 and Laptop 5/6 are not fully supported + in mainline yet; frames may be unavailable until IPU6 support lands. +- **Secure Boot**: custom key enrollment into Surface UEFI is possible but not + automated by this profile yet.