Commit f40baa17 authored by Peter Hutterer's avatar Peter Hutterer
Browse files

Make the ubuntu_versions more generic



Make it verison_map even though no other distribution is likely to ever need
this. And stop using it as indicator for custom mkosi setup, split that out
into a new qemu.finalize step.
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 9e3d80e5
......@@ -32,6 +32,17 @@ example:
## latest, etc.)
versions: []
## @version_map: A dictionary to use for package source lookups
##
## This is needed where a version cannot be used for package repositories.
## e.g. 19.10 does not resolve, Ubuntu needs to use 'Eoan' instead
##
## Currently only supported for/used by ubuntu
version_map:
'v1': 'funny name'
'v2': 'even funnier name'
'v3': 'oh how we laughed'
## @package_type: The package type supported by the distribution
##
## This has no "real" effect but to use debs on debian/ubuntu and rpms on
......@@ -82,3 +93,13 @@ example:
## if this variable is not defined, the matching qemu template will not
## be generated
packages: []
## @finalize: The list of commands that are used to finalize the mkosi
## setup before finishing the qemu image.
##
## In this step, the following files are available:
## - mkosi.default: the mkosi configuration file
## - mkosi.extra/: a directory for extra configuration, see mkosi(1)
##
## This needs to be a list
finalize: []
......@@ -367,12 +367,12 @@
- /bin/bash /app/vmctl start -cdrom /app/my-seed.iso
- QEMU_VERSION=$FDO_DISTRIBUTION_VERSION
{% if ubuntu_versions %}
{% if version_map %}
# for ubuntu, we need to use the name, not the number
- |
declare -A versions
{% for key, value in ubuntu_versions.items() %}
{% for key, value in version_map.items() %}
versions["{{key}}"]={{value.lower()}}
{% endfor %}
- if [[ x"${versions[$FDO_DISTRIBUTION_VERSION]}" != x"" ]] ;
......@@ -413,16 +413,11 @@
- chmod 700 mkosi.extra/root/.ssh
- cp /root/.ssh/id_rsa_target.pub mkosi.extra/root/.ssh/authorized_keys
- chmod 600 mkosi.extra/root/.ssh/authorized_keys
{% if ubuntu_versions %}
# ubuntu disables NetworkManager through /usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf
# overwrite it in /etc to allow NM to manage ens3
- mkdir -p mkosi.extra/etc/NetworkManager/conf.d/
- touch mkosi.extra/etc/NetworkManager/conf.d/10-globally-managed-devices.conf
{% endif %}
# enable sshd on the target
- mkdir -p mkosi.extra/etc/systemd/system/multi-user.target.wants
{% for cmd in qemu.finalize %}
- {{cmd}}
{% endfor %}
# send the mkosi files to the VM
- scp mkosi.default vm:/root/mkosi.default
......
......@@ -35,7 +35,13 @@ ubuntu:
- iproute2
- git
ubuntu_versions:
finalize:
# ubuntu disables NetworkManager through /usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf
# overwrite it in /etc to allow NM to manage ens3
- mkdir -p mkosi.extra/etc/NetworkManager/conf.d/
- touch mkosi.extra/etc/NetworkManager/conf.d/10-globally-managed-devices.conf
version_map:
'4.10': Warty
'5.04': Hoary
'5.10': Breezy
......
......@@ -376,7 +376,6 @@
- chmod 700 mkosi.extra/root/.ssh
- cp /root/.ssh/id_rsa_target.pub mkosi.extra/root/.ssh/authorized_keys
- chmod 600 mkosi.extra/root/.ssh/authorized_keys
# enable sshd on the target
- mkdir -p mkosi.extra/etc/systemd/system/multi-user.target.wants
......
......@@ -367,7 +367,6 @@
- chmod 700 mkosi.extra/root/.ssh
- cp /root/.ssh/id_rsa_target.pub mkosi.extra/root/.ssh/authorized_keys
- chmod 600 mkosi.extra/root/.ssh/authorized_keys
# enable sshd on the target
- mkdir -p mkosi.extra/etc/systemd/system/multi-user.target.wants
......
......@@ -417,14 +417,10 @@
- chmod 700 mkosi.extra/root/.ssh
- cp /root/.ssh/id_rsa_target.pub mkosi.extra/root/.ssh/authorized_keys
- chmod 600 mkosi.extra/root/.ssh/authorized_keys
# ubuntu disables NetworkManager through /usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf
# overwrite it in /etc to allow NM to manage ens3
- mkdir -p mkosi.extra/etc/NetworkManager/conf.d/
- touch mkosi.extra/etc/NetworkManager/conf.d/10-globally-managed-devices.conf
# enable sshd on the target
- mkdir -p mkosi.extra/etc/systemd/system/multi-user.target.wants
- mkdir -p mkosi.extra/etc/NetworkManager/conf.d/
- touch mkosi.extra/etc/NetworkManager/conf.d/10-globally-managed-devices.conf
# send the mkosi files to the VM
- scp mkosi.default vm:/root/mkosi.default
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment