-
Notifications
You must be signed in to change notification settings - Fork 0
/
image.yaml
87 lines (73 loc) · 2.18 KB
/
image.yaml
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
{{- $arch := .arch }}
{{- $format := .format }}
{{- $imagename := .imagename }}
{{- $imagesize := .imagesize }}
{{- $keep := .keep }}
{{- $variant := .variant }}
{{- $zip := .zip }}
architecture: {{ $arch }}
actions:
- description: "Setup the disk image"
action: image-partition
imagename: {{ $imagename }}.raw
imagesize: {{ $imagesize }}
partitiontype: msdos
partitions:
- name: root
fs: ext4
start: 2048s
end: 100%
flags: [ boot ]
mountpoints:
- mountpoint: /
partition: root
options: [ errors=remount-ro ]
- action: filesystem-deploy
setup-kernel-cmdline: false
- description: "Create a swap file"
action: run
chroot: true
script: scripts/create-swapfile.sh
- description: "Install the kernel & bootloader"
action: apt
recommends: true
packages: [ grub-pc, linux-image-generic ]
- description: "Setup GRUB"
action: run
chroot: true
command: grub-install "$IMAGE" && update-grub
- action: overlay
source: overlays/grub-install-devices
- description: "Install virtualization support for {{ $variant }}"
action: run
chroot: true
script: scripts/install-virt-support.sh {{ $variant }}
{{ if eq $variant "vmware" }}
- description: "Finish install for {{ $variant }}"
action: run
chroot: true
script: scripts/finish-install-vmware.sh
{{ end }}
- description: "Configure apt sources.list"
action: run
chroot: true
script: scripts/finish-install.sh apt-sources debconf usergroups
- description: "Final cleanup (from within)"
action: run
chroot: true
script: scripts/cleanup-in.sh
- description: "Final cleanup (from outside)"
action: run
chroot: false
script: scripts/cleanup-out.sh
{{ if eq $zip "true" }}
- description: "Fill unallocated blocks with zeroes"
action: run
chroot: false
script: scripts/zerofree.sh $IMAGE-part1
{{ end }}
- description: "Export to a {{ $format }} image"
label: "export-{{ $format }}"
action: run
postprocess: true
script: scripts/export-{{ $format }}.sh {{ if eq $keep "true" }}-k{{ end }} {{ if eq $zip "true" }}-z{{ end }} {{ $imagename }}