Commit 04154c1
committed
Add --flat mode for to-filesystem installation
Implement an experimental "flat" install mode for `bootc install
to-filesystem`. When `--flat` is passed, the container rootfs is
copied directly to the target filesystem without ostree or composefs
layering. Post-install, the system boots as a regular (non-bootc)
Linux system; day-2 operations (upgrade, rollback) are unavailable.
This addresses the "step 1" approach described in #1668: getting bootc
to perform a clean traditional-style OS install from a container
image.
Changes:
- Add `FLAT_INSTALL_MARKER` constant (`etc/.bootc-flat`)
- Add `--flat` flag to `InstallTargetFilesystemOpts`
- Add `flat: bool` field to `RootSetup` (defaulting to false in all
existing construction sites including baseline.rs)
- Branch in `install_to_filesystem_impl` to call `flat_install()`
before the composefs/ostree paths
- Implement `flat_install()` which:
1. Copies container rootfs via `cp --archive --one-file-system`
2. Finds the kernel using the existing `kernel::find_kernel()` API
3. Copies vmlinuz and initramfs to `/boot/vmlinuz-<ver>` etc.
4. Regenerates initramfs via dracut (omitting ostree modules),
with graceful degradation if dracut is absent in the target
5. Creates a BLS entry at `boot/loader/entries/flat-<ver>.conf`
6. Installs the bootloader via the existing bootupd/zipl paths
7. Writes the flat install marker
- Add unit test for `create_flat_bls_entry` verifying the generated
BLS config format
Only self-install mode (running inside the container) is supported;
`--source-imgref` is rejected with a clear error. UKI kernels are
not yet supported (rejected with a clear error).
Signed-off-by: Eric Curtin <eric.curtin@docker.com>1 parent 37a0427 commit 04154c1
7 files changed
Lines changed: 435 additions & 19 deletions
File tree
- crates
- lib/src
- install
- tests-integration/src
- docs/src/man
- hack
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
31 | 31 | | |
32 | | - | |
33 | | - | |
| 32 | + | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
0 commit comments