Skip to content

Commit 0bc6292

Browse files
committed
Expand/consolidate "detecting bootc"
Continually comes up. Signed-off-by: Colin Walters <[email protected]>
1 parent a507380 commit 0bc6292

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

docs/src/filesystem-sysroot.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,4 @@ is recommended, along with an `ExecStartPre=mount -o remount,rw /sysroot`.
7575

7676
### Detecting bootc/ostree systems
7777

78-
For tools like `cloud-init` that want to operate generically,
79-
conditionally detecting this situation can be done via e.g.:
80-
81-
- Checking for `/` being an `overlay` mount point
82-
- Checking for `/sysroot/ostree`
83-
84-
78+
See the [package managers](package-managers.md) section on "Detecting image based systems".

docs/src/package-managers.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,17 @@ that make the system appear writable, but it's arguably clearer not to do so by
2626
default. Detecting `/usr` as read-only here and providing the same information
2727
would make sense.
2828

29+
If you want to specifically detect if bootc is in use, then
30+
if the binary is present, the following example of
31+
parsing the JSON status will differentiate:
32+
`test $(bootc status --format=json | jq .spec.image) = null`.
33+
34+
### The `/run/ostree-booted` file
35+
36+
This is created by ostree, and hence created by bootc (with the ostree)
37+
backend. You can use it to detect ostree. However, *most* cases
38+
should instead detect via one of the recomendations above.
39+
2940
### Running a read-only system via podman/docker
3041

3142
The historical default for docker (inherited into podman) is that

0 commit comments

Comments
 (0)