[PATCH] setup: support CentOS 7

8 views
Skip to first unread message

Waldemar Kozaczuk

unread,
Feb 8, 2021, 12:23:16 PM2/8/21
to osv...@googlegroups.com, Waldemar Kozaczuk
This patch modifies setup.py to support installing necessary
packages to build and test OSv on CentOS 7.

Please note that unlike for other distributions, we do
not use default packages for gcc or qemu as these are pretty old.
Instead we enable SCL repo and install Developet Toolset 9 which comes
with gcc 9 (c, c++) and other binaries.

There is no package repo with qemu (I guess we could install one from
Fedora) so instead we provide a script to build qemu from sources (see
other patch).

Signed-off-by: Waldemar Kozaczuk <jwkoz...@gmail.com>
---
scripts/setup.py | 53 ++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 51 insertions(+), 2 deletions(-)

diff --git a/scripts/setup.py b/scripts/setup.py
index 2289e100..7413db7b 100755
--- a/scripts/setup.py
+++ b/scripts/setup.py
@@ -126,7 +126,7 @@ class Fedora(object):
versions = [Fedora_27, Fedora_28, Fedora_29, Fedora_30, Fedora_31, Fedora_32, Fedora_33]

class RHELbased(Fedora):
- name = ['Scientific Linux', 'NauLinux', 'CentOS Linux', 'Red Hat Enterprise Linux', 'Oracle Linux']
+ name = ['Scientific Linux', 'NauLinux', 'Red Hat Enterprise Linux', 'Oracle Linux']

class RHELbased_70(object):
packages = []
@@ -336,12 +336,55 @@ class LinuxMint(Ubuntu):

versions = [LinuxMint_18_03, LinuxMint_19]

+class CentOS(object):
+ name = 'CentOS Linux'
+ install = 'yum -y install'
+ packages = [
+ 'ant',
+ 'autoconf',
+ 'automake',
+ 'curl',
+ 'git',
+ 'gnutls-utils',
+ 'libtool',
+ 'maven',
+ 'maven-shade-plugin',
+ 'openssl',
+ 'openssl-libs',
+ 'openssl-devel',
+ 'p11-kit',
+ 'patch',
+ 'python3-requests',
+ 'qemu-img',
+ 'tcpdump',
+ 'unzip',
+ 'wget',
+ 'yaml-cpp-devel',
+ 'pax-utils',
+ 'java-1.8.0-openjdk',
+ 'devtoolset-9-toolchain',
+ ]
+
+ test_packages = ['openssl-devel']
+
+ class CentOS_7(object):
+ pre_install = 'yum -y install epel-release centos-release-scl centos-release-scl-rh https://packages.endpoint.com/rhel/7/os/x86_64/endpoint-repo-1.7-1.x86_64.rpm'
+ packages = []
+ ec2_packages = []
+ test_packages = []
+ ec2_post_install = None
+ post_install = 'echo "---> Run \'scl enable devtoolset-9 bash\' or add \'source /opt/rh/devtoolset-9/enable\' to ~/.bashrc or ~/.bash_profile" to enable GCC 9 before building OSv !'
+ version = '7'
+
+ versions = [CentOS_7]
+
distros = [
Debian(),
Fedora(),
Ubuntu(),
LinuxMint(),
- RHELbased()
+ RHELbased(),
+ CentOS()
]

parser = argparse.ArgumentParser(prog='setup')
@@ -366,6 +409,8 @@ for distro in distros:
if dver.version == version or version.startswith(dver.version+'.'):
if hasattr(distro, 'pre_install'):
subprocess.check_call(distro.pre_install, shell=True)
+ if hasattr(dver, 'pre_install'):
+ subprocess.check_call(dver.pre_install, shell=True)
pkg = distro.packages + dver.packages
if cmdargs.ec2:
pkg += distro.ec2_packages + dver.ec2_packages
@@ -377,6 +422,10 @@ for distro in distros:
subprocess.check_call(distro.ec2_post_install, shell=True)
if dver.ec2_post_install:
subprocess.check_call(dver.ec2_post_install, shell=True)
+ if hasattr(distro, 'post_install'):
+ subprocess.check_call(distro.post_install, shell=True)
+ if hasattr(dver, 'post_install'):
+ subprocess.check_call(dver.post_install, shell=True)
sys.exit(0)
print ('Your distribution %s version %s is not supported by this script' % (name, version))
sys.exit(1)
--
2.29.2

Commit Bot

unread,
Feb 10, 2021, 12:17:22 AM2/10/21
to osv...@googlegroups.com, Waldemar Kozaczuk
From: Waldemar Kozaczuk <jwkoz...@gmail.com>
Committer: Waldemar Kozaczuk <jwkoz...@gmail.com>
Branch: master

setup: support CentOS 7

This patch modifies setup.py to support installing necessary
packages to build and test OSv on CentOS 7.

Please note that unlike for other distributions, we do
not use default packages for gcc or qemu as these are pretty old.
Instead we enable SCL repo and install Developet Toolset 9 which comes
with gcc 9 (c, c++) and other binaries.

There is no package repo with qemu (I guess we could install one from
Fedora) so instead we provide a script to build qemu from sources (see
other patch).

Signed-off-by: Waldemar Kozaczuk <jwkoz...@gmail.com>

---
diff --git a/scripts/setup.py b/scripts/setup.py
--- a/scripts/setup.py
+++ b/scripts/setup.py
@@ -126,7 +126,7 @@ class Fedora_33(object):
versions = [Fedora_27, Fedora_28, Fedora_29, Fedora_30, Fedora_31, Fedora_32, Fedora_33]

class RHELbased(Fedora):
- name = ['Scientific Linux', 'NauLinux', 'CentOS Linux', 'Red Hat Enterprise Linux', 'Oracle Linux']
+ name = ['Scientific Linux', 'NauLinux', 'Red Hat Enterprise Linux', 'Oracle Linux']

class RHELbased_70(object):
packages = []
@@ -336,12 +336,55 @@ class LinuxMint_19(object):
@@ -366,6 +409,8 @@ class LinuxMint_19(object):
if dver.version == version or version.startswith(dver.version+'.'):
if hasattr(distro, 'pre_install'):
subprocess.check_call(distro.pre_install, shell=True)
+ if hasattr(dver, 'pre_install'):
+ subprocess.check_call(dver.pre_install, shell=True)
pkg = distro.packages + dver.packages
if cmdargs.ec2:
pkg += distro.ec2_packages + dver.ec2_packages
@@ -377,6 +422,10 @@ class LinuxMint_19(object):
Reply all
Reply to author
Forward
0 new messages