Fail updates that leave required Panther Lake firmware unrepaired
Honor package exclusions while returning failure when an installation leaves the required Cirrus firmware too old. Print-only and download-only operations remain successful without a repair or reboot request. Co-Authored-By: GPT-6.1-Sol High <noreply@openai.com> Co-Authored-By: Greptile <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
033b5ecd3d
commit
19e5941075
2 files changed
+27
-1
No files matched your search
@@ -10,6 +10,7 @@ query_args=()
|
|||||||
declare -A firmware_targets needed_options
|
declare -A firmware_targets needed_options
|
||||||
sync=0 upgrades=0 ask_bits=0 repair_reboot=0
|
sync=0 upgrades=0 ask_bits=0 repair_reboot=0
|
||||||
noninteractive=0
|
noninteractive=0
|
||||||
|
install_operation=1
|
||||||
operand="" option=""
|
operand="" option=""
|
||||||
end_options=0
|
end_options=0
|
||||||
separator_index=""
|
separator_index=""
|
||||||
@@ -40,6 +41,9 @@ for index in "${!pacman_args[@]}"; do
|
|||||||
--sysupgrade) ((upgrades += 1)) ;;
|
--sysupgrade) ((upgrades += 1)) ;;
|
||||||
--noconfirm) noninteractive=1 ;;
|
--noconfirm) noninteractive=1 ;;
|
||||||
--confirm) noninteractive=0 ;;
|
--confirm) noninteractive=0 ;;
|
||||||
|
--print|--downloadonly) install_operation=0 ;;
|
||||||
|
--print-format) install_operation=0; operand=skip ;;
|
||||||
|
--print-format=*) install_operation=0 ;;
|
||||||
--ask) operand=ask ;;
|
--ask) operand=ask ;;
|
||||||
--ask=*)
|
--ask=*)
|
||||||
mask=${arg#*=}
|
mask=${arg#*=}
|
||||||
@@ -55,6 +59,7 @@ for index in "${!pacman_args[@]}"; do
|
|||||||
--*) ;;
|
--*) ;;
|
||||||
-*)
|
-*)
|
||||||
[[ $arg != *S* ]] || sync=1
|
[[ $arg != *S* ]] || sync=1
|
||||||
|
[[ $arg != *p* && $arg != *w* ]] || install_operation=0
|
||||||
upgrade_flags=${arg//[^u]/}
|
upgrade_flags=${arg//[^u]/}
|
||||||
((upgrades += ${#upgrade_flags}))
|
((upgrades += ${#upgrade_flags}))
|
||||||
;;
|
;;
|
||||||
@@ -111,11 +116,13 @@ fi
|
|||||||
|
|
||||||
if (( repair_reboot )); then
|
if (( repair_reboot )); then
|
||||||
sudo env "${env_args[@]}" "${scope[@]}" pacman "${pacman_args[@]}" || exit $?
|
sudo env "${env_args[@]}" "${scope[@]}" pacman "${pacman_args[@]}" || exit $?
|
||||||
|
(( install_operation )) || exit 0
|
||||||
cirrus_package=$(pacman "${query_args[@]}" -Q linux-firmware-cirrus 2>/dev/null || true)
|
cirrus_package=$(pacman "${query_args[@]}" -Q linux-firmware-cirrus 2>/dev/null || true)
|
||||||
if [[ -n $cirrus_package ]] && (( $(vercmp "${cirrus_package#* }" "20260810-3") >= 0 )); then
|
if [[ -n $cirrus_package ]] && (( $(vercmp "${cirrus_package#* }" "20260810-3") >= 0 )); then
|
||||||
omarchy-state set reboot-required
|
omarchy-state set reboot-required
|
||||||
else
|
else
|
||||||
echo "Speaker firmware was not repaired; check the transaction's package exclusions." >&2
|
echo "Speaker firmware requires linux-firmware-cirrus>=20260810-3. Check package exclusions and retry the update." >&2
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
exec sudo env "${env_args[@]}" "${scope[@]}" pacman "${pacman_args[@]}"
|
exec sudo env "${env_args[@]}" "${scope[@]}" pacman "${pacman_args[@]}"
|
||||||
|
|||||||
@@ -99,6 +99,9 @@ CONF
|
|||||||
}
|
}
|
||||||
run_transaction() {
|
run_transaction() {
|
||||||
local status=0
|
local status=0
|
||||||
|
if [[ ${RETENTION_SIMULATE_SUCCESS:-0} != 1 && ${RETENTION_INSTALL_NO_CHANGE:-0} != 1 ]]; then
|
||||||
|
set -- --print "$@"
|
||||||
|
fi
|
||||||
PATH="$test_tmp/bin:$PATH" "$ROOT/bin/omarchy-update-pacman" "$@" >"$test_tmp/result" 2>"$test_tmp/errors" || status=$?
|
PATH="$test_tmp/bin:$PATH" "$ROOT/bin/omarchy-update-pacman" "$@" >"$test_tmp/result" 2>"$test_tmp/errors" || status=$?
|
||||||
(( status == 0 )) || cat "$test_tmp/errors" >&2
|
(( status == 0 )) || cat "$test_tmp/errors" >&2
|
||||||
return "$status"
|
return "$status"
|
||||||
@@ -204,3 +207,19 @@ pass "a final --confirm keeps the interactive question policy"
|
|||||||
run_transaction -Su --confirm --noconfirm
|
run_transaction -Su --confirm --noconfirm
|
||||||
[[ $(sed -n '/^--ask$/{n;p;}' "$test_tmp/transaction-args") == 1 ]] || fail "a final --noconfirm keeps noninteractive exclusions"
|
[[ $(sed -n '/^--ask$/{n;p;}' "$test_tmp/transaction-args") == 1 ]] || fail "a final --noconfirm keeps noninteractive exclusions"
|
||||||
pass "a final --noconfirm keeps noninteractive exclusions"
|
pass "a final --noconfirm keeps noninteractive exclusions"
|
||||||
|
reset_fixture 20260810-2
|
||||||
|
status=0
|
||||||
|
RETENTION_INSTALL_NO_CHANGE=1 run_transaction -Su --noconfirm || status=$?
|
||||||
|
[[ $status == 1 && ! -e $test_tmp/state && $(<"$test_tmp/errors") == *'Check package exclusions and retry'* ]] ||
|
||||||
|
fail "an excluded or declined installation cannot report a successful firmware repair"
|
||||||
|
pass "an excluded or declined installation fails without bypassing exclusions or requesting reboot"
|
||||||
|
for print_option in -Sup -Suw --print --downloadonly '--print-format=%n'; do
|
||||||
|
reset_fixture 20260810-2
|
||||||
|
if [[ $print_option == -S* ]]; then
|
||||||
|
RETENTION_INSTALL_NO_CHANGE=1 run_transaction "$print_option" --noconfirm
|
||||||
|
else
|
||||||
|
RETENTION_INSTALL_NO_CHANGE=1 run_transaction -Su --noconfirm "$print_option"
|
||||||
|
fi
|
||||||
|
[[ ! -e $test_tmp/state ]] || fail "non-install modes never request reboot"
|
||||||
|
done
|
||||||
|
pass "short, long and formatted print/download-only transactions remain successful without repair"
|
||||||
Reference in new issue
Block a user