Skip to content

Commit 8fad6e9

Browse files
committed
Add support for AARCH64 builds via QEMU
1 parent dcc0369 commit 8fad6e9

File tree

1 file changed

+94
-0
lines changed

1 file changed

+94
-0
lines changed

packer/ubuntu-kvm.json

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
{
2+
"min_packer_version": "1.7.1",
3+
"variables": {
4+
"vm_name": "JMU Linux Mint",
5+
"semester": "Fa21",
6+
"version": "20",
7+
8+
"build_id": "{{isotime \"2006-01-02\"}}",
9+
10+
"git_repo": "https://github.com/jmunixusers/cs-vm-build",
11+
"git_branch": "main",
12+
13+
"headless": "false",
14+
15+
"output_dir": "{{pwd}}/artifacts_mint",
16+
"mirror_url": "http://cdimage.ubuntu.com/focal/daily-live/current",
17+
"iso_file": "focal-desktop-arm64.iso",
18+
19+
"ssh_user": "oem",
20+
"ssh_pass": "oem"
21+
},
22+
"builders": [
23+
{
24+
"type": "qemu",
25+
"headless": "{{user `headless`}}",
26+
"cpus": 2,
27+
"accelerator": "kvm",
28+
"memory": 4096,
29+
"machine_type": "virt",
30+
"firmware": "/usr/share/qemu-efi-aarch64/QEMU_EFI.fd",
31+
"qemu_binary": "qemu-system-aarch64",
32+
"qemuargs": [
33+
[ "-boot", "strict=off" ],
34+
[ "-vga", "vmware" ],
35+
[ "-cpu", "host" ],
36+
[ "-display", "gtk" ],
37+
[ "-device", "virtio-rng-pci" ],
38+
[ "-device", "virtio-gpu-pci" ],
39+
[ "-device", "nec-usb-xhci,id=xhci" ],
40+
[ "-device", "usb-kbd,bus=xhci.0" ],
41+
[ "-device", "usb-tablet,bus=xhci.0" ]
42+
],
43+
"iso_url": "{{user `mirror_url`}}/{{user `iso_file`}}",
44+
"iso_checksum": "file:{{user `mirror_url`}}/SHA256SUMS",
45+
"output_directory": "{{user `output_dir`}}",
46+
"shutdown_command": "echo -e \"{{user `ssh_pass`}}\\n\" | sudo -S poweroff",
47+
"disk_compression": "true",
48+
"disk_size": "20G",
49+
"disk_discard": "unmap",
50+
"disk_detect_zeroes": "unmap",
51+
"format": "qcow2",
52+
"http_directory": "http",
53+
"ssh_username": "{{user `ssh_user`}}",
54+
"ssh_password": "{{user `ssh_pass`}}",
55+
"ssh_timeout": "100m",
56+
"vm_name": "{{user `vm_name`}} {{user `semester`}}",
57+
"net_device": "virtio-net",
58+
"disk_interface": "virtio",
59+
"boot_wait": "15s",
60+
"boot_command": [
61+
"c<wait><wait>",
62+
"linux /casper/vmlinuz",
63+
" auto url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/oem-preseed.cfg",
64+
" automatic-ubiquity only-ubiquity",
65+
" debug-ubiquity oem-config/enable=true",
66+
" keymap=us fsck.mode=skip",
67+
" noprompt splash --<enter><wait><wait>",
68+
"initrd /casper/initrd ",
69+
"<enter>boot<enter>"
70+
]
71+
}
72+
],
73+
"provisioners": [{
74+
"type": "shell",
75+
"execute_command": "echo 'oem' | sudo -S sh -c '{{ .Vars }} {{ .Path }}'",
76+
"inline": [
77+
"while(pgrep -a apt-get); do sleep 1; done",
78+
"export DEBIAN_FRONTEND=noninteractive",
79+
"apt-get update",
80+
"apt-get install -y git ansible aptitude",
81+
"git clone -b {{user `git_branch`}} {{user `git_repo`}}",
82+
"cd /home/oem/cs-vm-build/scripts",
83+
"./oem-build",
84+
"/usr/sbin/oem-config-prepare"
85+
]
86+
}],
87+
"post-processors": [
88+
{
89+
"type": "checksum",
90+
"checksum_types": "sha256",
91+
"output": "{{user `output_dir`}}/image-{{user `semester` | lower }}.{{.ChecksumType}}sum"
92+
}
93+
]
94+
}

0 commit comments

Comments
 (0)