bos/iso/airootfs/usr/local/bin/bos-update
Breadway 96a2f685a2 1.0 polish: os-release, snapper pre, lockfile pins, listen, docs
Point os-release at the bos repo and issues; drop Arch privacy terms.
Take a best-effort snapper pre snapshot before pacman and bakery.
Pin current stable bakery versions so CI fetches the same bits per commit.
Autostart breadpaper/breadshot listen behind command -v.
Document signed-repo setup and Mesa/NVIDIA/grub-btrfs recovery.
2026-08-15 22:53:01 +08:00

56 lines
2.3 KiB
Bash

#!/bin/bash
# bos-update — update all of BOS in one go.
#
# BOS packages come from two channels, so a full update touches both:
# 1. pacman — Arch base/desktop + the [breadway] repo (breadlock + AUR
# republishes: calamares, zen-browser-bin, bibata, yay-bin,
# powerlevel10k). [breadway] does NOT provide bos-settings
# or other bakery desktop apps. Every transaction is
# snapshotted by snap-pac; recover via the GRUB "snapshots"
# submenu (grub-btrfs), not `snapper rollback`.
# 2. bakery — the bread ecosystem apps in ~/.local/bin (whatever `bakery list`
# reports as installed — bakery, bread, breadbar, breadbox,
# breadcrumbs, breadpad, breadman, bread-theme, breadpaper,
# breadmon, breadsearch, breadclip, breadshot, bos-settings,
# breadhelp, ...).
#
# Best-effort: a failure in one channel doesn't abort the other.
set -uo pipefail
bold() { printf '\033[1m%s\033[0m\n' "$1"; }
# Timed snapper pre snapshot before either channel. snap-pac already
# snapshots root around pacman; bakery writes ~/.local/bin ($HOME / @home),
# which is outside that root snapshot. This extra snapshot is still
# best-effort and covers bakery $HOME updates as well as possible — a
# home config if the installer created one, otherwise the root timeline
# around the whole update. Never fail the update if snapper is missing
# or the create errors.
if command -v snapper >/dev/null; then
if snapper -c home list >/dev/null 2>&1; then
snapper -c home create -t pre -c number \
-d "bos-update (pre bakery)" \
|| echo "WARN: snapper home pre snapshot failed"
fi
snapper -c root create -t pre -c number \
-d "bos-update (pre bakery)" \
|| echo "WARN: snapper pre snapshot failed"
fi
bold "==> System packages (pacman -Syu)"
if command -v pacman >/dev/null; then
sudo pacman -Syu || echo "WARN: pacman update failed"
else
echo "pacman not found; skipping"
fi
echo
bold "==> Bread ecosystem (bakery update --all)"
if command -v bakery >/dev/null; then
bakery update --all || echo "WARN: bakery update failed"
else
echo "bakery not found; skipping"
fi
echo
bold "==> BOS is up to date."