-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmageia.yaml
259 lines (222 loc) · 4.82 KB
/
mageia.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
image:
distribution: mageia
source:
downloader: rootfs-http
url: file:///home/runner/actions-runner/_work/image-mageia/image-mageia/mageia.sqfs
skip_verification: true
targets:
lxc:
create_message: |
You just created a {{ image.distribution }} container.
config:
- type: all
before: 5
content: |-
lxc.include = LXC_TEMPLATE_CONFIG/mageia.common.conf
- type: user
before: 5
content: |-
lxc.include = LXC_TEMPLATE_CONFIG/mageia.userns.conf
- type: all
after: 4
content: |-
lxc.include = LXC_TEMPLATE_CONFIG/common.conf
- type: user
after: 4
content: |-
lxc.include = LXC_TEMPLATE_CONFIG/userns.conf
- type: all
content: |-
lxc.arch = {{ image.architecture_kernel }}
incus:
vm:
size: 4294967296
filesystem: ext4
files:
- path: /etc/default/grub
generator: dump
content: |-
GRUB_RECORDFAIL_TIMEOUT=0
GRUB_TIMEOUT=0
GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT} console=tty1 console=ttyS0"
GRUB_TERMINAL=console
GRUB_DISABLE_OS_PROBER=true
types:
- vm
- path: /etc/dracut.conf.d/incus.conf
generator: dump
content: |-
add_drivers+=virtio_scsi
types:
- vm
- generator: fstab
types:
- vm
- path: /etc/machine-id
generator: dump
- path: /etc/fstab
generator: dump
types:
- container
- path: /var/lib/dbus/machine-id
generator: remove
- path: /etc/hostname
generator: hostname
- path: /etc/hosts
generator: hosts
- name: eth0.network
path: /etc/systemd/network/eth0.network
generator: dump
content: |-
[Match]
Name=eth0
[Network]
DHCP=ipv4
types:
- container
- name: enp5s0.network
path: /etc/systemd/network/enp5s0.network
generator: dump
content: |-
[Match]
Name=enp5s0
[Network]
DHCP=ipv4
types:
- vm
- name: meta-data
generator: cloud-init
variants:
- cloud
- name: network-config
generator: cloud-init
content: |-
{% if config_get("user.network-config", "") == "" %}version: 1
config:
- type: physical
name: {% if instance.type == "virtual-machine" %}enp5s0{% else %}eth0{% endif %}
subnets:
- type: {% if config_get("user.network_mode", "") == "link-local" %}manual{% else %}dhcp{% endif %}
control: auto
- type: dhcp6
control: auto{% else %}{{ config_get("user.network-config", "") }}{% endif %}
variants:
- cloud
- name: user-data
generator: cloud-init
variants:
- cloud
- name: vendor-data
generator: cloud-init
variants:
- cloud
- generator: incus-agent
types:
- vm
packages:
custom_manager:
install:
cmd: urpmi
flags:
- --no-recommends
- --auto
update:
cmd: urpmi
flags:
- --auto-update
remove:
cmd: urpme
flags:
- --auto-orphans
refresh:
cmd: urpmi.update
flags:
- -a
clean:
cmd: urpmi
flags:
- --clean
update: true
cleanup: true
sets:
- packages:
- file
- findutils
- gettext
- hardlink
- hostname
- ipcalc
- iproute
- iputils
- passwd
- policycoreutils
- procps-ng
- sudo
- which
action: install
early: true
- packages:
- cloud-init
- openssh-server
action: install
variants:
- cloud
- packages:
- cloud-utils-growpart
action: install
types:
- vm
variants:
- cloud
- packages:
- dracut
- kernel-server
- kmod
- libproxy-pacrunner
action: install
types:
- vm
actions:
- trigger: post-packages
action: |-
#!/bin/sh
umount -l /etc/resolv.conf || true
rm /etc/resolv.conf
ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
systemctl enable systemd-resolved
cp -R /etc/skel/.bash* /root/
systemctl enable systemd-networkd
- trigger: post-packages
action: |-
#!/bin/sh
systemctl enable cloud-init
systemctl enable cloud-config
systemctl enable cloud-final
variants:
- cloud
- trigger: post-unpack
action: |-
#!/bin/sh
systemd-machine-id-setup
types:
- vm
- trigger: post-files
action: |-
#!/bin/sh
# Enable verbose output
set -eux
# rsync fails when grub2-efi is installed through
# "packages" sections, but works when set here
urpmi grub2-efi --no-recommends
# Create grubx64 EFI image
grub2-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=mageia --removable
# Create grub config files
target="/boot/grub2/grub.cfg"
grub2-mkconfig -o "${target}"
# Hardcode rootfs device
sed -i "s#root=[^ ]*#root=/dev/sda2#g" "${target}"
# Regenerate initramfs
kver=$(ls -1 /boot/initrd-*.img | head -1 | sed -r 's#.*initrd-(.+)\.img#\1#')
dracut --kver "${kver}" --force
types:
- vm