!33 同步2203修改PR到master和2403分支,拉齐主干分支版本
From: @zhang_xubo Reviewed-by: @dillon_chen Signed-off-by: @dillon_chen
This commit is contained in:
commit
ebf398433b
82
0002-add-kylinsec-platform.patch
Normal file
82
0002-add-kylinsec-platform.patch
Normal file
@ -0,0 +1,82 @@
|
||||
From 58207338fe6b98b5eee54757d99e40f8621e0f04 Mon Sep 17 00:00:00 2001
|
||||
From: panchenbo <panchenbo@kylinsec.com.cn>
|
||||
Date: Mon, 10 Apr 2023 10:15:12 +0800
|
||||
Subject: [PATCH] add support for KylinSec platform
|
||||
|
||||
---
|
||||
.../build/script/package_opengauss.sh | 10 ++++++----
|
||||
openGauss-server-2.1.0/src/get_PlatForm_str.sh | 13 +++++++++++++
|
||||
2 files changed, 19 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/openGauss-server-2.1.0/build/script/package_opengauss.sh b/openGauss-server-2.1.0/build/script/package_opengauss.sh
|
||||
index f6447b2..8b82cb1 100755
|
||||
--- a/openGauss-server-2.1.0/build/script/package_opengauss.sh
|
||||
+++ b/openGauss-server-2.1.0/build/script/package_opengauss.sh
|
||||
@@ -62,10 +62,12 @@ elif [ X"$kernel" == X"euleros" ]; then
|
||||
dist_version="EulerOS"
|
||||
elif [ X"$kernel" == X"kylin" ]; then
|
||||
dist_version="Kylin"
|
||||
+elif [ X"$kernel" == X"kylinsec" ]; then
|
||||
+ dist_version="KylinSec"
|
||||
elif [ X"$kernel" = X"ubuntu" ]; then
|
||||
dist_version="Ubuntu"
|
||||
else
|
||||
- echo "We only support openEuler(aarch64), EulerOS(aarch64), CentOS, Kylin(aarch64) and Ubuntu(x86) platform."
|
||||
+ echo "We only support openEuler(aarch64), EulerOS(aarch64), CentOS, Kylin(aarch64), KylinSec(aarch64) and Ubuntu(x86) platform."
|
||||
echo "Kernel is $kernel"
|
||||
exit 1
|
||||
fi
|
||||
@@ -122,8 +124,8 @@ done
|
||||
##add platform architecture information
|
||||
PLATFORM_ARCH=$(uname -p)
|
||||
if [ "$PLATFORM_ARCH"X == "aarch64"X ] ; then
|
||||
- if [ "$dist_version" != "openEuler" ] && [ "$dist_version" != "EulerOS" ] && [ "$dist_version" != "Kylin" ] ; then
|
||||
- echo "We only support NUMA on openEuler(aarch64), EulerOS(aarch64), Kylin(aarch64) platform."
|
||||
+ if [ "$dist_version" != "openEuler" ] && [ "$dist_version" != "EulerOS" ] && [ "$dist_version" != "Kylin" ] && [ "$dist_version" != "KylinSec" ] ; then
|
||||
+ echo "We only support NUMA on openEuler(aarch64), EulerOS(aarch64), Kylin(aarch64), KylinSec(aarch64) platform."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -220,7 +222,7 @@ ROOT_DIR=$(dirname "$ROOT_DIR")
|
||||
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), EulerOS(aarch64), CentOS, Kylin(aarch64) platform."
|
||||
+ echo "We only support openEuler(aarch64), EulerOS(aarch64), CentOS, Kylin(aarch64), KylinSec(aarch64) platform."
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
diff --git a/openGauss-server-2.1.0/src/get_PlatForm_str.sh b/openGauss-server-2.1.0/src/get_PlatForm_str.sh
|
||||
index 9fff29a..ce73a9c 100755
|
||||
--- a/openGauss-server-2.1.0/src/get_PlatForm_str.sh
|
||||
+++ b/openGauss-server-2.1.0/src/get_PlatForm_str.sh
|
||||
@@ -29,6 +29,9 @@ then
|
||||
elif [ -f "/etc/kylin-release" ]
|
||||
then
|
||||
kernel=$(cat /etc/kylin-release | awk -F ' ' '{print $1}' | tr A-Z a-z)
|
||||
+elif [ -f "/etc/kylinsec-release" ]
|
||||
+then
|
||||
+ kernel=$(cat /etc/kylinsec-release | awk -F ' ' '{print $1}' | tr A-Z a-z)
|
||||
else
|
||||
kernel=$(lsb_release -d | awk -F ' ' '{print $2}'| tr A-Z a-z)
|
||||
fi
|
||||
@@ -135,6 +138,16 @@ then
|
||||
plat_form_str=kylin_"$cpu_bit"
|
||||
fi
|
||||
|
||||
+##################################################################################
|
||||
+# kylinsec platform
|
||||
+# the result form like this: kylinsec_aarch64
|
||||
+##################################################################################
|
||||
+if [ "$kernel"x = "kylinsec"x ]
|
||||
+then
|
||||
+ plat_form_str=kylinsec_"$cpu_bit"
|
||||
+fi
|
||||
+
|
||||
+
|
||||
##################################################################################
|
||||
# ubuntu platform
|
||||
# the result form like this: ubuntu_x86_64
|
||||
--
|
||||
2.27.0
|
||||
|
||||
1789
3000-add-sw_64-support.patch
Normal file
1789
3000-add-sw_64-support.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,5 @@
|
||||
[ -f /etc/profile ] && source /etc/profile
|
||||
|
||||
export GAUSSHOME=/usr/local/opengauss/
|
||||
export LD_LIBRARY_PATH=/usr/local/opengauss/lib:$LD_LIBRARY_PATH
|
||||
export PATH=/usr/local/opengauss/bin:$PATH
|
||||
export PGDATA=/var/lib/opengauss/data
|
||||
export PORT=7654
|
||||
export PORT=7654
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
Name: opengauss
|
||||
Version: 2.1.0
|
||||
Release: 5
|
||||
Release: 11
|
||||
Summary: openGauss is an open source relational database management system
|
||||
License: MulanPSL-2.0 and MIT and BSD and zlib and TCL and Apache-2.0 and BSL-1.0
|
||||
URL: https://gitee.com/opengauss/openGauss-server
|
||||
@ -32,9 +32,12 @@ Patch21: 0002-zlib.patch
|
||||
Patch22: 0003-zlib.patch
|
||||
Patch23: makefile-miniunz.patch
|
||||
Patch40: 0001-orc.patch
|
||||
Patch41: 0002-add-kylinsec-platform.patch
|
||||
Patch50: openssl3-adptor.patch
|
||||
Patch51: compile_2309.patch
|
||||
|
||||
|
||||
Patch3000: 3000-add-sw_64-support.patch
|
||||
BuildRequires: cmake gcc gcc-c++ openssl-devel python
|
||||
BuildRequires: cjson lz4-devel protobuf-devel snappy-devel zstd-devel boost-devel
|
||||
BuildRequires: libcgroup-devel libcurl-devel unixODBC-devel jemalloc-devel krb5-devel
|
||||
@ -43,6 +46,9 @@ BuildRequires: bison flex DCF
|
||||
%ifnarch aarch64 %{arm}
|
||||
BuildRequires: numactl-devel
|
||||
%endif
|
||||
%ifarch sw_64
|
||||
BuildRequires: libatomic
|
||||
%endif
|
||||
|
||||
%global _privatelibs lib(cjson|ecpg|z|pg|pq)\\.so*
|
||||
%global __provides_exclude %{_privatelibs}
|
||||
@ -51,7 +57,7 @@ BuildRequires: numactl-devel
|
||||
Requires: lz4-devel protobuf-devel snappy-devel zstd-devel boost-devel
|
||||
Requires: libcgroup-devel libcurl-devel unixODBC-devel jemalloc-devel
|
||||
Requires: java-1.8.0-openjdk-devel libedit-devel libaio-devel
|
||||
Requires: DCF
|
||||
Requires: DCF lsof
|
||||
%ifnarch aarch64 %{arm}
|
||||
Requires: numactl-devel
|
||||
%endif
|
||||
@ -89,6 +95,10 @@ pushd %{orc_name}-%{orc_version}
|
||||
%patch40 -p1
|
||||
popd
|
||||
|
||||
%patch41 -p1
|
||||
%ifarch sw_64
|
||||
%patch3000 -p1
|
||||
%endif
|
||||
%build
|
||||
########### build cjson ###########
|
||||
build_target=$(pwd)/deps_binarylibs
|
||||
@ -104,12 +114,18 @@ CONFIGURE_EXTRA_FLAG="--64"
|
||||
%ifarch aarch64
|
||||
CONFIGURE_EXTRA_FLAG=""
|
||||
%endif
|
||||
%ifarch sw_64
|
||||
CONFIGURE_EXTRA_FLAG=""
|
||||
%endif
|
||||
./configure ${CONFIGURE_EXTRA_FLAG} --prefix=${build_target}/zlib
|
||||
sed -i '21a CFLAGS += -fPIC' Makefile
|
||||
MAKE_EXTRA_FLAG="-m64"
|
||||
%ifarch aarch64
|
||||
MAKE_EXTRA_FLAG=""
|
||||
%endif
|
||||
%ifarch sw_64
|
||||
MAKE_EXTRA_FLAG=""
|
||||
%endif
|
||||
make CFLAGS="-fPIE -fPIC" SFLAGS="-O2 -fPIC -fstack-protector-strong -Wl,-z,noexecstack -Wl,-z,relro,-z,now ${MAKE_EXTRA_FLAG} -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN" %{?_smp_mflags}
|
||||
make install
|
||||
cd contrib/minizip/
|
||||
@ -155,9 +171,15 @@ popd
|
||||
|
||||
########### build opengauss ###########
|
||||
pushd openGauss-server-%{version}
|
||||
echo "PRODUCT=openGauss" > build/script/gauss.spec
|
||||
echo "VERSION=2.1.0" >> build/script/gauss.spec
|
||||
chmod +x ./configure
|
||||
./configure \
|
||||
%ifarch sw_64
|
||||
CC=g++ CFLAGS='-O0' \
|
||||
%else
|
||||
CC=g++ CFLAGS='-O2' \
|
||||
%endif
|
||||
--prefix=%{apppath} \
|
||||
--3rd=${build_target} \
|
||||
--enable-thread-safety \
|
||||
@ -188,15 +210,28 @@ install -m 644 %{SOURCE6} %{buildroot}/%{apppath}/script/opengauss.service
|
||||
install -m 700 %{SOURCE7} %{buildroot}/%{apppath}/script/autostart.sh
|
||||
|
||||
%pre
|
||||
/usr/sbin/groupadd -g 39 -o -r opengauss >/dev/null 2>&1 || :
|
||||
/usr/sbin/useradd -M -N -g opengauss -o -r -d %{datapath} -s /bin/bash \
|
||||
-c "openGauss Server" -u 39 opengauss >/dev/null 2>&1 || :
|
||||
/usr/sbin/groupadd opengauss >/dev/null 2>&1 || :
|
||||
/usr/sbin/useradd -M -N -g opengauss -d %{datapath} -s /bin/bash \
|
||||
-c "openGauss Server" opengauss >/dev/null 2>&1 || :
|
||||
|
||||
# for install step
|
||||
if [ $1 = 1 ]; then
|
||||
portinfo=$(lsof -i:%{port})
|
||||
if [ "${portinfo}" != "" ]; then
|
||||
echo "The port[%{port}] is occupied. Please use command 'lsof -i:%{port} to check it.'"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
%post
|
||||
# set opengauss mini config parameters
|
||||
set_mini_configparam(){
|
||||
config_mini_file=%{apppath}/share/postgresql/opengauss_config_file_mini
|
||||
|
||||
# set guc parameters
|
||||
echo "port = %{port}" >> ${config_mini_file}
|
||||
echo "synchronous_commit = off" >> ${config_mini_file}
|
||||
echo "listen_addresses = '127.0.0.1'" >> ${config_mini_file}
|
||||
|
||||
config_sample_file=%{apppath}/share/postgresql/postgresql.conf.sample
|
||||
if [[ -f $config_mini_file ]]
|
||||
@ -231,13 +266,13 @@ start_opengauss(){
|
||||
return 0
|
||||
fi
|
||||
|
||||
result=`su - opengauss -c "source ~/.bash_profile; gs_initdb -D /var/lib/opengauss/data -U opengauss --nodename=single_node"`
|
||||
result=`su - opengauss -c "source /var/lib/opengauss/.bash_profile; gs_initdb -D /var/lib/opengauss/data -U opengauss --nodename=single_node"`
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Init openGauss database failed."
|
||||
echo $result
|
||||
else
|
||||
echo "Init openGauss database success."
|
||||
result=`su - opengauss -c "source ~/.bash_profile; gs_ctl start -D /var/lib/opengauss/data"`
|
||||
result=`su - opengauss -c "source /var/lib/opengauss/.bash_profile; gs_ctl start -D /var/lib/opengauss/data"`
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Start openGauss database failed."
|
||||
echo $result
|
||||
@ -268,7 +303,7 @@ remove_service(){
|
||||
fi
|
||||
}
|
||||
clear_database(){
|
||||
pid=$(ps -ef | grep /var/lib/opengauss/data | grep -v grep | awk '{print $2}')
|
||||
pid=$(ps -ef | grep /usr/local/opengauss/bin/gaussdb | grep -v grep | awk '{print $2}')
|
||||
if [ "$pid" != "" ]; then
|
||||
kill -9 $pid
|
||||
fi
|
||||
@ -292,12 +327,30 @@ fi
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Aug 14 2023 zhangxubo <zhangxubo1@huawei.com> - 2.1.0-5
|
||||
* Fri Aug 18 2023 panchenbo <panchenbo@kylinsec.com.cn> - 2.1.0-11
|
||||
- add sw_64 support
|
||||
|
||||
* Mon Aug 14 2023 zhangxubo <zhangxubo1@huawei.com> - 2.1.0-10
|
||||
- Fix bugs: #I7QJRO
|
||||
|
||||
* Sat Feb 11 2023 zhangxubo <zhangxubo1@huawei.com> - 2.1.0-4
|
||||
* Tue Jun 6 2023 dillon chen<dillon.chen@gmail.com> - 2.1.0-9
|
||||
- Fix bugs: #I677QX; add lsof
|
||||
|
||||
* Mon Apr 10 2023 panchenbo <panchenbo@kylinsec.com.cn> - 2.1.0-8
|
||||
- add /etc/kylinsec-release support for KylinSec
|
||||
|
||||
* Sat Feb 11 2023 zhangxubo <zhangxubo1@huawei.com> - 2.1.0-7
|
||||
- Fix bugs: #I6ED94
|
||||
|
||||
* Wed Mar 30 2022 ouyangminxiang <ouyangminxiang@kylinsec.com.cn> - 2.1.0-6
|
||||
- add kylinsec platform
|
||||
|
||||
* Sat Mar 12 2022 zhangxubo <zhangxubo1@huawei.com> - 2.1.0-5
|
||||
- Fix bugs: #I4VDYQ #I4V624 #I4UOUU #I4TCDB #I4TCB8
|
||||
|
||||
* Thu Jan 27 2022 zhangxubo <zhangxubo1@huawei.com> - 2.1.0-4
|
||||
- Fix bugs: #I4SDWX
|
||||
|
||||
* Sat Jan 22 2022 zhangxubo <zhangxubo1@huawei.com> - 2.1.0-3
|
||||
- Fix bugs: #I4RVNX
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user