Skip to content

Commit

Permalink
Changed the autogenerated name, updated
Browse files Browse the repository at this point in the history
build paths and use cpus instead of cores.
  • Loading branch information
alanbach committed Dec 11, 2023
1 parent a3d0071 commit 86f9c8e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions windows/windows.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ variable "iso_path" {
default = ""
}

source "qemu" "autogenerated_1" {
source "qemu" "windows_builder" {
accelerator = "kvm"
boot_command = ["<wait2s><enter><wait>"]
boot_wait = "-1s"
Expand All @@ -19,17 +19,18 @@ 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"
vnc_bind_address = "0.0.0.0"
}

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" {
Expand Down

0 comments on commit 86f9c8e

Please sign in to comment.