bakery updates leave orphaned "pre" snapshots, or none at all #28

Closed
opened 2026-09-26 07:27:43 +08:00 by Breadway · 2 comments
Owner

Problem

bos-update (lines 29-37) runs snapper create -t pre but never a matching -t post, and doesn't capture the snapshot number. Orphaned pre snapshots pile up and eat into NUMBER_LIMIT. Running bakery update directly, or updating from bos-settings > Packages, gets no snapshot at all, even though bakery writes to /usr/local on @.

Where

  • iso/airootfs/usr/local/bin/bos-update
  • bakery itself (separate repo), or a wrapper

Fix

  • In bos-update: PRE=$(snapper -c root create -t pre -p -c number -d ...), then after bakery finishes run snapper -c root create -t post --pre-number "$PRE" -c number -d .... Do the same for the home config.
  • Better: give bakery a pre/post transaction hook (/etc/bakery/hooks.d/, or built-in snapper support) so every bakery write path is covered, like snap-pac. File the bakery half in the bread-ecosystem repo (ECO) and link it here.

Acceptance

  • snapper list after bos-update shows a matched pre/post pair for the bakery step.
  • A direct bakery update --all also produces a pair (once the bakery side lands).

Source: BOS v0.6.2 source review (tag dated 2026-09-19); paths and line numbers refer to that tree. Read AGENTS.md first. One issue per branch/PR, match existing style. Add a CHANGELOG [Unreleased] entry.

## Problem `bos-update` (lines 29-37) runs `snapper create -t pre` but never a matching `-t post`, and doesn't capture the snapshot number. Orphaned pre snapshots pile up and eat into NUMBER_LIMIT. Running `bakery update` directly, or updating from bos-settings > Packages, gets no snapshot at all, even though bakery writes to `/usr/local` on `@`. ## Where - `iso/airootfs/usr/local/bin/bos-update` - bakery itself (separate repo), or a wrapper ## Fix - In `bos-update`: `PRE=$(snapper -c root create -t pre -p -c number -d ...)`, then after bakery finishes run `snapper -c root create -t post --pre-number "$PRE" -c number -d ...`. Do the same for the home config. - Better: give bakery a pre/post transaction hook (`/etc/bakery/hooks.d/`, or built-in snapper support) so every bakery write path is covered, like snap-pac. File the bakery half in the bread-ecosystem repo (ECO) and link it here. ## Acceptance - `snapper list` after `bos-update` shows a matched pre/post pair for the bakery step. - A direct `bakery update --all` also produces a pair (once the bakery side lands). --- Source: BOS v0.6.2 source review (tag dated 2026-09-19); paths and line numbers refer to that tree. Read AGENTS.md first. One issue per branch/PR, match existing style. Add a CHANGELOG `[Unreleased]` entry.
Author
Owner

I mapped the required scope and found no BOS-28 branch or pull request. The BOS acceptance covers both the bos-update wrapper and direct bakery updates. Bakery lives in bakery/ inside Breadway/bread-ecosystem, so its transaction hook would need a separate repository change; I found no matching Snapper task in ECO BACKLOG or TODO.

I could not start implementation safely because the local BOS origin/main is 5f15a4f, while Forgejo currently reports main at be121b1. Fetching the authorized origin failed with: Bad owner or permissions on /etc/ssh/ssh_config.d/20-systemd-ssh-proxy.conf. Per the task constraints I did not change SSH configuration or use another transport. No files or commits were changed.

The implementation should create a numbered pre snapshot and a matching post snapshot around the bakery transaction, including on failure, and ensure bos-update does not leave orphaned or duplicate pairs. Both direct bakery update --all and bos-update need acceptance checks. Returning BOS-28 to TODO until the authorized origin can be fetched. No desktop, VM, or personal config was touched.

I mapped the required scope and found no BOS-28 branch or pull request. The BOS acceptance covers both the bos-update wrapper and direct bakery updates. Bakery lives in bakery/ inside Breadway/bread-ecosystem, so its transaction hook would need a separate repository change; I found no matching Snapper task in ECO BACKLOG or TODO. I could not start implementation safely because the local BOS origin/main is 5f15a4f, while Forgejo currently reports main at be121b1. Fetching the authorized origin failed with: `Bad owner or permissions on /etc/ssh/ssh_config.d/20-systemd-ssh-proxy.conf`. Per the task constraints I did not change SSH configuration or use another transport. No files or commits were changed. The implementation should create a numbered pre snapshot and a matching post snapshot around the bakery transaction, including on failure, and ensure bos-update does not leave orphaned or duplicate pairs. Both direct `bakery update --all` and `bos-update` need acceptance checks. Returning BOS-28 to TODO until the authorized origin can be fetched. No desktop, VM, or personal config was touched.
Author
Owner

Implemented d56c68f: #77

The wrapper creates paired numbered root/home snapshots only around bakery, closes them after failed updates, and preserves optional-home behavior. It checks the configured bakery capability under the actual update privilege context to prevent duplicate pairs. BOS enables snapper_configs for newer bakery. Isolated mock tests passed for success, failure, missing home, ordering, and native duplicate prevention; Bash syntax and diff checks passed.

Direct bakery and Packages coverage is provided by ECO-47 and requires a shipped bakery build containing that change. Real installed-BOS snapper list acceptance remains pending; no desktop, personal config, installed binary, or live Snapper state was touched.

Implemented d56c68f: https://git.breadway.dev/Breadway/bos/pulls/77 The wrapper creates paired numbered root/home snapshots only around bakery, closes them after failed updates, and preserves optional-home behavior. It checks the configured bakery capability under the actual update privilege context to prevent duplicate pairs. BOS enables snapper_configs for newer bakery. Isolated mock tests passed for success, failure, missing home, ordering, and native duplicate prevention; Bash syntax and diff checks passed. Direct bakery and Packages coverage is provided by ECO-47 and requires a shipped bakery build containing that change. Real installed-BOS snapper list acceptance remains pending; no desktop, personal config, installed binary, or live Snapper state was touched.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Breadway/bos#28
No description provided.