From b4e88521856c8594dd3f32304eeb05af0343c89e Mon Sep 17 00:00:00 2001 From: leiziwei Date: Wed, 8 Nov 2023 10:04:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81arm=E5=B9=B3=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.sh | 10 ++++++---- build/get_PlatForm_str.sh | 4 +++- script/gspylib/os/gsplatform.py | 19 +++++++++++++------ script/local/LocalCheckOS.py | 2 +- script/os_platform/common.py | 12 ++++++------ script/os_platform/linux_platform.py | 8 ++++---- script/os_platform/rhel_platform.py | 6 +++--- 7 files changed, 36 insertions(+), 25 deletions(-) diff --git a/build.sh b/build.sh index 4ae02f2..544ab49 100644 --- a/build.sh +++ b/build.sh @@ -54,7 +54,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, UnionTech(X86) platform." + echo "We only support openEuler(aarch64), EulerOS(aarch64), FusionOS, CentOS, uos platform." exit 1; fi @@ -76,10 +76,12 @@ 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" +elif [ X$(echo $PLAT_FORM_STR | grep "kylin") != X"" ]; then + dist_version="Kylin" +elif [ X$(echo $PLAT_FORM_STR | grep "uos") != X"" ]; then + dist_version="uos" else - echo "We only support openEuler(aarch64), EulerOS(aarch64), FusionOS, CentOS, Ubuntu(x86), UnionTech(x86) platform." + echo "We only support openEuler(aarch64), EulerOS(aarch64), FusionOS, CentOS, Ubuntu(x86), uos platform." echo "Kernel is $kernel" exit 1 fi diff --git a/build/get_PlatForm_str.sh b/build/get_PlatForm_str.sh index 2bd8af9..5f21779 100644 --- a/build/get_PlatForm_str.sh +++ b/build/get_PlatForm_str.sh @@ -38,7 +38,9 @@ function get_os_str() { 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 + os_str=uos_x86_64 + elif [ "$os_name"x = "uos"x ] && [ "$cpu_arc"x = "aarch64"x ]; then + os_str=uos_aarch64 else os_str="Failed" fi diff --git a/script/gspylib/os/gsplatform.py b/script/gspylib/os/gsplatform.py index baff769..6084723 100644 --- a/script/gspylib/os/gsplatform.py +++ b/script/gspylib/os/gsplatform.py @@ -72,9 +72,9 @@ OPENEULER = "openeuler" ASIANUX = "asianux" DEBIAN = "debian" UBUNTU = "ubuntu" -UNIONTECH = "uniontech" +UOS = "uos" SUPPORT_WHOLE_PLATFORM_LIST = [SUSE, REDHAT, CENTOS, EULEROS, FUSIONOS, - OPENEULER, KYLIN, ASIANUX, DEBIAN, UBUNTU, UNIONTECH] + OPENEULER, KYLIN, ASIANUX, DEBIAN, UBUNTU, UOS] # 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"] @@ -110,12 +110,13 @@ PAK_ASIANUX = "Asianux" PAK_UBUNTU = "Ubuntu" PAK_SUSE = "SUSE" PAK_UNIONTECH = "UnionTech" - +PAK_KYLIN = "Kylin" +PAK_UOS = "uos" ####################################################### _supported_dists = ( 'SuSE', 'debian', 'fedora', 'redhat', 'centos', 'euleros', "openEuler", 'mandrake', 'mandriva', 'rocks', 'slackware', 'yellowdog', 'gentoo', - 'FusionOS', 'UnitedLinux', 'turbolinux', 'kylin', 'asianux', 'ubuntu') + 'FusionOS', 'UnitedLinux', 'turbolinux', 'kylin', 'asianux', 'ubuntu', 'uos') _release_filename = re.compile(r'(\w+)[-_](release|version)') _lsb_release_version = re.compile(r'(.+)' ' release ' @@ -1728,11 +1729,17 @@ class LinuxPlatform(GenericPlatform): prefixStr, packageVersion, PAK_UBUNTU, BIT_VERSION, postfixStr)) - elif distname in UNIONTECH: + elif distname in KYLIN: fileName = os.path.join(dirName, "./../../../", "%s-%s-%s-%s.%s" % ( prefixStr, packageVersion, - PAK_UNIONTECH, + PAK_KYLIN, + BIT_VERSION, postfixStr)) + elif distname in UOS: + fileName = os.path.join(dirName, "./../../../", + "%s-%s-%s-%s.%s" % ( + prefixStr, packageVersion, + PAK_UOS, BIT_VERSION, postfixStr)) else: raise Exception(ErrorCode.GAUSS_519["GAUSS_51900"] + diff --git a/script/local/LocalCheckOS.py b/script/local/LocalCheckOS.py index 377a373..7be9628 100644 --- a/script/local/LocalCheckOS.py +++ b/script/local/LocalCheckOS.py @@ -1908,7 +1908,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" or data.distname == "UnionTech"): + elif (data.distname == "euleros" or data.distname == "openEuler" or data.distname == "FusionOS" or data.distname == "kylin" or data.distname == "uos"): 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 933177c..c917dad 100644 --- a/script/os_platform/common.py +++ b/script/os_platform/common.py @@ -31,9 +31,9 @@ FUSIONOS = "fusionos" ASIANUX = "asianux" DEBIAN = "debian" UBUNTU = "ubuntu" -UNIONTECH = "uniontech" +UOS = "uos" SUPPORT_WHOLE_PLATFORM_LIST = [SUSE, REDHAT, CENTOS, EULEROS, OPENEULER, KYLIN, - FUSIONOS, ASIANUX, DEBIAN, UBUNTU, UNIONTECH] + FUSIONOS, ASIANUX, DEBIAN, UBUNTU, UOS] # 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"] @@ -46,8 +46,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"] +# Uos 20 +SUPPORT_UOS_VERSION_LIST = ["20"] # SuSE platform SUSE11 = "11" SUSE12 = "12" @@ -72,9 +72,9 @@ PAK_UBUNTU = "Ubuntu" PAK_KYLIN = "Kylin" PAK_SUSE = "SUSE" PAK_DEBIAN = "Debian" -PAK_UNIONTECH = "UnionTech" +PAK_UOS = "uos" ####################################################### _supported_dists = ( 'SuSE', 'debian', 'fedora', 'redhat', 'centos', 'euleros', "openEuler", 'mandrake', 'mandriva', 'rocks', 'slackware', 'yellowdog', 'gentoo', - "FusionOS", 'UnitedLinux', 'turbolinux', 'ubuntu', 'kylin', 'asianux', "UnionTech") + "FusionOS", 'UnitedLinux', 'turbolinux', 'ubuntu', 'kylin', 'asianux', "uos") diff --git a/script/os_platform/linux_platform.py b/script/os_platform/linux_platform.py index 4e4c412..b4ac31d 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, UNIONTECH, PAK_EULER, PAK_CENTOS, ASIANUX, SUSE, PAK_ASIANUX, \ + CENTOS, UOS, 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_UNIONTECH, PAK_SUSE, PAK_DEBIAN, \ + BLANK_SPACE, PAK_UBUNTU, DEBIAN, PAK_KYLIN, PAK_UOS, PAK_SUSE, PAK_DEBIAN, \ FUSIONOS, PAK_FUSIONOS from os_platform.linux_distro import LinuxDistro @@ -213,11 +213,11 @@ class LinuxPlatform(object): self.package_file_path(prefix_str, packageVersion, PAK_CENTOS, postfix_str) ] - elif distname == OPENEULER or distname == KYLIN or distname == UNIONTECH: + elif distname == OPENEULER or distname == KYLIN or distname == UOS: 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_UNIONTECH, postfix_str) + self.package_file_path(prefix_str, packageVersion, PAK_UOS, postfix_str) ] elif distname == DEBIAN: diff --git a/script/os_platform/rhel_platform.py b/script/os_platform/rhel_platform.py index 6266b9d..a1c9b38 100644 --- a/script/os_platform/rhel_platform.py +++ b/script/os_platform/rhel_platform.py @@ -26,7 +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, \ + UOS, SUPPORT_UOS_VERSION_LIST, \ SUPPORT_RHEL7X_VERSION_LIST, DEBIAN, BLANK_SPACE from os_platform.linux_distro import LinuxDistro from os_platform.linux_platform import LinuxPlatform @@ -168,8 +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() == UOS and version[0:3] in + SUPPORT_UOS_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