Add build-image.sh: raw/qcow2 disk images without libvirt/virt-install

Runs `livemedia-creator --no-virt --make-disk` directly on the host to
produce a disk image any VM manager can consume (e.g. via virtpull's
`virtpull local ... --wonder-vm NAME`), instead of deploy.sh's live
virt-install/libvirt session.

An earlier version wrapped this in `mock`, mirroring
.gitea/workflows/build-iso.yaml's ISO build. That doesn't work for
--make-disk: mock's chroot has no live systemd-udevd, so udev never
populates properties for the loop device livemedia-creator creates,
and blivet's device scan crashes. --make-iso never hits this since it
never touches block devices. Reproduced identically on Fedora 44 and
43 mock chroots, confirmed fixed by running directly on the host
instead (root required, for /dev/loop-control access).

Also fixes two real kickstart incompatibilities with the --no-virt
disk-image path (applied to a scratch copy, not the shared
ingredients): the `text` display-mode directive (needed for
virt-install's netinstall console) conflicts with livemedia-creator's
own display handling, and `part / --grow` with no explicit --size
crashes livemedia-creator's upfront disk-size calculation (works fine
under virt-install, which pre-creates the disk at a known size
instead) — now configurable via --root-size.

New --extra-ks FILE flag layers one-off local content (e.g. a bespoke
user/rootpw override) onto the scratch copy without touching tracked
ingredients, following the README's existing "bespoke dish not part
of the matrix" pattern.

Factored deploy/deploy-distro.sh's dish-picker into deploy/select-dish.sh,
shared by both scripts.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Lukas Greve
2026-09-18 20:04:49 +02:00
co-authored by Claude Sonnet 5
parent a8228df780
commit dceb82f8f6
5 changed files with 246 additions and 29 deletions
+28
View File
@@ -38,6 +38,34 @@ Creating domain...
`deploy.sh` regenerates the `recipes` and `dishes` (they are build products) before deploying.
After a successfull installation, the virtual machine will shutdown and be ready to use when powered on again.
## Building a disk image (no libvirt/virt-install)
`deploy.sh` drives a live `virt-install`/libvirt session. If you just want a
raw or qcow2 disk image — e.g. to hand to another VM manager such as
wonder-vm via virtpull's `virtpull local ... --wonder-vm NAME`
use `build-image.sh` instead. It runs `livemedia-creator --no-virt
--make-disk` directly on the host, producing a disk image instead of a
bootable ISO:
```
./build-image.sh [--as qcow2] [--root-size MiB] [--extra-ks FILE]
```
It picks a dish the same way `deploy.sh` does and writes the result under
`./build/`. Requires `lorax-lmc-novirt` (heavier than `deploy.sh`'s plain
QEMU/libvirt prerequisites, not installed by
`deploy/install-prerequisites-on-linux.sh`) and root — the `--no-virt` disk
install needs real loop-device access (`/dev/loop-control`), which a
`mock` chroot cannot provide (no live `systemd-udevd` inside it, which
breaks blivet's device scan) and neither can a rootless container.
`--root-size` (default 8192 MiB) sizes the root partition, needed because
livemedia-creator computes the image size up front, unlike virt-install
which pre-creates the disk at a known size. `--extra-ks FILE` appends
local content (e.g. a bespoke `user`/`rootpw` override) to the dish before
building, without touching the tracked ingredients — see the "bespoke
dish" pattern below; never commit a file used here if it carries real
credentials.
## Repository structure
This repository contains such files broken down as: