Repository navigation
Commit 5f31d97
committed
install: Add --initialize-var-mounts for separate /var filesystems
A common setup places /var, or parts of it such as /var/log, on
separate filesystems (for example LVM logical volumes) so that runaway
writes cannot fill the root filesystem. With `install to-filesystem`
these filesystems end up empty: the deployment backend seeds the
image's /var into its own state directory (`ostree/deploy/<stateroot>/var`,
or the composefs shared var), and at boot the separately mounted
filesystems hide that content.
With the new --initialize-var-mounts option, a fresh to-filesystem
installation discovers filesystems mounted at the target's /var or
below. Each empty top-level mount tree, including its nested mounts, is
initialized from the seeded /var with `cp --archive`, then SELinux
labeled and synced. A tree that already contains data is preserved as a
whole, without merging. The option is rejected for alongside and
existing-deployment installs, before anything on the target is changed.
Callers remain responsible for mounting these filesystems at boot.
Without the option nothing changes, so callers that mount an empty /var
filesystem and fill it themselves after installation are not affected.
Doing this by default was considered, but would have changed behavior
for them. Image builders can tell whether to pass the option from the
`Features:` list that `bootc --version` now prints after the version;
the first line stays the bare version for existing parsers. The feature
describes the binary rather than an image, so it is not part of
`container inspect`, and `--version` needs no new query interface.
The seeded copy in the state directory is kept; on OSTree, emptying it
would make the next deployment reseed it. Hardlinks cannot span
filesystems, so trees with nested mounts are copied without preserving
them. The roots of these filesystems are labeled unconditionally:
without selinuxfs (e.g. in an osbuild buildroot), an inode with no label
still reports the kernel's unlabeled context, which the regular relabel
walk takes as already labeled.
The separate /var TMT test now passes the option, checks contents,
ownership, symlinks and SELinux labels on the actual volumes, including
a nested one, and checks that without the option they stay empty.
Related: #1615
Related: #997
Generated-by: AI1 parent c3949f7 commit 5f31d97
5 files changed
Lines changed: 706 additions & 33 deletions
File tree
- crates/lib/src
- install
- docs/src/man
- tmt/tests/booted
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
976 | 976 | | |
977 | 977 | | |
978 | 978 | | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
979 | 995 | | |
980 | 996 | | |
981 | 997 | | |
| |||
986 | 1002 | | |
987 | 1003 | | |
988 | 1004 | | |
989 | | - | |
| 1005 | + | |
990 | 1006 | | |
991 | 1007 | | |
992 | 1008 | | |
| |||
3163 | 3179 | | |
3164 | 3180 | | |
3165 | 3181 | | |
| 3182 | + | |
| 3183 | + | |
| 3184 | + | |
| 3185 | + | |
| 3186 | + | |
| 3187 | + | |
| 3188 | + | |
| 3189 | + | |
| 3190 | + | |
| 3191 | + | |
| 3192 | + | |
| 3193 | + | |
| 3194 | + | |
3166 | 3195 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
| |||
224 | 225 | | |
225 | 226 | | |
226 | 227 | | |
| 228 | + | |
| 229 | + | |
227 | 230 | | |
228 | 231 | | |
229 | 232 | | |
| |||
554 | 557 | | |
555 | 558 | | |
556 | 559 | | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
557 | 568 | | |
558 | 569 | | |
559 | 570 | | |
| |||
2177 | 2188 | | |
2178 | 2189 | | |
2179 | 2190 | | |
| 2191 | + | |
2180 | 2192 | | |
2181 | 2193 | | |
2182 | 2194 | | |
| |||
2291 | 2303 | | |
2292 | 2304 | | |
2293 | 2305 | | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
| 2309 | + | |
| 2310 | + | |
| 2311 | + | |
| 2312 | + | |
| 2313 | + | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
2294 | 2320 | | |
2295 | 2321 | | |
2296 | 2322 | | |
| |||
2299 | 2325 | | |
2300 | 2326 | | |
2301 | 2327 | | |
| 2328 | + | |
| 2329 | + | |
| 2330 | + | |
| 2331 | + | |
| 2332 | + | |
| 2333 | + | |
| 2334 | + | |
| 2335 | + | |
| 2336 | + | |
| 2337 | + | |
| 2338 | + | |
| 2339 | + | |
| 2340 | + | |
| 2341 | + | |
| 2342 | + | |
| 2343 | + | |
| 2344 | + | |
2302 | 2345 | | |
2303 | 2346 | | |
2304 | 2347 | | |
2305 | 2348 | | |
| 2349 | + | |
| 2350 | + | |
| 2351 | + | |
| 2352 | + | |
| 2353 | + | |
2306 | 2354 | | |
2307 | 2355 | | |
2308 | 2356 | | |
| |||
2392 | 2440 | | |
2393 | 2441 | | |
2394 | 2442 | | |
2395 | | - | |
| 2443 | + | |
2396 | 2444 | | |
2397 | 2445 | | |
2398 | 2446 | | |
| |||
2663 | 2711 | | |
2664 | 2712 | | |
2665 | 2713 | | |
| 2714 | + | |
| 2715 | + | |
| 2716 | + | |
| 2717 | + | |
| 2718 | + | |
| 2719 | + | |
| 2720 | + | |
| 2721 | + | |
| 2722 | + | |
| 2723 | + | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
| 2730 | + | |
| 2731 | + | |
| 2732 | + | |
2666 | 2733 | | |
2667 | 2734 | | |
2668 | 2735 | | |
| |||
2744 | 2811 | | |
2745 | 2812 | | |
2746 | 2813 | | |
| 2814 | + | |
| 2815 | + | |
| 2816 | + | |
| 2817 | + | |
| 2818 | + | |
| 2819 | + | |
2747 | 2820 | | |
2748 | 2821 | | |
2749 | 2822 | | |
| |||
2939 | 3012 | | |
2940 | 3013 | | |
2941 | 3014 | | |
2942 | | - | |
| 3015 | + | |
| 3016 | + | |
| 3017 | + | |
| 3018 | + | |
| 3019 | + | |
| 3020 | + | |
2943 | 3021 | | |
2944 | 3022 | | |
2945 | 3023 | | |
| |||
2984 | 3062 | | |
2985 | 3063 | | |
2986 | 3064 | | |
| 3065 | + | |
2987 | 3066 | | |
2988 | 3067 | | |
2989 | 3068 | | |
| |||
3301 | 3380 | | |
3302 | 3381 | | |
3303 | 3382 | | |
| 3383 | + | |
| 3384 | + | |
| 3385 | + | |
| 3386 | + | |
| 3387 | + | |
| 3388 | + | |
| 3389 | + | |
| 3390 | + | |
| 3391 | + | |
| 3392 | + | |
| 3393 | + | |
| 3394 | + | |
| 3395 | + | |
| 3396 | + | |
| 3397 | + | |
| 3398 | + | |
| 3399 | + | |
| 3400 | + | |
| 3401 | + | |
| 3402 | + | |
| 3403 | + | |
| 3404 | + | |
| 3405 | + | |
| 3406 | + | |
| 3407 | + | |
| 3408 | + | |
| 3409 | + | |
| 3410 | + | |
3304 | 3411 | | |
3305 | 3412 | | |
3306 | 3413 | | |
| |||
0 commit comments