Skip to content

Commit f943d07

Browse files
authored
Merge pull request #951 from cgwalters/filesystem-doc
Filesystem doc
2 parents f34e5dd + be346bc commit f943d07

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

docs/src/filesystem-storage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ The flattened tree is constructed and committed into the
5858
`ostree/container/image` namespace. The commit metadata also includes
5959
the OCI manifest and config objects.
6060

61-
This is implmented in the [ostree-rs-ext/container module](https://docs.rs/ostree-ext/latest/ostree_ext/container/index.html).
61+
This is implemented in the [ostree-rs-ext/container module](https://docs.rs/ostree-ext/latest/ostree_ext/container/index.html).
6262

6363
### SELinux labeling
6464

docs/src/filesystem.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ in derived builds.
7070
## `/etc`
7171

7272
The `/etc` directory contains mutable persistent state by default; however,
73-
it is suppported to enable the [`etc.transient` config option](https://ostreedev.github.io/ostree/man/ostree-prepare-root.html).
73+
it is suppported to enable the [`etc.transient` config option](https://ostreedev.github.io/ostree/man/ostree-prepare-root.html),
74+
see below as well.
7475

7576
When in persistent mode, it inherits the OSTree semantics of [performing a 3-way merge](https://ostreedev.github.io/ostree/atomic-upgrades/#assembling-a-new-deployment-directory)
7677
across upgrades. In a nutshell:
@@ -79,7 +80,7 @@ across upgrades. In a nutshell:
7980
- The diff between current and previous `/etc` is applied to the new `/etc`
8081
- Locally modified files in `/etc` different from the default `/usr/etc` (of the same deployment) will be retained
8182

82-
The implmentation of this defaults to being executed by `ostree-finalize-staged.service`
83+
The implementation of this defaults to being executed by `ostree-finalize-staged.service`
8384
at shutdown time, before the new bootloader entry is created.
8485

8586
The rationale for this design is that in practice today, many components of a Linux system end up shipping
@@ -95,6 +96,13 @@ would require external intervention to apply.
9596

9697
For more on configuration file best practices, see [Building](building/guidance.md).
9798

99+
### `/usr/etc`
100+
101+
The `/usr/etc` tree is generated client side and contains the default container image's
102+
view of `/etc`. This should generally be considered an internal implementation detail
103+
of bootc/ostree. Do *not* explicitly put files into this location, it can create
104+
undefined behavior. There is a check for this in `bootc container lint`.
105+
98106
## `/var`
99107

100108
Content in `/var` persists by default; it is however supported to make it or subdirectories
@@ -178,11 +186,33 @@ To do this, set the
178186
transient = true
179187
```
180188

181-
option in `prepare-root.conf`. In particular this will allow software to
189+
option in `/usr/lib/ostree/prepare-root.conf`. In particular this will allow software to
182190
write (transiently, i.e. until the next reboot) to all top-level directories,
183191
including `/usr` and `/opt`, with symlinks to `/var` for content that should
184192
persist.
185193

194+
This can be combined with `etc.transient` as well (below).
195+
196+
More on prepare-root: <https://ostreedev.github.io/ostree/man/ostree-prepare-root.html>
197+
198+
## Enabling transient etc
199+
200+
The default (per above) is to have `/etc` persist. If however you do
201+
not need to use it for any per-machine state, then enabling a transient
202+
`/etc` is a great way to reduce the amount of possible state drift. Set
203+
the
204+
205+
```toml
206+
[etc]
207+
transient = true
208+
```
209+
210+
option in `/usr/lib/ostree/prepare-root.conf`.
211+
212+
This can be combined with `root.transient` as well (above).
213+
214+
More on prepare-root: <https://ostreedev.github.io/ostree/man/ostree-prepare-root.html>
215+
186216
## Enabling state overlays
187217

188218
This feature enables a writable overlay on top of `/opt` (or really, any

0 commit comments

Comments
 (0)