Skip to content

Commit

Permalink
support linux aarch64 (raspberry pi), my.cnf configuration file exten…
Browse files Browse the repository at this point in the history
…sion
  • Loading branch information
Limraj committed Jun 20, 2023
1 parent 11d02b9 commit ff5508b
Show file tree
Hide file tree
Showing 618 changed files with 85,414 additions and 65,797 deletions.
41 changes: 29 additions & 12 deletions java/java_install.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,38 @@
#!/bin/bash
export JAVA_HOME="$1/jdk"
export JAVA_BIN_DIR="$JAVA_HOME/bin"
export JAVA_HOME="$1"
JAVA_BIN_DIR="$JAVA_HOME/bin"

export JAVA_VERSION_ENCODED="11.0.19%2B7"
export JAVA_VERSION="11.0.19_7"
export JDK_DEST="jdk-11.0.19+7"
JAVA_VERSION="11.0.19"
JAVA_UPDATE="7"

export JDK_TAR_GZ_FILE="OpenJDK11U-jdk_x64_linux_hotspot_"$JAVA_VERSION".tar.gz"
JAVA_VERSION_ENCODED="${JAVA_VERSION}%2B${JAVA_UPDATE}"
JAVA_VERSION="${JAVA_VERSION}_${JAVA_UPDATE}"
JDK_DEST="jdk-${JAVA_VERSION}+${JAVA_UPDATE}"

if [ ! -d "$JAVA_BIN_DIR" ]; then
JAVA_ARCH=""
MACHINE_TYPE=`uname -m`
SERVER_MYSQL_DEST=""
SHELL_MYSQL_DEST=""

if [ ${MACHINE_TYPE} == 'aarch64' ]; then
echo "raspberry arm machine detected"
JAVA_ARCH="OpenJDK11U-jdk_aarch64_linux_hotspot_"
elif [ ${MACHINE_TYPE} == 'x86_64' ] || [ ${MACHINE_TYPE} == 'x64' ]; then
echo "64-bit machine detected"
JAVA_ARCH="OpenJDK11U-jdk_x64_linux_hotspot_"
else
echo "x86 architecture, 32-bit is not supported"
fi

if [ ! -d "$JAVA_BIN_DIR" ] && [! -z ${JAVA_ARCH} ]; then
JDK_TAR_GZ_FILE=${JAVA_ARCH}${JAVA_VERSION}".tar.gz"
cd "$JAVA_HOME"
wget https://github.com/adoptium/temurin11-binaries/releases/download/jdk-$JAVA_VERSION_ENCODED/$JDK_TAR_GZ_FILE
tar -xvf $JDK_TAR_GZ_FILE -C "$JAVA_HOME"
cd "$JAVA_HOME/$JDK_DEST"
wget https://github.com/adoptium/temurin11-binaries/releases/download/jdk-${JAVA_VERSION_ENCODED}/${JDK_TAR_GZ_FILE}
tar -xvf ${JDK_TAR_GZ_FILE} -C "$JAVA_HOME"
cd "$JAVA_HOME/${JDK_DEST}"
mv * "$JAVA_HOME"
cd ..
rm -rf $JDK_DEST
rm -f $JDK_TAR_GZ_FILE
rm -rf ${JDK_DEST}
rm -f ${JDK_TAR_GZ_FILE}
fi

107 changes: 102 additions & 5 deletions mysql/my.cnf
Original file line number Diff line number Diff line change
@@ -1,6 +1,103 @@
[mysqld]
log-bin-trust-function-creators=1
port=3308
character-set-server=utf8mb4
collation-server=utf8mb4_bin
lc_messages=en_US
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

[mysqld_safe]
socket = /mysql/server/bin/mysqld.sock
nice = 0

[mysqld]
#
# * Basic Settings
#
user = mysql
pid-file = /mysql/server/bin/mysqld.pid
socket = /mysql/server/bin/mysqld.sock
basedir = /mysql/server/
datadir = /mysql/server/data
tmpdir = /mysql/server/tmp
lc-messages-dir = /mysql/server/share
lc_messages = en_US
character-set-server = utf8mb4
collation-server = utf8mb4_bin

skip-external-locking
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
#
key_buffer_size = 768M
max_allowed_packet = 1024M
thread_stack = 256K
thread_cache_size = 40
tmp_table_size = 48M
max_heap_table_size = 48M

# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover-options = BACKUP
max_connections = 400

#general_log_file = /var/log/mysql/mysql.log
#general_log = 1
#
# Error log - should be very few entries.
#
log_error = /var/log/mysql/error.log
#
# Here you can see queries with especially long duration
slow_query_log = /var/log/mysql/mysql-slow.log
long_query_time = 1

# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
# other settings you may need to change.
#server-id = 1
#log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
innodb_buffer_pool_size = 2048M
innodb_file_per_table = 1
skip_name_resolve
innodb_buffer_pool_instances = 2
innodb_log_file_size = 256M

#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem
innodb_flush_log_at_trx_commit=1
log_bin_trust_function_creators = 1
innodb_print_all_deadlocks=1
78 changes: 51 additions & 27 deletions mysql/mysql_install.sh
Original file line number Diff line number Diff line change
@@ -1,51 +1,75 @@
#!/bin/bash
export USER="root"
export INIT_SCHEMA="$1/scadalts.sql"
export MY_CNF="$1/my.cnf"

export MYSQL_HOME="$1/server/"
export SHELL_HOME="$1/client/"

export DATADIR="$MYSQL_HOME/data"
export SERVER_BIN_DIR="$MYSQL_HOME/bin"
export CLIENT_BIN_DIR="$SHELL_HOME/bin"

if [ ! -d "$SERVER_BIN_DIR" ]; then
USER="root"
INIT_SCHEMA="$1/scadalts.sql"
MY_CNF="$1/my.cnf"

SERVER_BIN_DIR="$MYSQL_HOME/bin"
CLIENT_BIN_DIR="$SHELL_HOME/bin"

export SERVER_MYSQL_DEST="mysql-8.0.33-linux-glibc2.12-x86_64"
export SERVER_MSQL_TAR_FILE=$SERVER_MYSQL_DEST".tar"
export SERVER_MSQL_TAR_XZ_FILE=$SERVER_MYSQL_DEST".tar.xz"
MYSQL_PORT=-1

MACHINE_TYPE=`uname -m`
MYSQL_VERSION="8.0.33"
SERVER_MYSQL_DEST=""
SHELL_MYSQL_DEST=""

if [ ${MACHINE_TYPE} == 'aarch64' ]; then
echo "raspberry arm machine detected"
SERVER_MYSQL_DEST="mysql-${MYSQL_VERSION}-linux-glibc2.17-aarch64-minimal"
elif [ ${MACHINE_TYPE} == 'x86_64' ] || [ ${MACHINE_TYPE} == 'x64' ]; then
echo "64-bit machine detected"
SERVER_MYSQL_DEST="mysql-${MYSQL_VERSION}-linux-glibc2.12-x86_64"
SHELL_MYSQL_DEST="mysql-shell-${MYSQL_VERSION}-linux-glibc2.12-x86-64bit"
else
echo "x86 32-bit architecture is not supported"
fi

if [ ! -d "${SERVER_BIN_DIR}" ] && [! -z ${SERVER_MYSQL_DEST}]; then

SERVER_MSQL_TAR_FILE=${SERVER_MYSQL_DEST}".tar"
SERVER_MSQL_TAR_XZ_FILE=${SERVER_MYSQL_DEST}".tar.xz"

cd "$MYSQL_HOME"
wget https://dev.mysql.com/get/Downloads/MySQL-8.0/$SERVER_MSQL_TAR_FILE
tar -xvf $SERVER_MSQL_TAR_FILE -C "$MYSQL_HOME"
tar -xvf $SERVER_MSQL_TAR_XZ_FILE -C "$MYSQL_HOME"
cd "$MYSQL_HOME/$SERVER_MYSQL_DEST"
wget https://dev.mysql.com/get/Downloads/MySQL-8.0/${SERVER_MSQL_TAR_FILE}
tar -xvf ${SERVER_MSQL_TAR_FILE} -C "$MYSQL_HOME"
tar -xvf ${SERVER_MSQL_TAR_XZ_FILE} -C "$MYSQL_HOME"
cd "$MYSQL_HOME/${SERVER_MYSQL_DEST}"
mv * "$MYSQL_HOME"
cd ..
rm -rf $SERVER_MYSQL_DEST
rm -f $SERVER_MSQL_TAR_FILE
rm -rf ${SERVER_MYSQL_DEST}
rm -f ${SERVER_MSQL_TAR_FILE}
rm -f *.tar.xz

if [${MYSQL_PORT} == -1]; then
echo -n "Port: "
read -r MYSQL_PORT
echo "port = ${MYSQL_PORT}" >> ${MY_CNF}
fi
echo "MySQL Community Server version ${MYSQL_VERSION} installed"
fi

if [ ! -d "$CLIENT_BIN_DIR" ]; then
if [ ! -d "$CLIENT_BIN_DIR" ] && [! -z ${SHELL_MYSQL_DEST}]; then

export SHELL_MYSQL_DEST="mysql-shell-8.0.33-linux-glibc2.12-x86-64bit"
export SHELL_MYSQL_TAR_GZ_FILE=$SHELL_MYSQL_DEST".tar.gz"
SHELL_MYSQL_TAR_GZ_FILE=$SHELL_MYSQL_DEST".tar.gz"

cd "$SHELL_HOME"
wget https://dev.mysql.com/get/Downloads/MySQL-Shell/$SHELL_MYSQL_TAR_GZ_FILE
tar -xvf $SHELL_MYSQL_TAR_GZ_FILE -C "$SHELL_HOME"
cd "$SHELL_HOME/$SHELL_MYSQL_DEST"
wget https://dev.mysql.com/get/Downloads/MySQL-Shell/${SHELL_MYSQL_TAR_GZ_FILE}
tar -xvf ${SHELL_MYSQL_TAR_GZ_FILE} -C "$SHELL_HOME"
cd "$SHELL_HOME/${SHELL_MYSQL_DEST}"
mv * "$SHELL_HOME"
cd ..
rm -rf $SHELL_MYSQL_DEST
rm -f $SHELL_MYSQL_TAR_GZ_FILE
rm -rf ${SHELL_MYSQL_DEST}
rm -f ${SHELL_MYSQL_TAR_GZ_FILE}
echo "MySQL Shell version ${MYSQL_VERSION} installed"
fi

if [ ! -d "$DATADIR" ]; then
mkdir -p $DATADIR
cd $SERVER_BIN_DIR
./mysqld --defaults-file=$MY_CNF --initialize-insecure --datadir $DATADIR --user=$USER --init-file=$INIT_SCHEMA --console
cd ${SERVER_BIN_DIR}
./mysqld --defaults-file=${MY_CNF} --initialize-insecure --datadir $DATADIR --user=${USER} --init-file=${INIT_SCHEMA} --console
fi

File renamed without changes.
Binary file removed tomcat64/bin/commons-daemon-native.tar.gz
Binary file not shown.
Binary file removed tomcat64/bin/commons-daemon.jar
Binary file not shown.
Binary file removed tomcat64/bin/tomcat-native.tar.gz
Binary file not shown.
File renamed without changes.
Loading

0 comments on commit ff5508b

Please sign in to comment.