The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxc-ci/pull/125
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) === Signed-off-by: Thomas Hipp <thomas.h...@canonical.com>
From e09e1dbdbe7f21dbe134db30208c926848d1947b Mon Sep 17 00:00:00 2001 From: Thomas Hipp <thomas.h...@canonical.com> Date: Wed, 4 Mar 2020 14:29:28 +0100 Subject: [PATCH] images/centos: Add CentOS VM support Signed-off-by: Thomas Hipp <thomas.h...@canonical.com> --- images/centos.yaml | 106 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) diff --git a/images/centos.yaml b/images/centos.yaml index 054fa14..d530dc1 100644 --- a/images/centos.yaml +++ b/images/centos.yaml @@ -327,6 +327,9 @@ files: path: /etc/hosts generator: hosts + - path: /etc/machine-id + generator: dump + - name: ifcfg-eth0 path: /etc/sysconfig/network-scripts/ifcfg-eth0 generator: dump @@ -375,6 +378,26 @@ files: releases: - 8 - 8-Stream + types: + - container + + - name: ifcfg-enp5s0 + path: /etc/sysconfig/network-scripts/ifcfg-enp5s0 + generator: dump + templated: true + content: |- + DEVICE=enp5s0 + BOOTPROTO=dhcp + ONBOOT=yes + HOSTNAME=LXC_NAME + TYPE=Ethernet + MTU= + DHCP_HOSTNAME=`cat /proc/sys/kernel/hostname` + releases: + - 8 + - 8-Stream + types: + - vm - name: ifcfg-eth0.lxd path: /etc/sysconfig/network-scripts/ifcfg-eth0 @@ -390,6 +413,51 @@ files: releases: - 8 - 8-Stream + types: + - container + + - name: ifcfg-enp5s0.lxd + path: /etc/sysconfig/network-scripts/ifcfg-enp5s0 + generator: template + content: |- + DEVICE=enp5s0 + BOOTPROTO=dhcp + ONBOOT=yes + HOSTNAME={{ container.name }} + TYPE=Ethernet + MTU= + DHCP_HOSTNAME=`cat /proc/sys/kernel/hostname` + releases: + - 8 + - 8-Stream + types: + - vm + + - path: /etc/default/grub + generator: dump + content: |- + # Set the recordfail timeout + GRUB_RECORDFAIL_TIMEOUT=0 + # Do not wait on grub prompt + GRUB_TIMEOUT=0 + # Set the default commandline + GRUB_CMDLINE_LINUX_DEFAULT="console=tty1 console=ttyS0" + # Set the grub console type + GRUB_TERMINAL=console + # Disable os-prober + GRUB_DISABLE_OS_PROBER=true + types: + - vm + + - path: /etc/dracut.conf.d/lxd.conf + generator: dump + content: |- + add_drivers+="virtio_scsi virtio_pci virtio_console" + types: + - vm + - generator: fstab + types: + - vm - name: override.conf path: /etc/systemd/system/NetworkManager.service.d/override.conf @@ -468,6 +536,10 @@ files: variants: - cloud + - generator: lxd-agent + types: + - vm + packages: manager: yum update: true @@ -501,7 +573,25 @@ packages: variants: - cloud + - packages: + - grub2-efi + - kernel-plus + - shim + action: install + types: + - vm + actions: + - trigger: post-unpack + action: |- + #!/bin/sh + set -eux + + # Enable the centosplus repo which has a kernel with 9p support + sed -i 's/^enabled=0/enabled=1/' /etc/yum.repos.d/CentOS-Base.repo + types: + - vm + - trigger: post-packages action: |- #!/bin/sh @@ -513,3 +603,19 @@ actions: # Disable loginuid in PAM stack sed -i '/^session.*pam_loginuid.so/s/^session/# session/' /etc/pam.d/* + + + - trigger: post-files + action: |- + #!/bin/sh + set -eux + + # Regenerate initramfs + kver=$(ls /boot/initramfs-*.img | sed -r 's#.*initramfs-(.+)\.img#\1#') + dracut --kver "${kver}" -f + + target="$(readlink -f /etc/grub2-efi.cfg)" + grub2-mkconfig -o "${target}" + sed -i "s#root=[^ ]*#root=/dev/sda2#g" "${target}" + types: + - vm
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel