Skip to content

Commit 5bca8d7

Browse files
committed
add support for testing the uefi image flavor
1 parent 306d203 commit 5bca8d7

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"-v=${localEnv:HOME}/.ssh/id_rsa:/home/vscode/.ssh/id_rsa:ro",
88
"-v=${localEnv:HOME}/.ssh/id_rsa.pub:/home/vscode/.ssh/id_rsa.pub:ro",
99
"-v=${localEnv:HOME}/.vagrant.d:/home/vscode/.vagrant.d:ro",
10+
"-v=/usr/share/ovmf:/usr/share/ovmf:ro",
1011
"--device=/dev/kvm"
1112
],
1213
"postCreateCommand": "bash .devcontainer/setup.sh",

test.pkr.hcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ source "qemu" "test" {
2929
cpus = 2
3030
memory = 4096
3131
qemuargs = [
32+
strcontains(var.disk_image, "uefi") ? ["-bios", "/usr/share/ovmf/OVMF.fd"] : null,
3233
["-cpu", "host"],
3334
["-device", "qemu-xhci"],
3435
["-device", "virtio-tablet"],

test.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,13 @@ export PACKER_LOG=1
2424
export PACKER_LOG_PATH=test.log
2525
export PACKER_CONFIG_DIR="$PWD/dist/test"
2626
export PACKER_PLUGIN_PATH="$PWD/dist/test/plugins"
27-
export PKR_VAR_disk_image=~/.vagrant.d/boxes/windows-2022-amd64/0.0.0/libvirt/box_0.img
28-
#export PKR_VAR_disk_image=~/.vagrant.d/boxes/windows-11-23h2-amd64/0.0.0/libvirt/box_0.img
27+
28+
#export PKR_VAR_disk_image=~/.vagrant.d/boxes/windows-11-24h2-amd64/0.0.0/libvirt/box_0.img
29+
#export PKR_VAR_disk_image=~/.vagrant.d/boxes/windows-2022-amd64/0.0.0/libvirt/box_0.img
30+
#export PKR_VAR_disk_image=~/.vagrant.d/boxes/windows-2025-amd64/0.0.0/libvirt/box_0.img
31+
#export PKR_VAR_disk_image=~/.vagrant.d/boxes/windows-11-24h2-uefi-amd64/0.0.0/libvirt/box_0.img
32+
export PKR_VAR_disk_image=~/.vagrant.d/boxes/windows-2022-uefi-amd64/0.0.0/libvirt/box_0.img
33+
#export PKR_VAR_disk_image=~/.vagrant.d/boxes/windows-2025-uefi-amd64/0.0.0/libvirt/box_0.img
2934

3035
packer init -only=qemu.test test.pkr.hcl
3136
packer build -only=qemu.test -on-error=abort test.pkr.hcl

0 commit comments

Comments
 (0)