mirror of
https://github.com/containers/bootc.git
synced 2026-02-06 09:45:32 +01:00
We're really going to need to switch over to having the container do dynamic mounts; cc https://github.com/containers/bootc/issues/380#issuecomment-1983721453 Just noticed this missing in one place, and found others with a grep. Right now we do operate without, but it can be racier. Signed-off-by: Colin Walters <walters@verbum.org>
22 lines
959 B
Bash
Executable File
22 lines
959 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# connect to the VM using https://libvirt.org/nss.html
|
|
|
|
set -e
|
|
|
|
# build the container image
|
|
sudo podman build --build-arg "sshpubkey=$(cat ~/.ssh/id_rsa.pub)" -f Containerfile -t localhost/bootc-lldb .
|
|
|
|
# build the disk image
|
|
mkdir -p ~/.cache/bootc-dev/disks
|
|
rm -f ~/.cache/bootc-dev/disks/lldb.raw
|
|
truncate -s 10G ~/.cache/bootc-dev/disks/lldb.raw
|
|
sudo podman run --pid=host --network=host --privileged --security-opt label=type:unconfined_t -v /dev:/dev -v /var/lib/containers:/var/lib/containers -v ~/.cache/bootc-dev/disks:/output -v /dev:/dev localhost/bootc-lldb bootc install to-disk --via-loopback --generic-image --skip-fetch-check /output/lldb.raw
|
|
|
|
# create a new VM in libvirt
|
|
set +e
|
|
virsh -c qemu:///system destroy bootc-lldb
|
|
virsh -c qemu:///system undefine --nvram bootc-lldb
|
|
set -e
|
|
sudo virt-install --name bootc-lldb --cpu host --vcpus 8 --memory 8192 --import --disk ~/.cache/bootc-dev/disks/lldb.raw --os-variant rhel9-unknown
|