-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathvm.arm64.pkr.hcl
71 lines (63 loc) · 1.63 KB
/
vm.arm64.pkr.hcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# rocky-linux-packer.pkr.hcl
# Required Packer version
packer {
required_version = ">= 1.7.0"
required_plugins {
qemu = {
version = ">= 1.0.0"
source = "github.com/hashicorp/qemu"
}
}
}
variable "display" {
type = string
default = "none"
}
variable "output_directory" {
type = string
default = "./output/image-arm64"
}
# Define the source image builder - for QEMU
source "qemu" "rocky_linux" {
iso_url = "https://download.rockylinux.org/pub/rocky/9.5/isos/aarch64/Rocky-9.5-aarch64-minimal.iso"
iso_checksum = "sha256:5bd7a6bd90ae54c9f9e4c2e8c957b33fb61fbffcede251fe73f0b0beb42fd9ca"
qemu_binary = "qemu-system-aarch64"
output_directory = var.output_directory
http_directory = "."
cores = 8
disk_size = "40960"
memory = "2048"
cpu_model = "host"
qemuargs = [
["-display", var.display],
["-machine", "type=virt,accel=hvf,highmem=off"],
["-bios", "/opt/homebrew/share/qemu/edk2-aarch64-code.fd"],
[ "-device", "ramfb" ],
[ "-device", "qemu-xhci" ],
[ "-device", "usb-kbd" ],
[ "-boot", "d" ],
]
ssh_port = 22
ssh_password = "rocky"
ssh_username = "root"
ssh_timeout = "30m"
headless = false
ssh_wait_timeout = "30m"
shutdown_command = "/sbin/halt -h -p"
boot_wait = "7s"
boot_command = [
"<up>e<down><down><end>",
" inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/http/ks.cfg",
"<f10>"
]
}
# Provision with an external shell script
build {
sources = ["source.qemu.rocky_linux"]
provisioner "shell" {
script = "install.sh"
}
provisioner "shell" {
script = "preset.sh"
}
}