-
Notifications
You must be signed in to change notification settings - Fork 2
/
image.yaml
110 lines (93 loc) · 2.79 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
{{- $architecture := or .architecture "armhf" -}}
{{- $family := or .family "sunxi" }}
{{- $device := or .device "pinephone" }}
{{- $partitiontable := or .partitiontable "gpt" }}
{{- $filesystem := or .filesystem "ext4" }}
{{- $environment := or .environment "phosh" -}}
{{- $image := or .image "mobian" -}}
{{- $imagesize := or .imagesize "4GB" }}
{{- $miniramfs := or .miniramfs "false" }}
{{- $zram := or .zram "false" -}}
{{- $bootstart := or .bootstart "1MiB" }}
{{- $nonfree := or .nonfree "false" -}}
{{- $rootfs := or .rootfs "rootfs.tar.gz" }}
{{- $password := or .password "1234" -}}
{{- $crypt_password := or .crypt_password $password -}}
{{- $crypt_root := or .crypt_root "false" -}}
architecture: {{ $architecture }}
actions:
- action: unpack
file: {{ $rootfs }}
{{ if eq $nonfree "true" }}
- action: run
description: Enable non-free-firmware Debian repo
chroot: true
command: sed -i 's/main$/main non-free-firmware/g' /etc/apt/sources.list
{{ end }}
- action: recipe
recipe: include/partition-{{ $partitiontable }}.yaml
variables:
bootstart: {{ $bootstart }}
filesystem: {{ $filesystem }}
image: {{ $image }}
imagesize: {{ $imagesize }}
installer: "false"
- action: filesystem-deploy
description: Deploy filesystem onto image
{{ if eq $crypt_root "true" }}
setup-fstab: false
- action: run
description: Encrypt root filesystem
label: setup-luks
script: scripts/setup-luks.sh {{ $password }}
- action: recipe
recipe: include/packages-fde.yaml
{{ end }}
{{ if eq $filesystem "f2fs" }}
- action: apt
recommends: false
description: Install F2FS tools
packages:
- f2fs-tools
{{ end }}
{{ if eq $zram "true" }}
- action: run
description: setup zram (fstab)
chroot: true
script: scripts/setup-zram-mounts.sh
{{ end }}
- action: recipe
recipe: devices/{{ $family }}/packages-base.yaml
variables:
device: {{ $device }}
nonfree: {{ $nonfree }}
- action: recipe
recipe: devices/{{ $family }}/packages-{{ $environment }}.yaml
variables:
device: {{ $device }}
{{ if eq $miniramfs "true" }}
- action: apt
recommends: true
description: install miniramfs
packages:
- miniramfs
- action: run
description: Create miniramfs
chroot: true
command: /usr/sbin/update-miniramfs -u
- action: run
description: Export miniramfs
chroot: false
command: cp ${ROOTDIR}/boot/miniramfs ${ARTIFACTDIR}/{{ $image }}.miniramfs
{{ end }}
- action: run
description: Cleanup filesystem
chroot: true
script: scripts/rootfs-cleanup.sh
- action: recipe
recipe: devices/{{ $family }}/bootloader.yaml
variables:
device: {{ $device }}
image: {{ $image }}
bootstart: {{ $bootstart }}
miniramfs: {{ $miniramfs }}