numerous updates

This commit is contained in:
2026-10-21 08:33:19 -06:00
parent 474a678d45
commit 0905f858a9
27 changed files with 651 additions and 5 deletions
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
# Snapshot / before the system update so a bad upgrade can be rolled back.
# system/snapper.sh creates the "root" config on btrfs machines and keeps the
# last 5 snapshots.
is_installed() {
command -v snapper &>/dev/null && [ -f /etc/snapper/configs/root ]
}
run_update() {
echo "Snapshotting / before updating..."
sudo snapper -c root create -c number -d "Before CoreDesktop update" \
&& sudo snapper -c root cleanup number
}
+19 -1
View File
@@ -6,12 +6,28 @@ source "$COREDESKTOP/utils.sh"
source "$COREDESKTOP/packages.conf"
source "$COREDESKTOP/remove-packages.conf"
STATUS=0
echo "Removing unwanted packages..."
remove_packages "${REMOVE_PACMAN[@]}"
remove_flatpaks "${REMOVE_FLATPAKS[@]}"
# A machine that hasn't updated in a while can have a keyring too old to verify
# the new packages. Update it first; the -Su below completes this -Sy.
echo "Updating Arch keyring..."
sudo pacman -Sy --needed --noconfirm archlinux-keyring || STATUS=1
# script(1) keeps pacman's progress bars while logging its output for the
# initramfs check
echo "Updating Arch..."
sudo pacman -Syu --noconfirm
mkdir -p "$(dirname "$PACMAN_UPDATE_LOG")"
: > "$PACMAN_UPDATE_LOG"
sudo script -qefc "pacman -Su --noconfirm" "$PACMAN_UPDATE_LOG" || STATUS=1
if initramfs_build_failed; then
echo -e "\e[31mRebuilding the initramfs failed. Don't reboot until it's fixed - see the output above or $PACMAN_UPDATE_LOG.\e[0m"
STATUS=1
fi
echo "Checking for new packages..."
install_packages "${SYSTEM_UTILS[@]}"
@@ -20,3 +36,5 @@ install_packages "${MAINTENANCE[@]}"
install_packages "${DESKTOP[@]}"
install_packages "${MEDIA[@]}"
install_packages "${FONTS[@]}"
exit $STATUS
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
# Run one-time changes from migrations/ that haven't run on this machine yet.
# This is how machines installed before a change to install.sh catch up, so a
# change that should reach existing machines needs a migration as well. To add
# one, create migrations/$(date +%s).sh; it runs with bash, once, on success.
#
# Runs after 10-pacman.sh so migrations install packages against fresh
# package databases.
COREDESKTOP="$HOME/.local/share/coredesktop"
source "$COREDESKTOP/utils.sh"
run_migrations
+9
View File
@@ -8,3 +8,12 @@ if command -v paccache &>/dev/null; then
sudo paccache -rk2
sudo paccache -ruk0
fi
# Report packages that were installed as dependencies and are no longer needed.
# Not removed automatically: some may be tools you use directly.
ORPHANS="$(pacman -Qtdq 2>/dev/null)"
if [ -n "$ORPHANS" ]; then
echo "Packages no longer needed by anything:"
echo "$ORPHANS" | sed 's/^/ /'
echo "To remove them: sudo pacman -Rns \$(pacman -Qtdq)"
fi
+5 -1
View File
@@ -1,6 +1,10 @@
#!/bin/bash
source "$HOME/.local/share/coredesktop/utils.sh"
if initramfs_build_failed; then
echo -e "\e[31mDon't reboot yet: the initramfs failed to rebuild (see $PACMAN_UPDATE_LOG).\e[0m"
# If the running kernel's modules are gone, a newer kernel was installed
if [ ! -d "/usr/lib/modules/$(uname -r)" ]; then
elif [ ! -d "/usr/lib/modules/$(uname -r)" ]; then
echo "A newer kernel has been installed. Please reboot when convenient."
fi