From 2f6557c4580b71d3389f523b03c3ec0eff91dc7d Mon Sep 17 00:00:00 2001 From: hemny Date: Mon, 17 Aug 2020 22:33:13 +0800 Subject: [PATCH 1/4] Adapted to the neokylin system. --- src/get_PlatForm_str.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/get_PlatForm_str.sh b/src/get_PlatForm_str.sh index 978350dcc8..7433076c7c 100644 --- a/src/get_PlatForm_str.sh +++ b/src/get_PlatForm_str.sh @@ -36,6 +36,9 @@ then elif [ -f "/etc/openEuler-release" ] then kernel=$(cat /etc/openEuler-release | awk -F ' ' '{print $1}' | tr A-Z a-z) +elif [ -f "/etc/os-release" ] +then + kernel=$(source /etc/os-release; echo $ID) else kernel=$(lsb_release -d | awk -F ' ' '{print $2}'| tr A-Z a-z) fi @@ -132,6 +135,14 @@ then plat_form_str=openeuler_"$cpu_bit" fi +################################################################################## +# neokylin platform +# the result form like this: neokylin_aarch64 +################################################################################## +if [ "$kernel"x = "neokylin"x ] +then + plat_form_str=neokylin_"$cpu_bit" +fi ################################################################################## # -- Gitee From bdacaa558e7f40f8857a7d0a029c7963c93b9a66 Mon Sep 17 00:00:00 2001 From: hemny Date: Mon, 17 Aug 2020 22:41:41 +0800 Subject: [PATCH 2/4] Package adapted to the neokylin system. --- package/package.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/package/package.sh b/package/package.sh index f651440a37..751b1afc1e 100644 --- a/package/package.sh +++ b/package/package.sh @@ -37,6 +37,10 @@ elif [ -f "/etc/centos-release" ] then kernel=$(cat /etc/centos-release | awk -F ' ' '{print $1}' | tr A-Z a-z) version=$(cat /etc/centos-release | awk -F '(' '{print $2}'| awk -F ')' '{print $1}' | tr A-Z a-z) +elif [ -f "/etc/os-release" ] +then + kernel=$(source /etc/os-release; echo $ID) + version=$(source /etc/os-release; echo $VERSION_ID) else kernel=$(lsb_release -d | awk -F ' ' '{print $2}'| tr A-Z a-z) version=$(lsb_release -r | awk -F ' ' '{print $2}') @@ -52,8 +56,10 @@ if [ X"$kernel" == X"centos" ]; then dist_version="CentOS" elif [ X"$kernel" == X"openeuler" ]; then dist_version="openEuler" +elif [ X"$kernel" == X"neokylin" ]; then + dist_version="neokylin" else - echo "We only support openEuler(aarch64), CentOS platform." + echo "We only support openEuler(aarch64), neokylin(aarch64), CentOS platform." echo "Kernel is $kernel" exit 1 fi @@ -62,8 +68,8 @@ gcc_version="8.2" ##add platform architecture information PLATFORM_ARCH=$(uname -p) if [ "$PLATFORM_ARCH"X == "aarch64"X ] ; then - if [ "$dist_version" != "openEuler" ]; then - echo "We only support NUMA on openEuler(aarch64) platform." + if [ "$dist_version" != "openEuler" ] && [ "$dist_version" != "neokylin" ] ; then + echo "We only support NUMA on openEuler(aarch64), neokylin(aarch64) platform." exit 1 fi fi -- Gitee From d4e3c941a60f59b9eb3fe1365403f8c3d0131914 Mon Sep 17 00:00:00 2001 From: hemny Date: Thu, 20 Aug 2020 10:52:16 +0800 Subject: [PATCH 3/4] Compile adapted to the neokylin/kylin system. --- build.sh | 4 ++-- package/package.sh | 4 ++-- src/bin/scripts/bind_net_irq.sh | 4 ++-- src/gausskernel/Makefile | 4 ++++ 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/build.sh b/build.sh index d5fcbbf5d5..7e156746b3 100755 --- a/build.sh +++ b/build.sh @@ -73,7 +73,7 @@ declare BUILD_DIR="${ROOT_DIR}/dest" PLAT_FORM_STR=$(sh "${ROOT_DIR}/src/get_PlatForm_str.sh") if [ "${PLAT_FORM_STR}"x == "Failed"x ] then - echo "We only support OPENEULER(aarch64), CentOS(x86-64) platform." + echo "We only support OPENEULER(aarch64), CentOS(x86-64), neokylin(aarch64), kylin(aarch64), CentOS(x86-64) platform." exit 1; fi @@ -131,7 +131,7 @@ srv_pkg_pre_check function getExtraFlags() { if [ "$PLATFORM_ARCH"X == "aarch64"X ] ; then - if [ "$dist_version" == "openEuler" ]; then + if [ ["$dist_version" == "openEuler"] -o ["$dist_version" == "neokylin"] -o ["$dist_version" == "kylin"] ]; then GAUSSDB_EXTRA_FLAGS=" -D__USE_NUMA" if [ "${optimized}"x == "true"x ] ; then GAUSSDB_EXTRA_FLAGS=" -D__USE_NUMA -D__ARM_LSE" diff --git a/package/package.sh b/package/package.sh index 751b1afc1e..5d955309da 100644 --- a/package/package.sh +++ b/package/package.sh @@ -68,8 +68,8 @@ gcc_version="8.2" ##add platform architecture information PLATFORM_ARCH=$(uname -p) if [ "$PLATFORM_ARCH"X == "aarch64"X ] ; then - if [ "$dist_version" != "openEuler" ] && [ "$dist_version" != "neokylin" ] ; then - echo "We only support NUMA on openEuler(aarch64), neokylin(aarch64) platform." + if [ "$dist_version" != "openEuler" ] && [ "$dist_version" != "neokylin" ] && [ "$dist_version" != "kylin" ] ; then + echo "We only support NUMA on openEuler(aarch64), neokylin(aarch64), kylin(aarch64) platform." exit 1 fi fi diff --git a/src/bin/scripts/bind_net_irq.sh b/src/bin/scripts/bind_net_irq.sh index c17a64a8fc..189fd7600d 100755 --- a/src/bin/scripts/bind_net_irq.sh +++ b/src/bin/scripts/bind_net_irq.sh @@ -25,9 +25,9 @@ export LC_ALL=en_US.UTF-8 net_cores=$1 #check euleros stop sysmonitor -os=$(cat /etc/*release | grep "NAME=" | head -n 1 | cut -d '=' -f 2 | tr -d '"' | tr A-Z a-z) +os=$(source /etc/os-release; echo $ID) -if [ "$os"x = "euleros"x ] +if [ ["$os"x = "euleros"x] -o ["$os"x = "openeuler"x] -o ["$os"x = "neokylin"x] -o ["$os"x = "kylin"x] ] then service sysmonitor stop fi diff --git a/src/gausskernel/Makefile b/src/gausskernel/Makefile index eb27e4c0a2..571e5ea97f 100644 --- a/src/gausskernel/Makefile +++ b/src/gausskernel/Makefile @@ -626,6 +626,10 @@ else ifeq ($(PLAT_FORM_STR), openeuler_aarch64) cp '$(LIBCURL_LIB_PATH)/libcurl.so.4.6.0' '$(DESTDIR)$(libdir)/libcurl.so.4.6.0' else ifeq ($(PLAT_FORM_STR), centos7.6_x86_64) cp '$(LIBCURL_LIB_PATH)/libcurl.so.4.6.0' '$(DESTDIR)$(libdir)/libcurl.so.4.6.0' +else ifeq ($(PLAT_FORM_STR), kylin_aarch64) + cp '$(LIBCURL_LIB_PATH)/libcurl.so.4.6.0' '$(DESTDIR)$(libdir)/libcurl.so.4.6.0' +else ifeq ($(PLAT_FORM_STR), neokylin_aarch64) + cp '$(LIBCURL_LIB_PATH)/libcurl.so.4.6.0' '$(DESTDIR)$(libdir)/libcurl.so.4.6.0' else cp '$(LIBCURL_LIB_PATH)/libcurl.so.4.5.0' '$(DESTDIR)$(libdir)/libcurl.so.4.5.0' endif -- Gitee From 9e4afe7ebb24ea3207ba444be94b6f32d76715d6 Mon Sep 17 00:00:00 2001 From: hemny Date: Thu, 20 Aug 2020 10:56:05 +0800 Subject: [PATCH 4/4] Package adapted to the kylin system. --- package/package.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package/package.sh b/package/package.sh index 5d955309da..59fdc5d0b9 100644 --- a/package/package.sh +++ b/package/package.sh @@ -58,8 +58,10 @@ elif [ X"$kernel" == X"openeuler" ]; then dist_version="openEuler" elif [ X"$kernel" == X"neokylin" ]; then dist_version="neokylin" +elif [ X"$kernel" == X"kylin" ]; then + dist_version="kylin" else - echo "We only support openEuler(aarch64), neokylin(aarch64), CentOS platform." + echo "We only support openEuler(aarch64), neokylin(aarch64), kylin(aarch64), CentOS platform." echo "Kernel is $kernel" exit 1 fi -- Gitee