Check the machine before installing, and keep old shells' mise working
shellcheck / shellcheck (push) Successful in 11s

install.sh now stops early, with a clear message, if this isn't 64-bit
Arch, it's run as root, there's no internet, or sudo doesn't work.
system/preflight.sh then asks before going on with too little disk space
or / not on btrfs, and offers to switch another login screen to GDM and
PulseAudio to PipeWire. Keeping another login screen puts GDM in
services-off, so install and update stop failing to enable it; a
migration does the same on existing machines. It says nothing when all
is well, as refresh runs install.sh again.

Intel GPUs also get intel-media-driver for hardware video decoding, with
a migration for existing machines.

The mise migration links ~/.local/bin/mise to /usr/bin/mise instead of
deleting it, so shells opened before the update don't print an error at
every prompt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-31 08:25:46 -06:00
co-authored by Claude Opus 5.5
parent cb66ce9719
commit a102e6fe0b
8 changed files with 295 additions and 10 deletions
+28 -1
View File
@@ -24,10 +24,33 @@ cd
# Exit on any error
set -e
# What can't be fixed from here, checked before anything changes. The rest of
# the checks need the repo (system/preflight.sh, below).
if [ "$(id -u)" -eq 0 ]; then
echo "Run this as your own user, not as root. It asks for your password when it needs sudo."
exit 1
fi
if [ ! -f /etc/arch-release ] || ! command -v pacman &> /dev/null; then
echo "CoreDesktop needs Arch Linux. See \"Installing Arch\" in the README."
exit 1
fi
if [ "$(uname -m)" != x86_64 ]; then
echo "CoreDesktop needs a 64-bit PC (x86_64); this is $(uname -m)."
exit 1
fi
if ! curl -fsS --max-time 15 -o /dev/null https://archlinux.org; then
echo "Couldn't reach archlinux.org. Connect to the internet and run this again."
exit 1
fi
# Ask for the password once, then keep sudo's cached credentials fresh until
# the install exits, so long builds don't stop for a password again. Unlike a
# passwordless sudoers entry, nothing is left behind if the install is killed.
sudo -v
if ! sudo -v; then
echo "Couldn't use sudo. If your password was right, your user needs sudo rights (in"
echo "archinstall, make the user a superuser): https://wiki.archlinux.org/title/Sudo"
exit 1
fi
while kill -0 $$ 2> /dev/null; do sudo -n -v; sleep 60; done 2> /dev/null &
SUDO_KEEPALIVE_PID=$!
trap 'kill "$SUDO_KEEPALIVE_PID" 2> /dev/null' EXIT
@@ -70,6 +93,10 @@ fi
source packages.conf
source remove-packages.conf
# Disk space, btrfs, display manager and sound server: stops, asks, or offers
# to fix what it finds
bash ~/.local/share/coredesktop/system/preflight.sh
echo "Starting full system setup..."
# Federated Computer's own packages (Federated Calendar, ...)