Repository navigation
Add Surface Laptop 8 board setup #16968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
birkskyum
merged 7 commits into
omacom:quattro
from
jdvmi00:surface/surface-laptop8-setup-20261028
Nov 11, 2026
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
cef37d5
Add Surface Laptop 8 board setup
jdvmi00 008da15
Test the Surface Laptop 8 setup's behaviour, not its lines
jdvmi00 2d17f15
Match the Surface Laptop 8 by its agreed board name
jdvmi00 6da3806
Put the Surface Laptop 8's DSP firmware from its new folder in the image
jdvmi00 e3ed1fa
Merge remote-tracking branch 'upstream/quattro' into surface/surface-…
jdvmi00 a64720a
Install the Surface Laptop 8's support package by its new name
jdvmi00 ae921fc
Set up the 15-inch Surface Laptop 8 too
jdvmi00 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # Microsoft Surface Laptop 8 (13.8-inch, Snapdragon X2 Elite) board-specific setup. | ||
|
|
||
| mkinitcpio_dir=${OMARCHY_SURFACE_LAPTOP8_MKINITCPIO_DIR:-/etc/mkinitcpio.conf.d} | ||
|
|
||
| if omarchy-hw-aarch64-qualcomm && omarchy-hw-match-device-tree microsoft,surface-laptop8; then | ||
| echo "Detected Microsoft Surface Laptop 8, applying board-specific support..." | ||
|
|
||
| # Bring up the panel and the keyboard before disk unlock. As in | ||
| # qualcomm/initramfs.sh, the ? skips a module a kernel does not have, so its | ||
| # image still builds. | ||
| # - msm needs the GPU and its clock and power controllers before the panel | ||
| # comes up, and none of these is a module dependency of it. | ||
| # - The display waits for the pmic_glink alternate-mode bridges and the USB4 | ||
| # host mux, which thunderbolt_qcom registers from linux-omarchy 7.3-5 (in | ||
| # thunderbolt before that); the panel waits for its PWM backlight. | ||
| # - pmic_glink runs on the SOCCP, which the boot firmware starts and | ||
| # qcom_q6v5_pas attaches to. Unlike the Surface Pro 11, the panel needs it, | ||
| # so it is listed here. firmware.sh's blacklist for a USB root disk still | ||
| # applies in the initramfs, so with the root disk on USB the panel has no | ||
| # pmic_glink at disk unlock. | ||
| # - The keyboard is a HID device behind the Surface Aggregator Module. | ||
| mkdir -p "$mkinitcpio_dir" | ||
| cat >"$mkinitcpio_dir/surface-laptop8-initramfs.conf" <<'CONF' | ||
| MODULES+=(msm? panel_edp? phy_qcom_edp? gpucc_glymur? gxclkctl_kaanapali? | ||
| qrtr? qcom_q6v5_pas? thunderbolt? thunderbolt_qcom? thunderbolt_platform? pmic_glink? pmic_glink_altmode? | ||
| ucsi_glink? leds_qcom_lpg? pwm_bl? surface_aggregator? surface_aggregator_registry? | ||
| surface_hid_core? surface_hid? nvme?) | ||
|
|
||
| # qcom_q6v5_pas starts the ADSP and CDSP from the initramfs and does not retry | ||
| # once the root filesystem is up, so their firmware, which qcom-firmware-extract | ||
| # copies from Windows, goes in the image too. msm requests the GPU's startup | ||
| # pair when the display starts but declares no firmware for this GPU. | ||
| # Search like the kernel does: each suffix in every directory, then the next. | ||
| for firmware in \ | ||
| qcom/gen80100_sqe.fw \ | ||
| qcom/gen80100_gmu.bin \ | ||
| qcom/glymur/microsoft/surface-laptop8/qcadsp8480.mbn \ | ||
| qcom/glymur/microsoft/surface-laptop8/adsp_dtbs.elf \ | ||
| qcom/glymur/microsoft/surface-laptop8/qccdsp8480.mbn \ | ||
| qcom/glymur/microsoft/surface-laptop8/cdsp_dtbs.elf; do | ||
| for suffix in '' .zst .xz; do | ||
| for directory in "${OMARCHY_SURFACE_LAPTOP8_FIRMWARE_ROOT:-/usr/lib/firmware}/updates" \ | ||
| "${OMARCHY_SURFACE_LAPTOP8_FIRMWARE_ROOT:-/usr/lib/firmware}"; do | ||
| if [[ -f $directory/$firmware$suffix ]]; then | ||
| FILES+=("$directory/$firmware$suffix") | ||
| break 2 | ||
| fi | ||
| done | ||
| done | ||
| done | ||
| unset firmware directory suffix | ||
| CONF | ||
|
|
||
| # Wi-Fi board data, audio, the device tree's hardware ID, sleep and touchpad. | ||
| omarchy-pkg-add surface-laptop-8-support | ||
|
|
||
| # USB4 docks: the router firmware is copied out of the Windows USB4 driver; | ||
| # thunderbolt_qcom declares it, so mkinitcpio adds it to the image. Without | ||
| # Windows on the disk it is not found and USB4 stays off. | ||
| surface-laptop8-usb4-firmware --no-rebuild || true | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh" | ||
|
|
||
| setup="$ROOT/install/hardware/microsoft/surface-laptop8.sh" | ||
| scratch=$(mktemp -d) | ||
| trap 'rm -rf "$scratch"' EXIT | ||
|
|
||
| bash -n "$setup" || fail "Surface Laptop 8 hardware script has valid syntax" | ||
| grep -Fxq 'run_logged "$OMARCHY_INSTALL/hardware/microsoft/surface-laptop8.sh"' "$ROOT/install/hardware/all.sh" || | ||
| fail "Surface Laptop 8 setup runs with the other hardware scripts" | ||
| # The installer is offline, so the ISO's mirror must carry what the setup adds. | ||
| grep -Fxq surface-laptop-8-support "$ROOT/install/omarchy-other.packages" || | ||
| fail "the ISO can supply surface-laptop-8-support offline" | ||
|
|
||
| require_platform_fixtures "the Surface Laptop 8 setup" | ||
|
|
||
| run_setup() ( | ||
| set -eE | ||
| local dir=$1 | ||
| PATH="$ROOT/bin:$PATH" | ||
| omarchy-hw-aarch64-qualcomm() { return 0; } | ||
| omarchy-pkg-add() { printf 'add %s\n' "$*" >>"$dir/packages.log"; } | ||
| surface-laptop8-usb4-firmware() { printf 'usb4 %s\n' "$*" >>"$dir/packages.log"; return 2; } | ||
|
|
||
| OMARCHY_PROC_ROOT="$dir/proc" \ | ||
| OMARCHY_SURFACE_LAPTOP8_MKINITCPIO_DIR="$dir/mkinitcpio.conf.d" \ | ||
| source "$setup" | ||
| ) | ||
|
|
||
| compatible() { | ||
| mkdir -p "$1/proc/device-tree" | ||
| printf '%b' "$2" >"$1/proc/device-tree/compatible" | ||
| } | ||
|
|
||
| matching="$scratch/matching" | ||
| compatible "$matching" 'microsoft,surface-laptop8\0qcom,mahua\0' | ||
| run_setup "$matching" >/dev/null | ||
| [[ $(<"$matching/packages.log") == $'add surface-laptop-8-support\nusb4 --no-rebuild' ]] || | ||
| fail "Surface Laptop 8 setup adds its hardware support, then copies the USB4 router firmware without stopping on failure" | ||
|
|
||
| ( | ||
| firmware_root="$scratch/firmware" | ||
| board=qcom/glymur/microsoft/surface-laptop8 | ||
| mkdir -p "$firmware_root/$board" "$firmware_root/updates/$board" | ||
| touch "$firmware_root/qcom/gen80100_sqe.fw.zst" "$firmware_root/qcom/gen80100_gmu.bin.xz" \ | ||
| "$firmware_root/$board/qcadsp8480.mbn" "$firmware_root/updates/$board/qcadsp8480.mbn" \ | ||
| "$firmware_root/updates/$board/adsp_dtbs.elf" "$firmware_root/updates/$board/qccdsp8480.mbn" \ | ||
| "$firmware_root/$board/cdsp_dtbs.elf" | ||
| MODULES=() FILES=() | ||
| OMARCHY_SURFACE_LAPTOP8_FIRMWARE_ROOT="$firmware_root" \ | ||
| source "$matching/mkinitcpio.conf.d/surface-laptop8-initramfs.conf" | ||
|
|
||
| for module in msm panel_edp gpucc_glymur qcom_q6v5_pas thunderbolt thunderbolt_qcom pmic_glink pmic_glink_altmode pwm_bl surface_hid nvme; do | ||
| [[ " ${MODULES[*]%\?} " == *" $module "* ]] || | ||
| fail "the Surface Laptop 8 initramfs loads $module before disk unlock" | ||
| done | ||
| for module in "${MODULES[@]}"; do | ||
| [[ $module == *\? ]] || fail "$module is optional, so a kernel without it still builds its image" | ||
| done | ||
|
|
||
| expected=( | ||
| "$firmware_root/qcom/gen80100_sqe.fw.zst" | ||
| "$firmware_root/qcom/gen80100_gmu.bin.xz" | ||
| "$firmware_root/updates/$board/qcadsp8480.mbn" | ||
| "$firmware_root/updates/$board/adsp_dtbs.elf" | ||
| "$firmware_root/updates/$board/qccdsp8480.mbn" | ||
| "$firmware_root/$board/cdsp_dtbs.elf" | ||
| ) | ||
| [[ ${FILES[*]} == "${expected[*]}" ]] || | ||
| fail "early firmware prefers extracted copies, accepts compressed packaged firmware and skips what is missing" | ||
| ) | ||
|
|
||
| other="$scratch/other" | ||
| compatible "$other" 'lenovo,yoga-slim7x\0qcom,x1e80100\0' | ||
| run_setup "$other" >/dev/null | ||
| [[ ! -e $other/packages.log && ! -e $other/mkinitcpio.conf.d ]] || | ||
| fail "other Snapdragon laptops are left alone" | ||
|
|
||
| pass "Surface Laptop 8 setup configures only this laptop" | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.