Skip to content

Conversation

@cgwalters
Copy link
Collaborator

Implement bootc container installation using anaconda as the installation
engine with kickstart processing. Uses the ephemeral VM infrastructure to
run anaconda in an isolated environment with proper access to block devices
and container storage.

Key implementation details:

  • User must provide kickstart file with partitioning and locale settings
  • bcvk injects ostreecontainer directive with --transport=containers-storage
  • Inject %pre script to configure container storage with host overlay
  • Inject %post script running 'bootc switch --mutate-in-place' to repoint
    the installed system to the registry image (for bootc upgrade to work)
  • Handle SSH exit code 255 as success when VM powers off after installation
  • Share disk creation logic via qemu_img::create_disk()

Options:

  • --kickstart (-k): Required kickstart file path
  • --target-imgref: Registry image for bootc origin (defaults to image arg)
  • --no-repoint: Skip %post repointing if user handles it themselves

The anaconda installer container (localhost/anaconda-bootc) is based on
fedora-bootc with anaconda-tui installed. Build instructions in
containers/anaconda-bootc/.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces an experimental anaconda-based installation method for bootc images, including a new Dockerfile, documentation, and integration tests. While the code is well-structured, there are significant security concerns regarding how user-supplied image names and references are handled when generating Kickstart files. Specifically, the code is vulnerable to both Command Injection in the %post script and Kickstart Directive Injection via the image argument. These should be addressed by properly quoting and validating all user-supplied strings. Additionally, a minor issue was noted regarding a hardcoded value in the generated kickstart script, which could be made dynamic for better flexibility.

Add a DiskSize newtype that wraps u64 bytes and implements FromStr,
allowing clap to parse disk sizes directly from command line arguments.
This eliminates the need for manual parsing at each call site.

The type supports human-readable formats like '10G', '5120M', '1T' and
provides both from_bytes() constructor and as_bytes() accessor.

Update all disk_size Option<String> fields to use Option<DiskSize>:
- to_disk::ToDiskAdditionalOpts
- libvirt/upload::LibvirtUploadOpts
- libvirt_upload_disk::LibvirtUploadDiskOpts
- libvirt/base_disks (internal usage)

Assisted-by: OpenCode (Claude sonnet-4-20250514)
cgwalters added a commit to bootc-dev/bootc that referenced this pull request Feb 6, 2026
This covers the tar export workflow which is currently custom.

In the future though I'd like to have more direct support
for Anaconda using bootc-dev/bcvk#202

Assisted-by: OpenCode (Opus 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
Add support for installing bootc containers using anaconda as the
installation engine. A key thing that `bcvk` wraps here is
ensuring that the local container storage is automatically
injected into the kickstart.

Assisted-by: OpenCode (Claude Sonnet 4)
Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters cgwalters force-pushed the feature/anaconda-integration branch from e280d07 to 9429b21 Compare February 6, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant