36 lines
1.1 KiB
Bash
36 lines
1.1 KiB
Bash
|
#!/bin/sh
|
||
|
|
||
|
#
|
||
|
# Prepare a (Debian/Ubuntu) host to build a KVM qcow image from Githubs
|
||
|
# runner-images repo patched for KVM. Run this as root.
|
||
|
# Depending on the resources of your host and download speed, this will take
|
||
|
# between 30 and 120 minutes.
|
||
|
#
|
||
|
|
||
|
HERE="$(pwd)"
|
||
|
|
||
|
# install prerequiste pacakges
|
||
|
apt install cloud-init git qemu-utils qemu-system-x86 tmux unzip
|
||
|
|
||
|
# install packer, 1.9.5 is the latest release still under MPL
|
||
|
if which packer >/dev/null; then
|
||
|
echo "Packer already installed"
|
||
|
else
|
||
|
wget https://releases.hashicorp.com/packer/1.9.5/packer_1.9.5_linux_amd64.zip
|
||
|
unzip packer_1.9.5_linux_amd64.zip
|
||
|
cp packer /usr/local/bin
|
||
|
chmod +x /usr/local/bin/packer
|
||
|
rm packer packer_*_linux_amd64.zip
|
||
|
fi
|
||
|
|
||
|
# clone repo
|
||
|
git clone -b ubuntu24/20240714.1 https://github.com/fffonion/runner-images-kvm
|
||
|
|
||
|
# run build
|
||
|
cd runner-images-kvm/images/ubuntu/templates
|
||
|
packer init ubuntu-24.04.pkr.hcl
|
||
|
packer build ubuntu-24.04.pkr.hcl
|
||
|
cd ${HERE}
|
||
|
mv runner-images-kvm/images/ubuntu/templates/output-custom_image/ubuntu-24.04 github-runner-image-ubuntu-24.04.qcow
|
||
|
rm -r runner-images-kvm
|