-
Notifications
You must be signed in to change notification settings - Fork 0
/
gentoo.json
99 lines (99 loc) · 3.56 KB
/
gentoo.json
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
{
"variables": {
"output_dir": "output-gentoo-local"
},
"provisioners": [
{
"type": "shell",
"script": "scripts/ansible.sh"
},
{
"type": "ansible-local",
"command": "/tmp/bootstrap/ansible/bin/ansible-playbook",
"playbook_dir": "ansible",
"playbook_file": "ansible/prep.yml",
"inventory_file": "ansible/inventory"
},
{
"type": "shell",
"inline": [
"mkdir -p /mnt/gentoo/usr/portage/packages",
"mkdir -p /mnt/gentoo/usr/portage/distfiles"
]
},
{ "type": "file", "source": "packages/", "destination": "/mnt/gentoo/usr/portage/packages/" },
{ "type": "file", "source": "distfiles/", "destination": "/mnt/gentoo/usr/portage/distfiles/" },
{
"type": "ansible-local",
"command": "/tmp/bootstrap/ansible/bin/ansible-playbook",
"playbook_dir": "ansible",
"playbook_file": "ansible/chroot.yml",
"inventory_file": "ansible/inventory"
},
{ "type": "shell-local", "command": "rm -rf packages/*" },
{ "type": "shell-local", "command": "rm -rf distfiles/*" },
{ "type": "file", "direction": "download", "source": "/mnt/gentoo/usr/portage/packages/", "destination": "packages/" },
{ "type": "file", "direction": "download", "source": "/mnt/gentoo/usr/portage/distfiles/", "destination": "distfiles/" },
{ "type": "shell-local", "command": "mv packages/packages/* packages/. && rm -rf packages/packages" },
{ "type": "shell-local", "command": "mv distfiles/distfiles/* distfiles/. && rm -rf distfiles/distfiles" },
{
"type": "shell",
"inline": [
"rm /mnt/gentoo/stage3* ; rm /mnt/gentoo/portage-latest.tar.bz2",
"rm -rf /mnt/gentoo/usr/portage; mkdir /mnt/gentoo/usr/portage; true",
"unset HISTFILE",
"rm -f /mnt/gentoo/root/.bash_history",
"rm -f /mnt/gentoo/home/vagrant/.bash_history",
"find /mnt/gentoo/var/log -type f | while read f; do echo -ne '' > $f; done;",
"count=`df --sync -kP /mnt/gentoo | tail -n1 | awk -F ' ' '{print $4}'`; let count-- ; dd if=/dev/zero of=/mnt/gentoo/tmp/whitespace bs=1024 count=$count; rm /mnt/gentoo/tmp/whitespace;",
"sync && shutdown -h now"
]
}
],
"builders": [
{
"type": "virtualbox-iso",
"output_directory": "{{ user `output_dir` }}",
"boot_command": [
"<enter><wait10><enter><wait10><wait10>passwd<enter>vagrant<enter>vagrant<enter>/etc/init.d/sshd start<enter>"
],
"boot_wait": "10s",
"disk_size": 8192,
"guest_os_type": "Gentoo_64",
"headless": true,
"http_directory": "http",
"iso_urls": [
"http://distfiles.gentoo.org/releases/amd64/autobuilds/20190915T214502Z/install-amd64-minimal-20190915T214502Z.iso"
],
"iso_checksum_type": "sha512",
"iso_checksum": "0caaf59b081ad6a7acfb1ec9aeb017d209f7b38032970d86358e4da526a0746076035aded4eb86882de0226494bc91be36e1547a968a88de16c1d4168465f6b8",
"ssh_username": "root",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_wait_timeout": "10000s",
"guest_additions_path": "VBoxGuestAdditions.iso",
"virtualbox_version_file": ".vbox_version",
"vm_name": "packer-gentoo-x86_64",
"vboxmanage": [
[
"modifyvm",
"{{.Name}}",
"--memory",
"8192"
],
[
"modifyvm",
"{{.Name}}",
"--cpus",
"2"
]
]
}
],
"post-processors": [
{
"output": "builds/{{.Provider}}-gentoo.box",
"type": "vagrant"
}
]
}