Skip to content

Commit a8fd161

Browse files
committed
Add host emulation file
1 parent 8fad6e9 commit a8fd161

File tree

1 file changed

+95
-0
lines changed

1 file changed

+95
-0
lines changed

packer/ubuntu-kvm-amd64host.json

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

0 commit comments

Comments
 (0)