forked from openGauss-Ecosystem/openGauss-server
添加小型化安装包构建选项
This commit is contained in:
parent
68cb4eb003
commit
06773c3c05
17
build.sh
17
build.sh
|
@ -4,6 +4,7 @@ declare build_version_mode='release'
|
|||
declare build_binarylib_dir='None'
|
||||
declare wrap_binaries='NO'
|
||||
declare not_optimized=''
|
||||
declare config_file=''
|
||||
#########################################################################
|
||||
##read command line paramenters
|
||||
#######################################################################
|
||||
|
@ -12,11 +13,12 @@ function print_help()
|
|||
{
|
||||
echo "Usage: $0 [OPTION]
|
||||
-h|--help show help information
|
||||
-m|--version_mode this values of paramenter is debug, release or memcheck, the default value is release
|
||||
-m|--version_mode this values of paramenter is debug, release, memcheck or mini, the default value is release
|
||||
-3rd|--binarylib_dir the parent directory of binarylibs
|
||||
-pkg|--package (deprecated option)package the project,by default, only compile the project
|
||||
-wrap|--wrap_binaries wrop up the project binaries. By default, only compile the project
|
||||
-nopt|--not_optimized on kunpeng platform, like 1616 version, without LSE optimized
|
||||
-f|--config_file set postgresql.conf.sample from config_file when packing
|
||||
"
|
||||
}
|
||||
|
||||
|
@ -28,7 +30,7 @@ while [ $# -gt 0 ]; do
|
|||
;;
|
||||
-m|--version_mode)
|
||||
if [ "$2"X = X ]; then
|
||||
echo "no given correct version information, such as: debug/release/memcheck"
|
||||
echo "no given correct version information, such as: debug/release/memcheck/mini"
|
||||
exit 1
|
||||
fi
|
||||
build_version_mode=$2
|
||||
|
@ -50,6 +52,15 @@ while [ $# -gt 0 ]; do
|
|||
not_optimized='-nopt'
|
||||
shift 1
|
||||
;;
|
||||
-f|--config_file)
|
||||
if [[ ! -f "$2" ]]
|
||||
then
|
||||
echo "config_file does not exist"
|
||||
exit 1
|
||||
fi
|
||||
config_file=$(realpath "$2")
|
||||
shift 2
|
||||
;;
|
||||
*)
|
||||
echo "Internal Error: option processing error: $1" 1>&2
|
||||
echo "please input right paramtenter, the following command may help you"
|
||||
|
@ -67,6 +78,6 @@ sh build_opengauss.sh -m ${build_version_mode} -3rd ${build_binarylib_dir} ${not
|
|||
if [ "${wrap_binaries}"X = "YES"X ]
|
||||
then
|
||||
chmod a+x build_opengauss.sh
|
||||
sh package_opengauss.sh -3rd ${build_binarylib_dir}
|
||||
sh package_opengauss.sh -3rd ${build_binarylib_dir} -m ${build_version_mode} -f ${config_file}
|
||||
fi
|
||||
exit 0
|
||||
|
|
|
@ -732,6 +732,8 @@ function install_gaussdb()
|
|||
./configure $shared_opt CFLAGS="-O2 -g3 ${GAUSSDB_EXTRA_FLAGS}" --enable-mot --disable-jemalloc CC=g++ $extra_config_opt >> "$LOG_FILE" 2>&1
|
||||
elif [ "$version_mode"x == "fiudebug"x ]; then
|
||||
./configure $shared_opt CFLAGS="-O0 ${GAUSSDB_EXTRA_FLAGS}" --enable-mot --enable-debug --enable-cassert --disable-jemalloc CC=g++ $extra_config_opt >> "$LOG_FILE" 2>&1
|
||||
elif [ "$version_mode"x == "mini"x ]; then
|
||||
./configure $shared_opt CFLAGS="-O2 ${GAUSSDB_EXTRA_FLAGS}" --disable-llvm CC=g++ $extra_config_opt >> "$LOG_FILE" 2>&1
|
||||
else
|
||||
./configure $shared_opt CFLAGS="-O0 ${GAUSSDB_EXTRA_FLAGS}" --enable-mot --enable-debug --enable-cassert CC=g++ $extra_config_opt >> "$LOG_FILE" 2>&1
|
||||
fi
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
wal_buffers = -1 # min 32kB
|
||||
cstore_buffers = 16MB #min 16MB
|
||||
max_locks_per_transaction = 10 # min 10
|
||||
shared_buffers = 2MB # min 128kB
|
||||
data_replicate_buffer_size = 4096 # data replication buffer size
|
||||
max_connections = 16 # (change requires restart)
|
||||
asp_sample_num = 10000
|
||||
enable_double_write = off
|
||||
enable_incremental_checkpoint = off # enable incremental checkpoint
|
||||
num_internal_lock_partitions = 'CLOG_PART=1,CSNLOG_PART=1'
|
||||
wal_insert_status_entries = 524288
|
File diff suppressed because it is too large
Load Diff
|
@ -19,6 +19,7 @@
|
|||
|
||||
declare version_mode='release'
|
||||
declare binarylib_dir='None'
|
||||
declare config_file=''
|
||||
|
||||
#detect platform information.
|
||||
PLATFORM=32
|
||||
|
@ -72,6 +73,52 @@ fi
|
|||
declare release_file_list="opengauss_release_list_${kernel}_single"
|
||||
declare dest_list=""
|
||||
|
||||
#########################################################################
|
||||
##read command line paramenters
|
||||
#######################################################################
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
print_help
|
||||
exit 1
|
||||
;;
|
||||
-v|--version)
|
||||
print_version
|
||||
exit 1
|
||||
;;
|
||||
-m|--version_mode)
|
||||
if [ "$2"X = X ]; then
|
||||
echo "no given version number values"
|
||||
exit 1
|
||||
fi
|
||||
version_mode=$2
|
||||
shift 2
|
||||
;;
|
||||
-3rd|--binarylibs_dir)
|
||||
if [ "$2"X = X ]; then
|
||||
echo "no given binarylib directory values"
|
||||
exit 1
|
||||
fi
|
||||
binarylib_dir=$2
|
||||
shift 2
|
||||
;;
|
||||
-f|--config_file)
|
||||
if [ "$2"X = X ]; then
|
||||
echo "no given config file"
|
||||
shift 1
|
||||
else
|
||||
config_file=$2
|
||||
shift 2
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Internal Error: option processing error: $1" 1>&2
|
||||
echo "please input right paramtenter, the following command may help you"
|
||||
echo "./package.sh --help or ./package.sh -h"
|
||||
exit 1
|
||||
esac
|
||||
done
|
||||
|
||||
##add platform architecture information
|
||||
PLATFORM_ARCH=$(uname -p)
|
||||
if [ "$PLATFORM_ARCH"X == "aarch64"X ] ; then
|
||||
|
@ -83,6 +130,10 @@ if [ "$PLATFORM_ARCH"X == "aarch64"X ] ; then
|
|||
release_file_list="opengauss_release_list_${kernel}_aarch64_single"
|
||||
fi
|
||||
|
||||
if [ "$version_mode" = "mini" ]; then
|
||||
release_file_list="opengauss_release_list_mini"
|
||||
fi
|
||||
|
||||
##default install version storage path
|
||||
declare server_version='openGauss'
|
||||
declare server_name_for_package="$(echo ${server_version} | sed 's/ /-/g')" # replace blank with '-' for package name.
|
||||
|
@ -150,43 +201,6 @@ SCRIPT_DIR=$(cd $(dirname $0) && pwd)
|
|||
test -d ${SCRIPT_DIR}/../../output || mkdir -p ${SCRIPT_DIR}/../../output && rm -fr ${SCRIPT_DIR}/../../output/*
|
||||
output_path=$(cd ${SCRIPT_DIR}/../../output && pwd)
|
||||
|
||||
#########################################################################
|
||||
##read command line paramenters
|
||||
#######################################################################
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
print_help
|
||||
exit 1
|
||||
;;
|
||||
-v|--version)
|
||||
print_version
|
||||
exit 1
|
||||
;;
|
||||
-m|--version_mode)
|
||||
if [ "$2"X = X ]; then
|
||||
echo "no given version number values"
|
||||
exit 1
|
||||
fi
|
||||
version_mode=$2
|
||||
shift 2
|
||||
;;
|
||||
-3rd|--binarylibs_dir)
|
||||
if [ "$2"X = X ]; then
|
||||
echo "no given binarylib directory values"
|
||||
exit 1
|
||||
fi
|
||||
binarylib_dir=$2
|
||||
shift 2
|
||||
;;
|
||||
*)
|
||||
echo "Internal Error: option processing error: $1" 1>&2
|
||||
echo "please input right paramtenter, the following command may help you"
|
||||
echo "./package.sh --help or ./package.sh -h"
|
||||
exit 1
|
||||
esac
|
||||
done
|
||||
|
||||
read_srv_version
|
||||
|
||||
#######################################################################
|
||||
|
@ -270,7 +284,7 @@ die()
|
|||
function install_gaussdb()
|
||||
{
|
||||
cd $SCRIPT_DIR
|
||||
if [ "$version_mode" = "release" ]; then
|
||||
if [ "$version_mode" = "release" ] || [ "$version_mode" = "mini" ]; then
|
||||
chmod +x ./separate_debug_information.sh
|
||||
./separate_debug_information.sh
|
||||
cd $SCRIPT_DIR
|
||||
|
@ -303,12 +317,41 @@ function copy_files_list()
|
|||
done
|
||||
}
|
||||
|
||||
#######################################################################
|
||||
# set postgresql.conf.sample from config_file when packing
|
||||
#######################################################################
|
||||
function set_config_sample()
|
||||
{
|
||||
if [[ -f $config_file ]]
|
||||
then
|
||||
config_sample_file=${BUILD_DIR}/share/postgresql/postgresql.conf.sample
|
||||
if [[ ! -f "$config_sample_file" ]]
|
||||
then
|
||||
echo "postgresql.conf.sample does not exist"
|
||||
exit 1
|
||||
else
|
||||
echo "#------------------------------------------------------------------------------" >> $config_sample_file
|
||||
echo "# USER SET CONFIG ON COMPILING TIME" >> $config_sample_file
|
||||
echo "#------------------------------------------------------------------------------" >> $config_sample_file
|
||||
while IFS= read -r line; do
|
||||
SUBSTRING=$(echo $line | cut -d'=' -f 1)"= "
|
||||
if grep -q "$SUBSTRING" $config_sample_file ; then
|
||||
sed -i "/$SUBSTRING/c$line" $config_sample_file
|
||||
else
|
||||
echo $line >> $config_sample_file
|
||||
fi
|
||||
done < $config_file
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
#######################################################################
|
||||
##copy target file into temporary directory temp
|
||||
#######################################################################
|
||||
function target_file_copy()
|
||||
{
|
||||
cd ${BUILD_DIR}
|
||||
set_config_sample
|
||||
copy_files_list "$1" $2
|
||||
|
||||
cp ${SCRIPT_DIR}/version.cfg ${BUILD_DIR}/temp
|
||||
|
|
Loading…
Reference in New Issue