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
+4 -29
View File
@@ -141,35 +141,10 @@ fi
# Display the selected option (optional)
echo "You selected: $uri"
# Get a list of files in "dishes" directory
mapfile -t dish_name < <(find "cook/dishes/" -maxdepth 1 -type f \( -name "*guest-agents*" \) -printf "%f\n" | sed 's/\.[^.]*$//')
# Check if there are any files
if [ ${#dish_name[@]} -eq 0 ]; then
echo "No files found in the directory ../dishes."
exit 1
fi
# Display the files with numbered options
echo "Available files:"
for i in "${!dish_name[@]}"; do
echo "$((i + 1)). ${dish_name[$i]}"
done
# Prompt the user to select a file
read -r -p "Enter the number of the file you want to select: " choice
# Validate the user's choice
if ! [[ "$choice" =~ ^[0-9]+$ ]] || (( choice < 1 )) || (( choice > ${#dish_name[@]} )); then
echo "Invalid choice. Please enter a number from 1 to ${#dish_name[@]}."
exit 1
fi
# Get the selected filename
vm_name="${dish_name[$((choice - 1))]}"
# Output the selected filename
echo "You selected: $vm_name"
# Pick a dish (shared with build-image.sh)
# shellcheck source=./select-dish.sh
source "$(dirname "$0")/select-dish.sh"
vm_name="$selected_dish"
# Find Fedora ISO based on the dish name
fedora_iso=$(find_fedora_iso "$vm_name")