From 6b19a145f708c4289d1136d1c5b7c8bd150bb1c9 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Fri, 27 May 2022 09:07:08 -0500 Subject: [PATCH] Add qemu_accelerator option --- .github/workflows/build.yml | 2 +- sources/inputs.pkr.hcl | 5 +++++ sources/qemu.pkr.hcl | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e849bac..8977f64 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,7 +48,7 @@ jobs: shell: bash run: | set -e - ./packerio build -var-file=${{ matrix.distro }} -except=upload sources + ./packerio build -var-file=${{ matrix.distro }} -var "qemu_accelerator=none" -except=upload sources env: VAGRANT_CLOUD_TOKEN: ${{ secrets.VAGRANT_CLOUD_TOKEN }} PACKER_LOG: 1 diff --git a/sources/inputs.pkr.hcl b/sources/inputs.pkr.hcl index 289d130..e941ea5 100644 --- a/sources/inputs.pkr.hcl +++ b/sources/inputs.pkr.hcl @@ -62,6 +62,11 @@ variable "vagrant_cloud_token" { default = env("VAGRANT_CLOUD_TOKEN") } +variable "qemu_accelerator" { + type = string + default = "kvm" +} + locals { name = "${var.distro}-${var.version}-${var.arch}" build = formatdate("YYYYMMDDhh", timestamp()) diff --git a/sources/qemu.pkr.hcl b/sources/qemu.pkr.hcl index 6995cde..d0daa67 100644 --- a/sources/qemu.pkr.hcl +++ b/sources/qemu.pkr.hcl @@ -12,7 +12,7 @@ source "qemu" "x86_64" { boot_command = var.boot_command http_directory = "http" ssh_handshake_attempts = var.ssh_handshake_attempts - accelerator = "kvm" + accelerator = var.qemu_accelerator cpus = 2 memory = 2048 qemuargs = [["-serial", "stdio"]]