aboutsummaryrefslogtreecommitdiffstats
path: root/openbsd-image/openbsd-arm64.pkr.hcl
diff options
context:
space:
mode:
Diffstat (limited to 'openbsd-image/openbsd-arm64.pkr.hcl')
-rw-r--r--openbsd-image/openbsd-arm64.pkr.hcl51
1 files changed, 51 insertions, 0 deletions
diff --git a/openbsd-image/openbsd-arm64.pkr.hcl b/openbsd-image/openbsd-arm64.pkr.hcl
new file mode 100644
index 0000000..dbe5833
--- /dev/null
+++ b/openbsd-image/openbsd-arm64.pkr.hcl
@@ -0,0 +1,51 @@
+source "qemu" "openbsd-arm64" {
+ vm_name = "openbsd-${var.version}-aarch64.qcow2"
+ iso_url = "${var.mirror}/pub/OpenBSD/${var.version}/${var.arch}/install${local.version_short}.iso"
+ iso_checksum = "file:${var.mirror}/pub/OpenBSD/${var.version}/${var.arch}/SHA256"
+ output_directory = "build"
+ qemu_binary = "qemu-system-aarch64"
+ machine_type = "virt"
+ cpu_model = "host"
+ accelerator = "hvf"
+ memory = var.memory
+ disk_interface = "virtio"
+ disk_size = "${var.disk_size}G"
+ disk_compression = true
+ format = "qcow2"
+ ssh_username = "root"
+ ssh_password = local.root_password
+ ssh_timeout = "10m"
+
+ http_content = {
+ "/install.conf" = templatefile("${path.root}/templates/install.conf.pkrtpl.hcl", {
+ hostname = var.hostname
+ user = var.admin_user
+ ssh_key = var.ssh_public_key
+ root_password = local.root_password
+ mirror = var.mirror
+ version = var.version
+ version_short = local.version_short
+ arch = var.arch
+ })
+ }
+
+ boot_command = [
+ "<wait>S<enter><wait>",
+ "set tty com0<enter><wait>",
+ "autoinstall<enter><wait>",
+ "http://{{ .HTTPIP }}:{{ .HTTPPort }}/install.conf<enter>",
+ ]
+ boot_wait = "20s"
+ shutdown_command = "shutdown -p now"
+ use_default_display = true
+ headless = false
+ qemuargs = [
+ ["-device", "qemu-xhci,id=xhci"],
+ ["-device", "usb-kbd,bus=xhci.0"],
+ ["-device", "virtio-gpu-pci"],
+ ["-display", "cocoa"],
+ ]
+ efi_firmware_code = "/opt/homebrew/share/qemu/edk2-aarch64-code.fd"
+ efi_firmware_vars = "./edk2-arm-vars.fd"
+}
+