Files
coredesktop/smoketest/scenarios/50-stale-system.sh
T
davidandClaude Opus 5.5 9dc5eb193d
shellcheck / shellcheck (push) Failing after 19s
Add upgrade safeguards, hardware setup, sign-in options and Taildrop from Omarchy
Adapted from Omarchy (github.com/omacom/omarchy) for Arch with GNOME:

- A pacman hook stops a full upgrade run without update (pacman -Syu,
  yay -Syu), which would skip the snapshot and update's checks. update
  and install.sh set COREDESKTOP_ALLOW_PACMAN=1, which the hook finds on
  pacman or any process above it; you can set it too.
- When the Arch upgrade stops on files no package owns, update lists
  them and asks to move them to /var/lib/coredesktop/replaced and try
  again, putting back what the retry didn't replace. When packages
  conflict, it runs pacman again so you can choose.
- update and install keep the computer from sleeping until they finish.
- system/hardware.sh (install, and a migration): the Wi-Fi country from
  the time zone, thermald and intel-lpmd on Intel laptops, and Wi-Fi 6
  on Intel BE200/BE211 cards, whose driver gets Wi-Fi 7 wrong.
- configure security-key and configure fingerprint: touch a FIDO2 key
  or a finger instead of typing your password for sudo and polkit,
  falling back to the password. Each shows only when the hardware is
  there. The fingerprint skips to the password with the lid shut.
- webapp: put a website in the app grid as its own app window.
- Taildrop: Files' Scripts > Send with Tailscale, and a user service
  that saves files sent here to Downloads, started when configure
  tailscale joins.
- A NetworkManager dispatcher script pauses a Tailscale exit node while
  you sign in to a captive portal, and resumes it once online.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 12:08:06 -07:00

51 lines
1.9 KiB
Bash

#!/bin/bash
# shellcheck disable=SC2034
DESCRIPTION="a machine a month behind on a stale mirror: update picks fresh mirrors, upgrades the kernel, asks for a reboot"
IMAGE=installed
TIER="nightly"
scenario() {
local date kernel_before
date="$(date -d '30 days ago' +%Y/%m/%d)"
# Go back to Arch as it was a month ago, from the Arch Linux Archive, which
# is also a mirror that stopped syncing a month ago. Packages from Arch's
# repos that the archive doesn't have yet, often split off since (e.g.
# clang-libs from clang), go first: their files conflict with the old
# packages'. update installs them again
run_in_vm downgrade "set -e
pacman -Qqn | sort > ~/native-now
echo 'Server = https://archive.archlinux.org/repos/$date/\$repo/os/\$arch' \
| sudo tee /etc/pacman.d/mirrorlist
sudo pacman -Syy
newer=\"\$(pacman -Qqm | sort | comm -12 ~/native-now -)\"
rm ~/native-now
if [ -n \"\$newer\" ]; then
echo \"Not in the archive yet, removing: \"\$newer
sudo pacman -Rdd --noconfirm \$newer
fi
COREDESKTOP_ALLOW_PACMAN=1 sudo pacman -Suu --noconfirm"
[ "$STATUS" -eq 0 ] || skip "couldn't downgrade to Arch as of $date (see $LAST_LOG)"
vm_reboot
kernel_before="$(vm_value 'uname -r')"
run_in_vm version '"$HOME/.local/bin/version"'
assert_output "last synced with Arch"
local snapshots_before
snapshots_before="$(vm_value 'sudo snapper -c root list 2> /dev/null | wc -l')"
cd_update
assert_status 0
assert_output "Please reboot when convenient"
refute_vm "the first mirror isn't the archive any more" \
'grep -m1 "^Server" /etc/pacman.d/mirrorlist | grep -q archive.archlinux.org'
assert_vm "update took a snapshot first (if / is btrfs)" "
[ \"\$(findmnt -no FSTYPE /)\" != btrfs ] \
|| [ \"\$(sudo snapper -c root list | wc -l)\" -gt $snapshots_before ]"
vm_reboot
refute_vm "a newer kernel is running" "[ \"\$(uname -r)\" = $(q "$kernel_before") ]"
health
}