From 45d2e807db5c4c4bde14d1c0b28e8cc3e57d5c68 Mon Sep 17 00:00:00 2001 From: Spencer Bull Date: Thu, 1 Oct 2026 23:00:51 -0500 Subject: [PATCH] Install the Dell XPS 13 Panther Lake speaker firmware Explicitly select the Omarchy Cirrus firmware when the installed package predates the 1028:0e54 aliases. Apply it during hardware setup and through an update migration, and request a reboot for each user until the firmware can load. Require the same minimum version in the offline package list so newer Arch snapshots keep their genuine firmware. Co-Authored-By: GPT-6.1-Sol --- bin/omarchy-hw-dell-xps13-dx13260-ptl | 5 + install/hardware/all.sh | 1 + .../dell-xps13-ptl-speaker-firmware.sh | 12 ++ install/omarchy-other.packages | 2 + migrations/1790904845.sh | 11 ++ test/shell.d/xps13-ptl-firmware-test.sh | 181 ++++++++++++++++++ 6 files changed, 212 insertions(+) create mode 100755 bin/omarchy-hw-dell-xps13-dx13260-ptl create mode 100644 install/hardware/dell-xps13-ptl-speaker-firmware.sh create mode 100644 migrations/1790904845.sh create mode 100755 test/shell.d/xps13-ptl-firmware-test.sh diff --git a/bin/omarchy-hw-dell-xps13-dx13260-ptl b/bin/omarchy-hw-dell-xps13-dx13260-ptl new file mode 100755 index 00000000..18c063b0 --- /dev/null +++ b/bin/omarchy-hw-dell-xps13-dx13260-ptl @@ -0,0 +1,5 @@ +#!/bin/bash + +# omarchy:summary=Match the Dell XPS 13 DX13260 with an Intel Panther Lake GPU. + +omarchy-hw-match "DX13260" && omarchy-hw-intel-ptl diff --git a/install/hardware/all.sh b/install/hardware/all.sh index 12add110..92f3fdea 100644 --- a/install/hardware/all.sh +++ b/install/hardware/all.sh @@ -18,6 +18,7 @@ run_logged "$OMARCHY_INSTALL/hardware/intel/ipu7-camera.sh" run_logged "$OMARCHY_INSTALL/hardware/intel/fred.sh" run_logged "$OMARCHY_INSTALL/hardware/intel/fix-wifi7-eht.sh" run_logged "$OMARCHY_INSTALL/hardware/intel/sof-firmware.sh" +run_logged "$OMARCHY_INSTALL/hardware/dell-xps13-ptl-speaker-firmware.sh" run_logged "$OMARCHY_INSTALL/hardware/fix-elgato-camlink-4k.sh" diff --git a/install/hardware/dell-xps13-ptl-speaker-firmware.sh b/install/hardware/dell-xps13-ptl-speaker-firmware.sh new file mode 100644 index 00000000..f36bceab --- /dev/null +++ b/install/hardware/dell-xps13-ptl-speaker-firmware.sh @@ -0,0 +1,12 @@ +if omarchy-hw-dell-xps13-dx13260-ptl; then + cirrus_package=$(pacman -Q linux-firmware-cirrus 2>/dev/null || true) + + # Keep newer Arch firmware when stable's snapshot supersedes the shim. + if [[ -z $cirrus_package ]] || (( $(vercmp "${cirrus_package#* }" "20260810-3") < 0 )); then + firmware_pending="${OMARCHY_XPS13_FIRMWARE_PENDING:-/run/omarchy/xps13-ptl-speaker-firmware}" + sudo install -Dm644 /dev/null "$firmware_pending" + + # [core] precedes [omarchy], so an unqualified target selects the older firmware. + sudo pacman -S --noconfirm --needed omarchy/linux-firmware-cirrus + fi +fi diff --git a/install/omarchy-other.packages b/install/omarchy-other.packages index ee7607a7..65abbbe2 100644 --- a/install/omarchy-other.packages +++ b/install/omarchy-other.packages @@ -59,6 +59,8 @@ linux-firmware-marvell # Dell laptop support packages dell-xps-touchpad-haptics dell-xps13-sidecar-amps +# Select the stable-snapshot shim or newer Arch firmware for the XPS 13 PTL. +linux-firmware-cirrus>=20260810-3 # Speaker tunings (LV2 limiter every tuning ends in) lsp-plugins-lv2 diff --git a/migrations/1790904845.sh b/migrations/1790904845.sh new file mode 100644 index 00000000..0f376be3 --- /dev/null +++ b/migrations/1790904845.sh @@ -0,0 +1,11 @@ +echo "Install the Dell XPS 13 Panther Lake speaker firmware" + +if omarchy-hw-dell-xps13-dx13260-ptl; then + source "$OMARCHY_PATH/install/hardware/dell-xps13-ptl-speaker-firmware.sh" + + # The marker lasts until reboot so every user migrating beforehand is prompted. + firmware_pending="${OMARCHY_XPS13_FIRMWARE_PENDING:-/run/omarchy/xps13-ptl-speaker-firmware}" + if [[ -e $firmware_pending ]]; then + omarchy-state set reboot-required + fi +fi diff --git a/test/shell.d/xps13-ptl-firmware-test.sh b/test/shell.d/xps13-ptl-firmware-test.sh new file mode 100755 index 00000000..3d754160 --- /dev/null +++ b/test/shell.d/xps13-ptl-firmware-test.sh @@ -0,0 +1,181 @@ +#!/bin/bash + +set -euo pipefail + +source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh" + +leaf="$ROOT/install/hardware/dell-xps13-ptl-speaker-firmware.sh" +migration="$ROOT/migrations/1790904845.sh" + +grep -q 'run_logged .*hardware/dell-xps13-ptl-speaker-firmware.sh' "$ROOT/install/hardware/all.sh" || + fail "hardware setup installs the Panther Lake XPS 13 firmware" +pass "hardware setup installs the Panther Lake XPS 13 firmware" + +require_command vercmp +require_command pacman +real_pacman=$(command -v pacman) +test_tmp=$(mktemp -d) +trap 'rm -rf "$test_tmp"' EXIT +mkdir -p "$test_tmp/bin" + +firmware_target=$(grep -E '^(omarchy/)?linux-firmware-cirrus' "$ROOT/install/omarchy-other.packages") +mkdir -p "$test_tmp/db/local" "$test_tmp/db/sync" "$test_tmp/package" +cat >"$test_tmp/pacman.conf" <<'CONF' +[options] +Architecture = x86_64 +SigLevel = Never +[core] +Server = https://example.invalid/core +[omarchy] +Server = https://example.invalid/omarchy +CONF + +write_repo() { + local repo="$1" version="$2" + local entry="linux-firmware-cirrus-$version" + mkdir -p "$test_tmp/package/$entry" + cat >"$test_tmp/package/$entry/desc" <"$test_tmp/bin/omarchy-hw-match" <<'SH' +#!/bin/bash +[[ $TEST_PRODUCT_NAME == *"$1"* ]] +SH +cat >"$test_tmp/bin/omarchy-hw-intel-ptl" <<'SH' +#!/bin/bash +[[ $TEST_INTEL_PTL == "1" ]] +SH +cat >"$test_tmp/bin/sudo" <<'SH' +#!/bin/bash +exec "$@" +SH +cat >"$test_tmp/bin/pacman" <<'SH' +#!/bin/bash +if [[ $1 == "-Q" ]]; then + [[ -s $TEST_VERSION_FILE ]] || exit 1 + printf 'linux-firmware-cirrus %s\n' "$(<"$TEST_VERSION_FILE")" +else + printf 'pacman %s\n' "$*" >>"$TEST_LOG" + [[ $* == "-S --noconfirm --needed omarchy/linux-firmware-cirrus" ]] || exit 1 + [[ ${TEST_INSTALL_FAILURE:-0} == "0" ]] || exit 1 + printf '20260810-3\n' >"$TEST_VERSION_FILE" +fi +SH +cat >"$test_tmp/bin/omarchy-state" <<'SH' +#!/bin/bash +printf 'state %s\n' "$*" >>"$TEST_LOG" +SH +chmod +x "$test_tmp/bin/"* + +export PATH="$test_tmp/bin:$ROOT/bin:$PATH" +export OMARCHY_PATH="$ROOT" TEST_LOG="$test_tmp/calls" TEST_VERSION_FILE="$test_tmp/version" +export OMARCHY_XPS13_FIRMWARE_PENDING="$test_tmp/run/pending" +export TEST_PRODUCT_NAME="XPS 13 DX13260" TEST_INTEL_PTL=1 +install_call="pacman -S --noconfirm --needed omarchy/linux-firmware-cirrus" + +reset_fixture() { + : >"$TEST_LOG" + printf '%s' "$1" >"$TEST_VERSION_FILE" + rm -f "$OMARCHY_XPS13_FIRMWARE_PENDING" +} + +run_leaf() { + bash -eE -c 'source "$1"' bash "$leaf" +} + +run_migration() { + bash -euo pipefail "$migration" >/dev/null +} + +for model in "XPS 9350" "XPS 13 DX13261"; do + reset_fixture "20260810-2" + TEST_PRODUCT_NAME="$model" run_leaf + TEST_PRODUCT_NAME="$model" run_migration + [[ ! -s $TEST_LOG && ! -e $OMARCHY_XPS13_FIRMWARE_PENDING ]] || fail "other models receive no firmware repair" +done +reset_fixture "20260810-2" +TEST_INTEL_PTL=0 run_leaf +TEST_INTEL_PTL=0 run_migration +[[ ! -s $TEST_LOG && ! -e $OMARCHY_XPS13_FIRMWARE_PENDING ]] || fail "the Wildcat Lake variant receives no firmware repair" +pass "other models and the Wildcat Lake variant receive no firmware repair" + +for version in "" "20260810-2"; do + reset_fixture "$version" + run_leaf || fail "missing or old firmware is installed during hardware setup" + [[ $(<"$TEST_LOG") == "$install_call" && $(<"$TEST_VERSION_FILE") == "20260810-3" ]] || + fail "hardware setup explicitly selects the Omarchy firmware" + [[ -e $OMARCHY_XPS13_FIRMWARE_PENDING ]] || fail "the firmware repair records its pending reboot" +done +pass "hardware setup explicitly installs the Omarchy firmware when missing or old" + +for version in "20260810-3" "20260810-4" "20260910-2" "1:20260810-2"; do + reset_fixture "$version" + run_leaf + run_migration + [[ ! -s $TEST_LOG && ! -e $OMARCHY_XPS13_FIRMWARE_PENDING && $(<"$TEST_VERSION_FILE") == "$version" ]] || + fail "sufficient or newer firmware is preserved without a reboot request" +done +pass "sufficient or newer firmware is preserved without a reboot request" + +reset_fixture "20260810-2" +if TEST_INSTALL_FAILURE=1 run_migration; then + fail "a failed firmware installation fails the migration" +fi +[[ $(<"$TEST_LOG") == "$install_call" && $(<"$TEST_VERSION_FILE") == "20260810-2" ]] || + fail "a failed installation leaves the migration retryable without claiming success" +pass "a failed firmware installation fails the migration and remains retryable" + +: >"$TEST_LOG" +run_migration +[[ $(<"$TEST_LOG") == "$install_call"$'\nstate set reboot-required' ]] || + fail "retrying the migration installs the firmware and requests a reboot" +pass "retrying the migration installs the firmware and requests a reboot" + +: >"$TEST_LOG" +run_migration +[[ $(<"$TEST_LOG") == "state set reboot-required" ]] || + fail "a second user before reboot is prompted without reinstalling" +pass "a second user before reboot is prompted without reinstalling" + +: >"$TEST_LOG" +rm -f "$OMARCHY_XPS13_FIRMWARE_PENDING" +run_migration +[[ ! -s $TEST_LOG ]] || fail "the migration is a no-op after reboot with repaired firmware" +pass "the migration is a no-op after reboot with repaired firmware" + +reset_fixture "20260810-2" +if OMARCHY_XPS13_FIRMWARE_PENDING="$TEST_VERSION_FILE/not-a-directory" run_migration 2>/dev/null; then + fail "failure to record the pending reboot fails the migration" +fi +[[ ! -s $TEST_LOG && $(<"$TEST_VERSION_FILE") == "20260810-2" ]] || + fail "failure to record the reboot marker installs nothing" +pass "failure to record the reboot marker installs nothing"