mirror of
https://github.com/MiyooCFW/buildroot.git
synced 2025-09-27 22:24:19 +03:00
Merge from bittboy/buildroot@db180c0
This commit is contained in:
27
package/mariadb/0001-add-extra-check-for-librt.patch
Normal file
27
package/mariadb/0001-add-extra-check-for-librt.patch
Normal file
@@ -0,0 +1,27 @@
|
||||
From e6244400dfd3547531a3a3289fadbbe19873f096 Mon Sep 17 00:00:00 2001
|
||||
From: Ryan Coe <bluemrp9@gmail.com>
|
||||
Date: Thu, 27 Oct 2016 20:33:21 -0700
|
||||
Subject: [PATCH] add extra check for librt
|
||||
|
||||
Signed-off-by: Ryan Coe <bluemrp9@gmail.com>
|
||||
---
|
||||
configure.cmake | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/configure.cmake b/configure.cmake
|
||||
index 896226de954f4642a238ca6a72e0930590dc1681..77ca485fb05e6b63bb69f9561b4eabfaa208a419 100644
|
||||
--- a/configure.cmake
|
||||
+++ b/configure.cmake
|
||||
@@ -126,6 +126,9 @@ IF(UNIX)
|
||||
IF(NOT LIBRT)
|
||||
MY_SEARCH_LIBS(clock_gettime rt LIBRT)
|
||||
ENDIF()
|
||||
+ IF(NOT LIBRT)
|
||||
+ MY_SEARCH_LIBS(posix_spawn_file_actions_addclose rt LIBRT)
|
||||
+ ENDIF()
|
||||
FIND_PACKAGE(Threads)
|
||||
|
||||
SET(CMAKE_REQUIRED_LIBRARIES
|
||||
--
|
||||
2.9.3
|
||||
|
||||
77
package/mariadb/S97mysqld
Normal file
77
package/mariadb/S97mysqld
Normal file
@@ -0,0 +1,77 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# mysql
|
||||
#
|
||||
|
||||
MYSQL_LIB="/var/lib/mysql"
|
||||
MYSQL_RUN="/run/mysql"
|
||||
MYSQL_PID="$MYSQL_RUN/mysqld.pid"
|
||||
MYSQL_BIN="/usr/bin"
|
||||
|
||||
wait_for_ready() {
|
||||
WAIT_DELAY=5
|
||||
while [ $WAIT_DELAY -gt 0 ]; do
|
||||
if $MYSQL_BIN/mysqladmin ping > /dev/null 2>&1; then
|
||||
return 0
|
||||
fi
|
||||
sleep 1
|
||||
: $((WAIT_DELAY -= 1))
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
start() {
|
||||
if [ `ls -1 $MYSQL_LIB | wc -l` = 0 ] ; then
|
||||
printf "Creating mysql system tables ... "
|
||||
$MYSQL_BIN/mysql_install_db --basedir=/usr --user=mysql \
|
||||
--datadir=$MYSQL_LIB > /dev/null 2>&1
|
||||
if [ $? != 0 ]; then
|
||||
echo "FAIL"
|
||||
exit 1
|
||||
fi
|
||||
echo "OK"
|
||||
fi
|
||||
|
||||
# mysqld runs as user mysql, but /run is only writable by root
|
||||
# so create a subdirectory for mysql.
|
||||
install -d -o mysql -g root -m 0755 $MYSQL_RUN
|
||||
|
||||
# We don't use start-stop-daemon because mysqld has its own
|
||||
# wrapper script.
|
||||
printf "Starting mysql ... "
|
||||
$MYSQL_BIN/mysqld_safe --pid-file=$MYSQL_PID --user=mysql \
|
||||
> /dev/null 2>&1 &
|
||||
wait_for_ready
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf "Stopping mysql ... "
|
||||
if [ -f $MYSQL_PID ]; then
|
||||
kill `cat $MYSQL_PID` > /dev/null 2>&1
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
sleep 1
|
||||
start
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart)
|
||||
restart
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
;;
|
||||
esac
|
||||
9
package/mariadb/mariadb.hash
Normal file
9
package/mariadb/mariadb.hash
Normal file
@@ -0,0 +1,9 @@
|
||||
# From https://downloads.mariadb.org/mariadb/10.3.16
|
||||
md5 11220d0b94c5c24caa2e1e9eaba38e31 mariadb-10.3.16.tar.gz
|
||||
sha1 6a4ee3be06f38b9aef1cd4f99099abea6a17de69 mariadb-10.3.16.tar.gz
|
||||
sha256 39e9723eaf620afd99b0925b2c2a5a50a89110ba50040adf14cce7cf89e5e21b mariadb-10.3.16.tar.gz
|
||||
sha512 b22a8c8fa0265f88962432ade71c3f0ec554f7d38042def832cfcb50f3aa1dd77a715c76706ffeae679b95438529b06e98b73b7e219f9c645980802027ec022f mariadb-10.3.16.tar.gz
|
||||
|
||||
# Hash for license files
|
||||
sha256 a4665c1189fe31e0bbc27e9b55439df7dad6e99805407fe58d78da7aabe678f8 README.md
|
||||
sha256 240a15a1d0f34d3abca462cdb7e5fb89470967563f16b0e71169e51c1e74cf2b COPYING
|
||||
137
package/mariadb/mariadb.mk
Normal file
137
package/mariadb/mariadb.mk
Normal file
@@ -0,0 +1,137 @@
|
||||
################################################################################
|
||||
#
|
||||
# mariadb
|
||||
#
|
||||
################################################################################
|
||||
|
||||
MARIADB_VERSION = 10.3.16
|
||||
MARIADB_SITE = https://downloads.mariadb.org/interstitial/mariadb-$(MARIADB_VERSION)/source
|
||||
MARIADB_LICENSE = GPL-2.0 (server), GPL-2.0 with FLOSS exception (GPL client library), LGPL-2.0 (LGPL client library)
|
||||
# Tarball no longer contains LGPL license text
|
||||
# https://jira.mariadb.org/browse/MDEV-12297
|
||||
MARIADB_LICENSE_FILES = README.md COPYING
|
||||
MARIADB_INSTALL_STAGING = YES
|
||||
MARIADB_PROVIDES = mysql
|
||||
|
||||
MARIADB_DEPENDENCIES = \
|
||||
host-mariadb \
|
||||
ncurses \
|
||||
openssl \
|
||||
zlib \
|
||||
libaio \
|
||||
libxml2 \
|
||||
readline
|
||||
|
||||
# We won't need unit tests
|
||||
MARIADB_CONF_OPTS += -DWITH_UNIT_TESTS=0
|
||||
|
||||
# Mroonga needs libstemmer. Some work still needs to be done before it can be
|
||||
# included in buildroot. Disable it for now.
|
||||
MARIADB_CONF_OPTS += -DWITHOUT_MROONGA=1
|
||||
|
||||
# This value is determined automatically during straight compile by compiling
|
||||
# and running a test code. You cannot do that during cross-compile. However the
|
||||
# stack grows downward in most if not all modern systems. The only exception I
|
||||
# am aware of is PA-RISC which is not supported by buildroot. Therefore it makes
|
||||
# sense to hardcode the value. If an arch is added the stack of which grows up
|
||||
# one should expect unpredictable behavior at run time.
|
||||
MARIADB_CONF_OPTS += -DSTACK_DIRECTION=-1
|
||||
|
||||
# Jemalloc was added for TokuDB. Since its configure script seems somewhat broken
|
||||
# when it comes to cross-compilation we shall disable it and also disable TokuDB.
|
||||
MARIADB_CONF_OPTS += -DWITH_JEMALLOC=no -DWITHOUT_TOKUDB=1
|
||||
|
||||
# RocksDB fails to build in some configurations with the following build error:
|
||||
# ./output/build/mariadb-10.2.17/storage/rocksdb/rocksdb/utilities/backupable/backupable_db.cc:327:38:
|
||||
# error: field 'result' has incomplete type 'std::promise<rocksdb::BackupEngineImpl::CopyOrCreateResult>'
|
||||
# std::promise<CopyOrCreateResult> result;
|
||||
#
|
||||
# To work around the issue, we disable RocksDB
|
||||
MARIADB_CONF_OPTS += -DWITHOUT_ROCKSDB=1
|
||||
|
||||
# Make it explicit that we are cross-compiling
|
||||
MARIADB_CONF_OPTS += -DCMAKE_CROSSCOMPILING=1
|
||||
|
||||
# Explicitly disable dtrace to avoid detection of a host version
|
||||
MARIADB_CONF_OPTS += -DENABLE_DTRACE=0
|
||||
|
||||
ifeq ($(BR2_PACKAGE_MARIADB_SERVER),y)
|
||||
ifeq ($(BR2_PACKAGE_MARIADB_SERVER_EMBEDDED),y)
|
||||
MARIADB_CONF_OPTS += -DWITH_EMBEDDED_SERVER=ON
|
||||
else
|
||||
MARIADB_CONF_OPTS += -DWITH_EMBEDDED_SERVER=OFF
|
||||
endif
|
||||
else
|
||||
MARIADB_CONF_OPTS += -DWITHOUT_SERVER=ON
|
||||
endif
|
||||
|
||||
MARIADB_CXXFLAGS = $(TARGET_CXXFLAGS)
|
||||
|
||||
ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
|
||||
MARIADB_CXXFLAGS += -latomic
|
||||
endif
|
||||
|
||||
MARIADB_CONF_OPTS += \
|
||||
-DCMAKE_CXX_FLAGS="$(MARIADB_CXXFLAGS)" \
|
||||
-DINSTALL_DOCDIR=share/doc/mariadb-$(MARIADB_VERSION) \
|
||||
-DINSTALL_DOCREADMEDIR=share/doc/mariadb-$(MARIADB_VERSION) \
|
||||
-DINSTALL_MANDIR=share/man \
|
||||
-DINSTALL_MYSQLSHAREDIR=share/mysql \
|
||||
-DINSTALL_MYSQLTESTDIR=share/mysql/test \
|
||||
-DINSTALL_PLUGINDIR=lib/mysql/plugin \
|
||||
-DINSTALL_SBINDIR=sbin \
|
||||
-DINSTALL_SCRIPTDIR=bin \
|
||||
-DINSTALL_SQLBENCHDIR=share/mysql/bench \
|
||||
-DINSTALL_SUPPORTFILESDIR=share/mysql \
|
||||
-DMYSQL_DATADIR=/var/lib/mysql \
|
||||
-DMYSQL_UNIX_ADDR=$(MYSQL_SOCKET)
|
||||
|
||||
HOST_MARIADB_CONF_OPTS += -DWITH_SSL=OFF
|
||||
|
||||
# Some helpers must be compiled for host in order to crosscompile mariadb for
|
||||
# the target. They are then included by import_executables.cmake which is
|
||||
# generated during the build of the host helpers. It is not necessary to build
|
||||
# the whole host package, only the "import_executables" target.
|
||||
# -DIMPORT_EXECUTABLES=$(HOST_MARIADB_BUILDDIR)/import_executables.cmake
|
||||
# must then be passed to cmake during target build.
|
||||
# see also https://mariadb.com/kb/en/mariadb/cross-compiling-mariadb/
|
||||
HOST_MARIADB_MAKE_OPTS = import_executables
|
||||
|
||||
MARIADB_CONF_OPTS += \
|
||||
-DIMPORT_EXECUTABLES=$(HOST_MARIADB_BUILDDIR)/import_executables.cmake
|
||||
|
||||
# Don't install host-mariadb. We just need to build import_executable
|
||||
# Therefore only run 'true' and do nothing, not even the default action.
|
||||
HOST_MARIADB_INSTALL_CMDS = true
|
||||
|
||||
ifeq ($(BR2_PACKAGE_MARIADB_SERVER),y)
|
||||
define MARIADB_USERS
|
||||
mysql -1 mysql -1 * /var/lib/mysql - - MySQL Server
|
||||
endef
|
||||
|
||||
define MARIADB_INSTALL_INIT_SYSV
|
||||
$(INSTALL) -D -m 0755 package/mariadb/S97mysqld \
|
||||
$(TARGET_DIR)/etc/init.d/S97mysqld
|
||||
endef
|
||||
|
||||
define MARIADB_INSTALL_INIT_SYSTEMD
|
||||
$(INSTALL) -D -m 644 package/mariadb/mysqld.service \
|
||||
$(TARGET_DIR)/usr/lib/systemd/system/mysqld.service
|
||||
mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
|
||||
ln -sf ../../../../usr/lib/systemd/system/mysqld.service \
|
||||
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/mysqld.service
|
||||
endef
|
||||
endif
|
||||
|
||||
# We don't need mysql_config on the target as it's only useful in staging
|
||||
# We also don't need the test suite on the target
|
||||
define MARIADB_POST_INSTALL
|
||||
mkdir -p $(TARGET_DIR)/var/lib/mysql
|
||||
$(RM) $(TARGET_DIR)/usr/bin/mysql_config
|
||||
$(RM) -r $(TARGET_DIR)/usr/share/mysql/test
|
||||
endef
|
||||
|
||||
MARIADB_POST_INSTALL_TARGET_HOOKS += MARIADB_POST_INSTALL
|
||||
|
||||
$(eval $(cmake-package))
|
||||
$(eval $(host-cmake-package))
|
||||
13
package/mariadb/mysqld.service
Normal file
13
package/mariadb/mysqld.service
Normal file
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=MySQL database server
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/bin/sh -c 'test "`ls -1 /var/lib/mysql | wc -l`" != "0" || mysql_install_db --basedir=/usr --datadir=/var/lib/mysql'
|
||||
ExecStart=/usr/bin/mysqld_safe
|
||||
Restart=always
|
||||
User=mysql
|
||||
RuntimeDirectory=mysql
|
||||
RuntimeDirectoryMode=0755
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user