Commit 933fbc1
committed
ephemeral: Replace systemd.volatile=overlay with fine-grained mounts
Instead of using systemd.volatile=overlay which overlaid all of / with
a single tmpfs-backed overlayfs, set up /etc and /var separately:
- /etc: overlayfs with tmpfs upper (transient changes, lost on reboot)
- /var: real tmpfs with content copied from image (not overlayfs)
The key benefit is that /var is now a real tmpfs, allowing podman to
use overlayfs for container storage inside /var/lib/containers. With
the old approach, the nested overlayfs caused "too many levels of
symbolic links" errors.
Implementation uses systemd credentials to inject units that run in the
initramfs before switch-root:
- bcvk-etc-overlay.service: overlay on /sysroot/etc with index=off,metacopy=off
to avoid virtiofs contention; ordered after initrd-parse-etc.service
- bcvk-var-ephemeral.service: copies /sysroot/var to tmpfs and bind mounts
Both units use ConditionPathExists=/etc/initrd-release to only run in
the initramfs context.
The execute service target is changed from default.target to
multi-user.target with ConditionPathExists=!/etc/initrd-release to
ensure it runs after switch-root, not in the initramfs.
This is Phase 1 of issue #22, making ephemeral VMs more bootc-like.
SELinux is still disabled (selinux=0); Phase 2 will add composefs
support to enable proper SELinux labeling.
Closes: #22 (Phase 1)
Assisted-by: OpenCode (Sonnet 4)1 parent d2d72cb commit 933fbc1
File tree
5 files changed
+175
-5
lines changed- crates
- integration-tests/src/tests
- kit/src
- units
5 files changed
+175
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
177 | 231 | | |
178 | 232 | | |
179 | 233 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1064 | 1064 | | |
1065 | 1065 | | |
1066 | 1066 | | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
1067 | 1074 | | |
1068 | 1075 | | |
1069 | 1076 | | |
| |||
1110 | 1117 | | |
1111 | 1118 | | |
1112 | 1119 | | |
| 1120 | + | |
| 1121 | + | |
1113 | 1122 | | |
1114 | 1123 | | |
1115 | 1124 | | |
| |||
1127 | 1136 | | |
1128 | 1137 | | |
1129 | 1138 | | |
| 1139 | + | |
| 1140 | + | |
1130 | 1141 | | |
1131 | 1142 | | |
1132 | 1143 | | |
| |||
1148 | 1159 | | |
1149 | 1160 | | |
1150 | 1161 | | |
1151 | | - | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
1152 | 1165 | | |
1153 | 1166 | | |
1154 | 1167 | | |
1155 | 1168 | | |
1156 | | - | |
| 1169 | + | |
1157 | 1170 | | |
1158 | 1171 | | |
1159 | 1172 | | |
| |||
1199 | 1212 | | |
1200 | 1213 | | |
1201 | 1214 | | |
1202 | | - | |
1203 | | - | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
1204 | 1218 | | |
1205 | | - | |
1206 | 1219 | | |
1207 | 1220 | | |
1208 | 1221 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
0 commit comments