From 5d511689ec9366f96afcd0d35d81dee872a5d1dd Mon Sep 17 00:00:00 2001 From: leiziwei Date: Wed, 29 Mar 2023 10:24:50 +0800 Subject: [PATCH] =?UTF-8?q?opengauss=E9=80=82=E9=85=8Duos=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.sh | 6 ++++-- build/get_PlatForm_str.sh | 2 ++ script/gspylib/os/gsplatform.py | 13 ++++++++++++- script/local/LocalCheckOS.py | 2 +- script/os_platform/common.py | 9 ++++++--- script/os_platform/linux_platform.py | 9 +++++---- script/os_platform/rhel_platform.py | 3 +++ 7 files changed, 33 insertions(+), 11 deletions(-) diff --git a/build.sh b/build.sh index f1a02a1..0274802 100644 --- a/build.sh +++ b/build.sh @@ -48,7 +48,7 @@ done PLAT_FORM_STR=$(sh "${ROOT_DIR}/build/get_PlatForm_str.sh") if [ "${PLAT_FORM_STR}"x == "Failed"x ]; then - echo "We only support openEuler(aarch64), EulerOS(aarch64), FusionOS, CentOS platform." + echo "We only support openEuler(aarch64), EulerOS(aarch64), FusionOS, CentOS, UnionTech(X86) platform." exit 1; fi @@ -70,8 +70,10 @@ elif [ X$(echo $PLAT_FORM_STR | grep "ubuntu") != X"" ]; then dist_version="Ubuntu" elif [ X$(echo $PLAT_FORM_STR | grep "asianux") != X"" ]; then dist_version="Asianux" +elif [ X$(echo $PLAT_FORM_STR | grep "UnionTech") != X"" ]; then + dist_version="UnionTech" else - echo "We only support openEuler(aarch64), EulerOS(aarch64), FusionOS, CentOS, Ubuntu(x86) platform." + echo "We only support openEuler(aarch64), EulerOS(aarch64), FusionOS, CentOS, Ubuntu(x86), UnionTech(x86) platform." echo "Kernel is $kernel" exit 1 fi diff --git a/build/get_PlatForm_str.sh b/build/get_PlatForm_str.sh index cf8c84f..2bd8af9 100644 --- a/build/get_PlatForm_str.sh +++ b/build/get_PlatForm_str.sh @@ -37,6 +37,8 @@ function get_os_str() { os_str=asianux7.6_x86_64 elif [ "$os_name"x = "asianux"x ] && [ "$cpu_arc"x = "aarch64"x ]; then os_str=asianux7.5_aarch64 + elif [ "$os_name"x = "uos"x ] && [ "$cpu_arc"x = "x86_64"x ]; then + os_str=UnionTech_x86_64 else os_str="Failed" fi diff --git a/script/gspylib/os/gsplatform.py b/script/gspylib/os/gsplatform.py index d379af0..c67c9c7 100644 --- a/script/gspylib/os/gsplatform.py +++ b/script/gspylib/os/gsplatform.py @@ -67,8 +67,9 @@ OPENEULER = "openeuler" ASIANUX = "asianux" DEBIAN = "debian" UBUNTU = "ubuntu" +UNIONTECH = "uniontech" SUPPORT_WHOLE_PLATFORM_LIST = [SUSE, REDHAT, CENTOS, EULEROS, FUSIONOS, - OPENEULER, KYLIN, ASIANUX, DEBIAN, UBUNTU] + OPENEULER, KYLIN, ASIANUX, DEBIAN, UBUNTU, UNIONTECH] # RedhatX platform SUPPORT_RHEL_SERIES_PLATFORM_LIST = [REDHAT, CENTOS, "kylin", "asianux"] SUPPORT_RHEL6X_VERSION_LIST = ["6.4", "6.5", "6.6", "6.7", "6.8", "6.9", "10"] @@ -102,6 +103,7 @@ PAK_REDHAT = "RedHat" PAK_ASIANUX = "Asianux" PAK_UBUNTU = "Ubuntu" PAK_SUSE = "SUSE" +PAK_UNIONTECH = "UnionTech" ####################################################### _supported_dists = ( @@ -1551,6 +1553,15 @@ class LinuxPlatform(GenericPlatform): prefixStr, packageVersion, PAK_UBUNTU, BIT_VERSION, postfixStr)) +<<<<<<< HEAD +======= + elif distname in UNIONTECH: + fileName = os.path.join(dirName, "./../../../", + "%s-%s-%s-%s.%s" % ( + prefixStr, packageVersion, + PAK_UNIONTECH, + BIT_VERSION, postfixStr)) +>>>>>>> 12441ba (opengauss适配uos系统) else: raise Exception(ErrorCode.GAUSS_519["GAUSS_51900"] + "Supported platforms are: %s." % str( diff --git a/script/local/LocalCheckOS.py b/script/local/LocalCheckOS.py index f66375b..1fef3d3 100644 --- a/script/local/LocalCheckOS.py +++ b/script/local/LocalCheckOS.py @@ -1791,7 +1791,7 @@ def CheckPlatformInfo(): data.bits) g_logger.log("False %s %s" % (data.distname, platform_str)) return - elif (data.distname == "euleros" or data.distname == "openEuler" or data.distname == "FusionOS" or data.distname == "kylin"): + elif (data.distname == "euleros" or data.distname == "openEuler" or data.distname == "FusionOS" or data.distname == "kylin" or data.distname == "UnionTech"): mixed_type = "%s" % data.distname platform_str = "%s_%s_%s" % (data.distname, data.version, data.bits) elif (data.distname == "debian" or data.version == "buster/sid"): diff --git a/script/os_platform/common.py b/script/os_platform/common.py index 143c82c..fa4eaa8 100644 --- a/script/os_platform/common.py +++ b/script/os_platform/common.py @@ -31,8 +31,9 @@ FUSIONOS = "fusionos" ASIANUX = "asianux" DEBIAN = "debian" UBUNTU = "ubuntu" +UNIONTECH = "uniontech" SUPPORT_WHOLE_PLATFORM_LIST = [SUSE, REDHAT, CENTOS, EULEROS, OPENEULER, KYLIN, - FUSIONOS, ASIANUX, DEBIAN, UBUNTU] + FUSIONOS, ASIANUX, DEBIAN, UBUNTU, UNIONTECH] # RedhatX platform SUPPORT_RHEL_SERIES_PLATFORM_LIST = [REDHAT, CENTOS, "kylin", "asianux"] SUPPORT_RHEL6X_VERSION_LIST = ["6.4", "6.5", "6.6", "6.7", "6.8", "6.9", "10"] @@ -44,6 +45,8 @@ SUPPORT_RHEL_SERIES_VERSION_LIST = (SUPPORT_RHEL6X_VERSION_LIST + SUPPORT_RHEL8X_VERSION_LIST) # EulerOS 2.3 -> 2.0 SP3 SUPPORT_EULEROS_VERSION_LIST = ["2.0"] +# UnionTech 20 +SUPPORT_UNIONTECH_VERSION_LIST = ["20"] # SuSE platform SUSE11 = "11" SUSE12 = "12" @@ -68,9 +71,9 @@ PAK_UBUNTU = "Ubuntu" PAK_KYLIN = "Kylin" PAK_SUSE = "SUSE" PAK_DEBIAN = "Debian" - +PAK_UNIONTECH = "UnionTech" ####################################################### _supported_dists = ( 'SuSE', 'debian', 'fedora', 'redhat', 'centos', 'euleros', "openEuler", 'mandrake', 'mandriva', 'rocks', 'slackware', 'yellowdog', 'gentoo', - "FusionOS", 'UnitedLinux', 'turbolinux', 'ubuntu', 'kylin', 'asianux') + "FusionOS", 'UnitedLinux', 'turbolinux', 'ubuntu', 'kylin', 'asianux', "UnionTech") diff --git a/script/os_platform/linux_platform.py b/script/os_platform/linux_platform.py index 1f21d23..a46ed0a 100644 --- a/script/os_platform/linux_platform.py +++ b/script/os_platform/linux_platform.py @@ -23,9 +23,9 @@ import os from gspylib.common.ErrorCode import ErrorCode from os_platform.common import REDHAT, PAK_REDHAT, BIT_VERSION, \ - CENTOS, PAK_EULER, PAK_CENTOS, ASIANUX, SUSE, PAK_ASIANUX, \ + CENTOS, UNIONTECH, PAK_EULER, PAK_CENTOS, ASIANUX, SUSE, PAK_ASIANUX, \ EULEROS, OPENEULER, KYLIN, PAK_OPENEULER, SUPPORT_WHOLE_PLATFORM_LIST,\ - BLANK_SPACE, PAK_UBUNTU, DEBIAN, PAK_KYLIN, PAK_SUSE, PAK_DEBIAN, \ + BLANK_SPACE, PAK_UBUNTU, DEBIAN, PAK_KYLIN, PAK_UNIONTECH, PAK_SUSE, PAK_DEBIAN, \ FUSIONOS, PAK_FUSIONOS from os_platform.linux_distro import LinuxDistro @@ -213,10 +213,11 @@ class LinuxPlatform(object): self.package_file_path(prefix_str, packageVersion, PAK_CENTOS, postfix_str) ] - elif distname == OPENEULER or distname == KYLIN: + elif distname == OPENEULER or distname == KYLIN or distname == UNIONTECH: file_name_list = [ self.package_file_path(prefix_str, packageVersion, PAK_OPENEULER, postfix_str), - self.package_file_path(prefix_str, packageVersion, PAK_KYLIN, postfix_str) + self.package_file_path(prefix_str, packageVersion, PAK_KYLIN, postfix_str), + self.package_file_path(prefix_str, packageVersion, PAK_UNIONTECH, postfix_str) ] elif distname == DEBIAN: diff --git a/script/os_platform/rhel_platform.py b/script/os_platform/rhel_platform.py index d21ffbd..6266b9d 100644 --- a/script/os_platform/rhel_platform.py +++ b/script/os_platform/rhel_platform.py @@ -26,6 +26,7 @@ from gspylib.common.ErrorCode import ErrorCode from os_platform.common import BIT_VERSION, EULEROS, SUPPORT_EULEROS_VERSION_LIST, \ FUSIONOS, SUPPORT_RHEL_SERIES_PLATFORM_LIST, \ SUPPORT_RHEL_SERIES_VERSION_LIST, OPENEULER, CENTOS, \ + UNIONTECH, SUPPORT_UNIONTECH_VERSION_LIST, \ SUPPORT_RHEL7X_VERSION_LIST, DEBIAN, BLANK_SPACE from os_platform.linux_distro import LinuxDistro from os_platform.linux_platform import LinuxPlatform @@ -167,6 +168,8 @@ class RHELPlatform(LinuxPlatform): if ((bits == BIT_VERSION and ((dist_name.lower() == EULEROS and version[0:3] in SUPPORT_EULEROS_VERSION_LIST) or + (dist_name.lower() == UNIONTECH and version[0:3] in + SUPPORT_UNIONTECH_VERSION_LIST) or (dist_name.lower() in SUPPORT_RHEL_SERIES_PLATFORM_LIST and version[0:3] in SUPPORT_RHEL_SERIES_VERSION_LIST)) or (dist_name.lower() == OPENEULER) or