From 0700f29fe27f89c7941e4056d34d052d9d3d199f Mon Sep 17 00:00:00 2001 From: hyc520 Date: Wed, 10 Aug 2022 11:42:00 +0800 Subject: [PATCH] add support for FusionOS platform --- build/script/utils/common.sh | 13 +++++++++---- src/get_PlatForm_str.sh | 13 +++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/build/script/utils/common.sh b/build/script/utils/common.sh index c855e132f..e7ac80afb 100644 --- a/build/script/utils/common.sh +++ b/build/script/utils/common.sh @@ -72,7 +72,7 @@ select_package_command export PLAT_FORM_STR=$(sh "${ROOT_DIR}/src/get_PlatForm_str.sh") if [ "${PLAT_FORM_STR}"x == "Failed"x -o "${PLAT_FORM_STR}"x == ""x ] then - echo "We only support openEuler(aarch64), EulerOS(aarch64), CentOS, Kylin(aarch64), Asianux platform." + echo "We only support openEuler(aarch64), EulerOS(aarch64), FusionOS, CentOS, Kylin(aarch64), Asianux platform." exit 1; fi @@ -91,6 +91,11 @@ elif [[ "$PLAT_FORM_STR" =~ "openeuler" ]]; then if [ "$PLATFORM_ARCH"X == "aarch64"X ];then GAUSSDB_EXTRA_FLAGS=" -D__USE_NUMA -D__ARM_LSE" fi +elif [[ "$PLAT_FORM_STR" =~ "fusionos" ]]; then + dist_version="FusionOS" + if [ "$PLATFORM_ARCH"X == "aarch64"X ];then + GAUSSDB_EXTRA_FLAGS=" -D__USE_NUMA -D__ARM_LSE" + fi elif [[ "$PLAT_FORM_STR" =~ "kylin" ]]; then dist_version="Kylin" if [ "$PLATFORM_ARCH"X == "aarch64"X ];then @@ -102,15 +107,15 @@ elif [[ "$PLAT_FORM_STR" =~ "asianux" ]]; then GAUSSDB_EXTRA_FLAGS=" -D__USE_NUMA" fi else - echo "We only support openEuler(aarch64), EulerOS(aarch64), CentOS, Kylin(aarch64), Asianux platform." + echo "We only support openEuler(aarch64), EulerOS(aarch64), FusionOS, CentOS, Kylin(aarch64), Asianux platform." echo "Kernel is $kernel" exit 1 fi ##add platform architecture information if [ "$PLATFORM_ARCH"X == "aarch64"X ] ; then - if [ "$dist_version" != "openEuler" ] && [ "$dist_version" != "EulerOS" ] && [ "$dist_version" != "Kylin" ] && [ "$dist_version" != "Asianux" ]; then - echo "We only support NUMA on openEuler(aarch64), EulerOS(aarch64), Kylin(aarch64), Asianux platform." + if [ "$dist_version" != "openEuler" ] && [ "$dist_version" != "EulerOS" ] && [ "$dist_version" != "FusionOS" ] && [ "$dist_version" != "Kylin" ] && [ "$dist_version" != "Asianux" ]; then + echo "We only support NUMA on openEuler(aarch64), EulerOS(aarch64), FusionOS(aarch64), Kylin(aarch64), Asianux platform." exit 1 fi fi diff --git a/src/get_PlatForm_str.sh b/src/get_PlatForm_str.sh index 625b717ef..85824872f 100755 --- a/src/get_PlatForm_str.sh +++ b/src/get_PlatForm_str.sh @@ -23,6 +23,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/FusionOS-release" ] +then + kernel=$(cat /etc/FusionOS-release | awk -F ' ' '{print $1}' | tr A-Z a-z) elif [ -f "/etc/centos-release" ] then kernel=$(cat /etc/centos-release | awk -F ' ' '{print $1}' | tr A-Z a-z) @@ -124,6 +127,16 @@ then fi +################################################################################## +# fusionos platform +# the result form like this: fusionos_x86_64 +################################################################################## +if [ "$kernel"x = "fusionos"x ] +then + plat_form_str=fusionos_"$cpu_bit" +fi + + ################################################################################## # kylin platform # the result form like this: kylin_aarch64