From 4682ed9a3aa35f714a876ae840ddf904fb01a922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Mon, 29 Jun 2020 17:46:48 +0200 Subject: [PATCH] More tuning to CentOS LUKS image --- .../centos-build-luks-opennebula-image.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/opennebula-images/centos-build-luks-opennebula-image.sh b/opennebula-images/centos-build-luks-opennebula-image.sh index fcd34c3..63effac 100755 --- a/opennebula-images/centos-build-luks-opennebula-image.sh +++ b/opennebula-images/centos-build-luks-opennebula-image.sh @@ -20,7 +20,7 @@ LUKS_PASSPHRASE=secret LUKS_DEVICE_NAME=cryptroot LUKS_DEVICE="/dev/mapper/$LUKS_DEVICE_NAME" -ONE_CONTEXT_RPM_URL="https://github.com/OpenNebula/addon-context-linux/releases/download/v5.10.0/one-context-5.10.0-1.el7.noarch.rpm" +ONE_CONTEXT_RPM_URL="https://github.com/OpenNebula/addon-context-linux/releases/download/v5.10.0/one-context-5.10.0-1.el$RELEASE.noarch.rpm" ONE_CONTEXT_RPM_PATH=/root/one-context.rpm cleanup() { @@ -81,10 +81,12 @@ mkdir /mnt/boot mount "${LOOPBACK_DEVICE}p1" /mnt/boot # AppStream landed in CentOS 8. -if [ $RELEASE >= 8 ]; then +if [ $RELEASE -ge 8 ]; then enabled_repos="--enablerepo=BaseOS --enablerepo=AppStream --enablerepo=extras" + release_specific_packages="systemd-udev" else - enabled_repos="--enablerepo=Base --enablerepo=extras" + enabled_repos="--enablerepo=base --enablerepo=extras" + release_specific_packages="dnf" fi dnf -y \ @@ -93,7 +95,7 @@ dnf -y \ --disablerepo='*' \ $enabled_repos \ --setopt=install_weak_deps=False install \ - bash basesystem systemd systemd-udev dnf centos-release + bash basesystem systemd dnf centos-release cryptsetup $release_specific_packages mount --bind /dev /mnt/dev mount --bind /dev/pts /mnt/dev/pts @@ -119,7 +121,9 @@ EOF # See https://github.com/OpenNebula/addon-context-linux/issues/121 for details. # network-scripts.x86_64 : Legacy scripts for manipulating of network devices -run_root dnf -y install network-scripts +if [ $RELEASE -ge 8 ]; then + run_root dnf -y install network-scripts +fi # Install (magic?) one-context RPM and hope things works as expected. curl -L "$ONE_CONTEXT_RPM_URL" > "/mnt$ONE_CONTEXT_RPM_PATH" @@ -147,7 +151,7 @@ cat > /mnt/etc/dracut.conf.d/virtio-blk.conf <