diff --git a/windows/windows.pkr.hcl b/windows/windows.pkr.hcl index 48c75ac9..49665ba1 100644 --- a/windows/windows.pkr.hcl +++ b/windows/windows.pkr.hcl @@ -3,7 +3,7 @@ variable "iso_path" { default = "" } -source "qemu" "autogenerated_1" { +source "qemu" "windows_builder" { accelerator = "kvm" boot_command = [""] boot_wait = "-1s" @@ -19,6 +19,7 @@ source "qemu" "autogenerated_1" { iso_url = "${var.iso_path}" machine_type = "q35" memory = "4096" + cpus = "2" net_device = "e1000" qemuargs = [["-serial", "stdio"], ["-bios", "/usr/share/OVMF/OVMF_CODE.fd"]] shutdown_timeout = "45m" @@ -26,10 +27,10 @@ source "qemu" "autogenerated_1" { } build { - sources = ["source.qemu.autogenerated_1"] + sources = ["source.qemu.windows_builder"] post-processor "shell-local" { - inline = ["echo 'Syncing output-qemu/packer-qemu...'", "sync -f output-qemu/packer-qemu", "IMG_FMT=raw", "source scripts/setup-nbd", "TMP_DIR=$(mktemp -d /tmp/packer-maas-XXXX)", "echo 'Adding curtin-hooks to image...'", "mount -t ntfs $${nbd}p3 $TMP_DIR", "mkdir -p $TMP_DIR/curtin", "cp ./curtin/* $TMP_DIR/curtin/", "sync -f $TMP_DIR/curtin", "umount $TMP_DIR", "qemu-nbd -d $nbd", "rmdir $TMP_DIR"] + inline = ["echo 'Syncing output-windows_builder/packer-windows_builder...'", "sync -f output-windows_builder/packer-windows_builder", "IMG_FMT=raw", "source scripts/setup-nbd", "TMP_DIR=$(mktemp -d /tmp/packer-maas-XXXX)", "echo 'Adding curtin-hooks to image...'", "mount -t ntfs $${nbd}p3 $TMP_DIR", "mkdir -p $TMP_DIR/curtin", "cp ./curtin/* $TMP_DIR/curtin/", "sync -f $TMP_DIR/curtin", "umount $TMP_DIR", "qemu-nbd -d $nbd", "rmdir $TMP_DIR"] inline_shebang = "/bin/bash -e" } post-processor "compress" {