From 9a92ff4e50306b3f204e9ee25f47cf4b892d0bb1 Mon Sep 17 00:00:00 2001 From: Daniel Clavijo Coca Date: Wed, 12 Apr 2023 04:25:56 -0600 Subject: [PATCH] B #3178: Auto-contextualize missing context supported distros on LXD marketplace (#2128) * Update some linux distro versions * Centos Stream * Springdale * Amazon Linux * OpenSuse --- src/datastore_mad/remotes/lxd_downloader.sh | 49 +++++++------------ .../remotes/linuxcontainers/monitor | 2 +- 2 files changed, 18 insertions(+), 33 deletions(-) diff --git a/src/datastore_mad/remotes/lxd_downloader.sh b/src/datastore_mad/remotes/lxd_downloader.sh index 289f206a4b..9622347951 100755 --- a/src/datastore_mad/remotes/lxd_downloader.sh +++ b/src/datastore_mad/remotes/lxd_downloader.sh @@ -39,6 +39,7 @@ CONTEXT_URL="https://github.com/OpenNebula/addon-context-linux/releases/download PKG_ALT="curl openssh-server" PKG_APK="curl openssh" PKG_DEB="curl dbus openssh-server" +PKG_SUSE="curl" PKG_RPM="openssh-server" PKG_CENTOS6="epel-release $PKG_RPM" PKG_FEDORA="network-scripts $PKG_RPM" @@ -179,26 +180,6 @@ $CURL $CONTEXT_URL/v$selected_tag/one-context_$selected_tag-1.deb -Lfo /root/con apt-get install -y /root/context.deb >> /var/log/chroot.log 2>&1 rm /root/context.deb -rm /dev/random /dev/urandom -EOC -) - ;; -*centos/6*) - terminal="/bin/bash" - commands=$(cat < /etc/resolv.conf - -[ ! -e /dev/random ] && mknod -m 666 /dev/random c 1 8 >> /var/log/chroot.log 2>&1 -[ ! -e /dev/urandom ] && mknod -m 666 /dev/urandom c 1 9 >> /var/log/chroot.log 2>&1 - -yum install $PKG_CENTOS6 -y >> /var/log/chroot.log 2>&1 - -$CURL $CONTEXT_URL/v$selected_tag/one-context-$selected_tag-1.el6.noarch.rpm -Lfo /root/context.rpm >> /var/log/chroot.log 2>&1 -yum install /root/context.rpm -y >> /var/log/chroot.log 2>&1 -rm /root/context.rpm - rm /dev/random /dev/urandom EOC ) @@ -221,9 +202,10 @@ rm /dev/random /dev/urandom EOC ) ;; -*centos/8*|*almalinux/8*|*rockylinux/8*) +*centos/8*|*almalinux/8*|*rockylinux/8*|centos/9*|*almalinux/9*|*rockylinux/9*) terminal="/bin/bash" commands=$(cat < /etc/resolv.conf [ ! -e /dev/random ] && mknod -m 666 /dev/random c 1 8 >> /var/log/chroot.log 2>&1 @@ -239,7 +221,7 @@ rm /dev/random /dev/urandom EOC ) ;; -*oracle/8*) +*oracle/8*|*oracle/9*) terminal="/bin/bash" commands=$(cat < /etc/resolv.conf @@ -258,15 +240,16 @@ rm /dev/random /dev/urandom EOC ) ;; -*fedora28*) +*fedora*|*amazonlinux*) terminal="/bin/bash" commands=$(cat < /etc/resolv.conf [ ! -e /dev/random ] && mknod -m 666 /dev/random c 1 8 >> /var/log/chroot.log 2>&1 [ ! -e /dev/urandom ] && mknod -m 666 /dev/urandom c 1 9 >> /var/log/chroot.log 2>&1 -yum install $PKG_RPM -y >> /var/log/chroot.log 2>&1 +yum install $PKG_FEDORA -y >> /var/log/chroot.log 2>&1 $CURL $CONTEXT_URL/v$selected_tag/one-context-$selected_tag-1.el7.noarch.rpm -Lfo /root/context.rpm >> /var/log/chroot.log 2>&1 yum install /root/context.rpm -y >> /var/log/chroot.log 2>&1 @@ -276,22 +259,24 @@ rm /dev/random /dev/urandom EOC ) ;; -*fedora/29*|*fedora/3*) +*opensuse*) terminal="/bin/bash" commands=$(cat < /etc/resolv.conf -[ ! -e /dev/random ] && mknod -m 666 /dev/random c 1 8 -[ ! -e /dev/urandom ] && mknod -m 666 /dev/urandom c 1 9 +[ ! -e /dev/tty ] && mknod /dev/tty c 5 0 >> /var/log/chroot.log 2>&1 -yum install $PKG_FEDORA -y >> /var/log/chroot.log 2>&1 +zypper clean >> /var/log/chroot.log 2>&1 +zypper ref >> /var/log/chroot.log 2>&1 -$CURL $CONTEXT_URL/v$selected_tag/one-context-$selected_tag-1.el7.noarch.rpm -Lfo /root/context.rpm >> /var/log/chroot.log 2>&1 -yum install /root/context.rpm -y >> /var/log/chroot.log 2>&1 +zypper install -ny $PKG_SUSE >> /var/log/chroot.log 2>&1 + +$CURL $CONTEXT_URL/v$selected_tag/one-context-$selected_tag-1.suse.noarch.rpm -Lfo /root/context.rpm >> /var/log/chroot.log 2>&1 +zypper install -ny --allow-unsigned-rpm /root/context.rpm >> /var/log/chroot.log 2>&1 rm /root/context.rpm -rm /dev/random /dev/urandom +rm /dev/tty EOC ) ;; diff --git a/src/market_mad/remotes/linuxcontainers/monitor b/src/market_mad/remotes/linuxcontainers/monitor index 611848e5c4..887be18634 100755 --- a/src/market_mad/remotes/linuxcontainers/monitor +++ b/src/market_mad/remotes/linuxcontainers/monitor @@ -50,7 +50,7 @@ class LinuxContainersMarket :format => 'raw', :agent => 'OpenNebula', :tested_apps => ['alpine', 'alt', 'centos', 'rockylinux', 'almalinux', 'oracle', 'debian', - 'ubuntu', 'fedora', 'devuan'], + 'ubuntu', 'fedora', 'devuan', 'opensuse', 'amazonlinux'], :skip_untested => 'yes', :memory => '768', :cpu => 1,