Skip to content

Commit ea18296

Browse files
cgwaltersjeckersb
authored andcommitted
docs: Add boot failure detection documentation
This came up in chat. Definitely the "enable tries integration for composefs" would make total sense. Assisted-by: OpenCode (Sonnet 4.5) Signed-off-by: Colin Walters <walters@verbum.org>
1 parent 6ac06b7 commit ea18296

2 files changed

Lines changed: 55 additions & 0 deletions

File tree

docs/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
# Using bootc
1919

2020
- [Upgrade and rollback](upgrades.md)
21+
- [Boot failure detection](boot-failure-detection.md)
2122
- [Accessing registries and offline updates](registries-and-offline.md)
2223
- [Logically bound images](logically-bound-images.md)
2324
- [Booting local builds](booting-local-builds.md)

docs/src/boot-failure-detection.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Upgrade/rollback failure detection in bootc
2+
3+
This document describes how to detect when a reboot failed to enable the staged image in bootc.
4+
5+
## Overview
6+
7+
bootc uses different mechanisms to detect boot failures depending on the backend (OSTree vs. composefs+UKI) and the specific point of failure. Understanding these mechanisms is crucial for system administrators and automated tooling that needs to detect failed updates.
8+
9+
## OSTree Backend Boot Failure Detection
10+
11+
For systems using the traditional OSTree backend, bootc relies on OSTree's built-in boot failure detection mechanisms.
12+
13+
### Key Services
14+
15+
1. **`ostree-finalize-staged.service`** - Runs during shutdown to finalize staged deployments
16+
2. **`ostree-boot-complete.service`** - Runs early in boot to detect finalization failures
17+
18+
When `ostree-finalize-staged.service` fails during shutdown/reboot, this will create
19+
a stamp file in `/boot`, and then on a subsequent reboot the `ostree-boot-complete.service`
20+
service will detect it, and then itself exit with a failure mode.
21+
22+
You can monitor the success of both services, though for `ostree-finalize-staged.service`
23+
note that the failure occurred during the previous boot's shutdown.
24+
25+
26+
## Composefs Backend Boot Failure Detection
27+
28+
### Key Services
29+
30+
There is a `bootc-finalize-staged.service` which is similar to `ostree-finalize-staged.service`,
31+
but there is not currently a similar `-boot-complete.service`. There is also a `bootc-root-setup.service`
32+
that runs during initramfs to mount the composefs image and set up `/etc` and `/var` - but if this
33+
service fails, the system will not boot at all (emergency mode or hang).
34+
35+
At the current time then, it is recommended to check the journal for failures from the previous boot:
36+
37+
```bash
38+
# Check for finalization failures from previous boot
39+
journalctl -u bootc-finalize-staged.service -b -1
40+
```
41+
42+
### Systemd Boot Assessment Integration
43+
44+
As of a recent OSTree with [this commit](https://github.com/ostreedev/ostree/commit/08487091256b93493f8d692e37ab3d892c758da1)
45+
it is possible to configure the boot loader entry counting.
46+
47+
At the current time, the composefs backend does not configure boot entry counting, this is likely to be added in the future.
48+
49+
## See Also
50+
51+
- [systemd Automatic Boot Assessment](https://systemd.io/AUTOMATIC_BOOT_ASSESSMENT/)
52+
- [OSTree Manual](https://ostreedev.github.io/ostree/)
53+
- [bootc-rollback(8)](man/bootc-rollback.8.md)
54+
- [bootc-status(8)](man/bootc-status.8.md)

0 commit comments

Comments
 (0)