Install the XPS 13 PTL speaker alias package
Install the separately owned firmware aliases through the package helper so stock firmware updates and stable refreshes retain them. Use a distinct migration to reach machines with the prior migration completed and preserve the reboot prompt until reboot. Restore the generic updater and leave display quirks to the kernel. Co-Authored-By: Codex GPT-6.1-Sol XHigh <noreply@openai.com>
This commit is contained in:
1 parent
19e5941075
commit
0d8232b9db
13 files changed
+28
-620
No files matched your search
@@ -5,67 +5,16 @@ 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"
|
||||
migration="$ROOT/migrations/1791265613.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" <<DESC
|
||||
%FILENAME%
|
||||
linux-firmware-cirrus-$version-any.pkg.tar.zst
|
||||
|
||||
%NAME%
|
||||
linux-firmware-cirrus
|
||||
|
||||
%VERSION%
|
||||
$version
|
||||
|
||||
%ARCH%
|
||||
any
|
||||
DESC
|
||||
tar -czf "$test_tmp/db/sync/$repo.db" -C "$test_tmp/package" "$entry/desc"
|
||||
}
|
||||
|
||||
resolve_firmware() {
|
||||
"$real_pacman" --config "$test_tmp/pacman.conf" --dbpath "$test_tmp/db" \
|
||||
-S --print --print-format '%r/%n %v' "$firmware_target"
|
||||
}
|
||||
|
||||
write_repo omarchy "20260810-3"
|
||||
write_repo core "20260810-2"
|
||||
[[ $(resolve_firmware) == "omarchy/linux-firmware-cirrus 20260810-3" ]] ||
|
||||
fail "the offline package target selects Omarchy over older core firmware"
|
||||
pass "the offline package target selects Omarchy over older core firmware"
|
||||
|
||||
write_repo core "20260910-2"
|
||||
[[ $(resolve_firmware) == "core/linux-firmware-cirrus 20260910-2" ]] ||
|
||||
fail "the offline package target preserves newer Arch firmware"
|
||||
pass "the offline package target preserves newer Arch firmware"
|
||||
|
||||
cat >"$test_tmp/bin/omarchy-hw-match" <<'SH'
|
||||
#!/bin/bash
|
||||
[[ $TEST_PRODUCT_NAME == *"$1"* ]]
|
||||
@@ -81,13 +30,18 @@ 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")"
|
||||
if [[ ${@: -1} == "linux-firmware-cirrus-dx13260" ]]; then
|
||||
[[ -e $TEST_ALIAS_FILE ]] || exit 1
|
||||
printf 'linux-firmware-cirrus-dx13260 20260810-1\n'
|
||||
else
|
||||
[[ -s $TEST_VERSION_FILE ]] || exit 1
|
||||
printf 'linux-firmware-cirrus %s\n' "$(<"$TEST_VERSION_FILE")"
|
||||
fi
|
||||
else
|
||||
printf 'pacman %s\n' "$*" >>"$TEST_LOG"
|
||||
[[ $* == "-S --noconfirm --needed omarchy/linux-firmware-cirrus" ]] || exit 1
|
||||
[[ $* == "-S --noconfirm --needed -- linux-firmware-cirrus-dx13260" ]] || exit 1
|
||||
[[ ${TEST_INSTALL_FAILURE:-0} == "0" ]] || exit 1
|
||||
printf '20260810-3\n' >"$TEST_VERSION_FILE"
|
||||
touch "$TEST_ALIAS_FILE"
|
||||
fi
|
||||
SH
|
||||
cat >"$test_tmp/bin/omarchy-state" <<'SH'
|
||||
@@ -98,9 +52,9 @@ chmod +x "$test_tmp/bin/"*
|
||||
|
||||
test_path="$PATH"
|
||||
export PATH="$test_tmp/bin:$ROOT/bin:$PATH"
|
||||
export TEST_LOG="$test_tmp/calls" TEST_VERSION_FILE="$test_tmp/version"
|
||||
export TEST_LOG="$test_tmp/calls" TEST_VERSION_FILE="$test_tmp/version" TEST_ALIAS_FILE="$test_tmp/alias-installed"
|
||||
export TEST_PRODUCT_NAME="XPS 13 DX13260" TEST_INTEL_PTL=1
|
||||
install_call="pacman -S --noconfirm --needed omarchy/linux-firmware-cirrus"
|
||||
install_call="pacman -S --noconfirm --needed -- linux-firmware-cirrus-dx13260"
|
||||
firmware_pending="$test_tmp/run/pending"
|
||||
|
||||
# Redirect the fixed filesystem path in isolated copies, not through production environment overrides.
|
||||
@@ -116,7 +70,7 @@ migration="$OMARCHY_PATH/migrations/${migration##*/}"
|
||||
reset_fixture() {
|
||||
: >"$TEST_LOG"
|
||||
printf '%s' "$1" >"$TEST_VERSION_FILE"
|
||||
rm -f "$firmware_pending"
|
||||
rm -f "$firmware_pending" "$TEST_ALIAS_FILE"
|
||||
}
|
||||
|
||||
run_leaf() {
|
||||
@@ -139,23 +93,21 @@ TEST_INTEL_PTL=0 run_migration
|
||||
[[ ! -s $TEST_LOG && ! -e $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
|
||||
for version in "" "20260810-2" "20260810-3" "20260810-4" "20260910-2" "20260916-1" "1: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"
|
||||
run_leaf || fail "the alias package is installed during hardware setup"
|
||||
[[ $(<"$TEST_LOG") == "$install_call" && $(<"$TEST_VERSION_FILE") == "$version" && -e $TEST_ALIAS_FILE ]] ||
|
||||
fail "hardware setup installs the separate aliases without replacing stock firmware"
|
||||
[[ -e $firmware_pending ]] || fail "the firmware repair records its pending reboot"
|
||||
done
|
||||
pass "hardware setup explicitly installs the Omarchy firmware when missing or old"
|
||||
pass "hardware setup installs the package identity without replacing any stock firmware"
|
||||
|
||||
for version in "20260810-3" "20260810-4" "20260910-2" "1:20260810-2"; do
|
||||
reset_fixture "$version"
|
||||
run_leaf
|
||||
run_migration
|
||||
[[ ! -s $TEST_LOG && ! -e $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"
|
||||
touch "$TEST_ALIAS_FILE"
|
||||
run_leaf
|
||||
run_migration
|
||||
[[ ! -s $TEST_LOG && ! -e $firmware_pending ]] || fail "installed aliases are idempotent on stock firmware"
|
||||
pass "installed aliases are idempotent on stock firmware"
|
||||
|
||||
reset_fixture "20260810-2"
|
||||
if TEST_INSTALL_FAILURE=1 run_migration; then
|
||||
|
||||
Reference in new issue
Block a user