-
Notifications
You must be signed in to change notification settings - Fork 0
/
qemu-raspberry-armv7.pkr.hcl
60 lines (54 loc) · 1.32 KB
/
qemu-raspberry-armv7.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
data "sshkey" "armv7" {
}
source "qemu" "armv7" {
headless = "true"
vm_name = "archlinux-raspberry-armv7.img"
cpus = 4
memory = 4096
format = "raw"
disk_size = "3000"
iso_url = "https://mir.archlinux.fr/iso/latest/archlinux-x86_64.iso"
iso_checksum = "file:https://mir.archlinux.fr/iso/latest/sha256sums.txt"
ssh_username = "root"
ssh_private_key_file = data.sshkey.armv7.private_key_path
ssh_wait_timeout = "60m"
boot_wait = "3s"
boot_key_interval = "10ms"
boot_command = [
"<enter>",
"<wait120>",
"echo '${data.sshkey.armv7.public_key}' > ~/.ssh/authorized_keys",
"<enter>"
]
shutdown_command = "shutdown -P now"
output_directory = "dist/armv7"
}
build {
sources = ["source.qemu.armv7"]
provisioner "ansible" {
playbook_file = "setup.yml"
ansible_env_vars = [
"ANSIBLE_FORCE_COLOR=1"
]
extra_arguments = [
"-D",
"--scp-extra-args", "'-O'",
"-e arch=armv7"
]
}
provisioner "file" {
source = "/mnt/boot/bcm2709-rpi-2-b.dtb"
destination = "dist/armv7/"
direction = "download"
}
provisioner "file" {
source = "/mnt/boot/kernel7.img"
destination = "dist/armv7/"
direction = "download"
}
provisioner "file" {
source = "/mnt/boot/initramfs-linux.img"
destination = "dist/armv7/"
direction = "download"
}
}