mariadb: new package
v3 cover mariadb: new package
This patch series represents my attempt to add MariaDB 10.1 to Buildroot. Based on feedback, this series does three things. First, the old mysql package is renamed to oracle-mysql. Second, mariadb is added as a new package. Third, mysql is converted to a virtual package. I have tested this on arm and x86_64 with uclibc and glibc.
Based on the work by:
Sylvain Raybaud <[email protected]>
https://patchwork.ozlabs.org/patch/538045/
Changes v3 -> v2
- rebased
- add mariadb as new package instead of replacing mysql (suggested by Thomas Petazzoni)
- added patch to fix uclibc build on arm (suggested by Floris Bos)
- changed sysv startup script to use mysqladmin ping (suggested by Floris Bos)
- added depends on BR2_PACKAGE_LIBAIO_ARCH_SUPPORTS (suggested by Thomas Petazzoni)
- removed dependency on libtool (suggested by Thomas Petazzoni)
- fixed license (suggested by Thomas Petazzoni and Arnout Vandecappelle)
- formatting cleanups
Changes v1 -> v2
- rebased
- added openssl as dependency (suggested by Floris Bos)
- bumped to mariadb version 10.1 (suggested by Floris Bos)
- replaced custom my.cnf with my-small.cnf provided in the target (suggested by Floris Bos)
Ryan Coe (3):
mysql: rename package to oracle-mysql
mariadb: new package
mysql: convert to virtual package
DEVELOPERS | 3 +
.../mariadb/0001-add-extra-check-for-librt.patch | 26 ++++
...ld-failure-when-HAVE_STACKTRACE-is-not-de.patch | 33 +++++
package/mariadb/S97mysqld | 77 ++++++++++++
package/mariadb/mariadb.hash | 2 +
package/mariadb/mariadb.mk | 114 +++++++++++++++++
package/mariadb/mysqld.service | 13 ++
package/mysql/Config.in | 73 +++++++++--
package/mysql/mysql.mk | 130 +-------------------
.../0000-ac_cache_check.patch | 0
.../0001-configure-ps-cache-check.patch | 0
.../0002-use-new-readline-iface.patch | 0
.../0003-ac_stack_direction-is-unset.patch | 0
.../0004-Fix-gen_lex_hash-execution.patch | 0
.../0005-bison_3_breaks_mysql_server_build.patch | 0
.../0006-no-force-static-build.patch | 0
.../0007-dont-install-in-mysql-directory.patch | 0
package/{mysql => oracle-mysql}/S97mysqld | 0
package/{mysql => oracle-mysql}/mysqld.service | 0
.../mysql.hash => oracle-mysql/oracle-mysql.hash} | 0
package/oracle-mysql/oracle-mysql.mk | 136 +++++++++++++++++++++
21 files changed, 471 insertions(+), 136 deletions(-)
create mode 100644 package/mariadb/0001-add-extra-check-for-librt.patch
create mode 100644 package/mariadb/0002-prevent-build-failure-when-HAVE_STACKTRACE-is-not-de.patch
create mode 100644 package/mariadb/S97mysqld
create mode 100644 package/mariadb/mariadb.hash
create mode 100644 package/mariadb/mariadb.mk
create mode 100644 package/mariadb/mysqld.service
rename package/{mysql => oracle-mysql}/0000-ac_cache_check.patch (100%)
rename package/{mysql => oracle-mysql}/0001-configure-ps-cache-check.patch (100%)
rename package/{mysql => oracle-mysql}/0002-use-new-readline-iface.patch (100%)
rename package/{mysql => oracle-mysql}/0003-ac_stack_direction-is-unset.patch (100%)
rename package/{mysql => oracle-mysql}/0004-Fix-gen_lex_hash-execution.patch (100%)
rename package/{mysql => oracle-mysql}/0005-bison_3_breaks_mysql_server_build.patch (100%)
rename package/{mysql => oracle-mysql}/0006-no-force-static-build.patch (100%)
rename package/{mysql => oracle-mysql}/0007-dont-install-in-mysql-directory.patch (100%)
rename package/{mysql => oracle-mysql}/S97mysqld (100%)
rename package/{mysql => oracle-mysql}/mysqld.service (100%)
rename package/{mysql/mysql.hash => oracle-mysql/oracle-mysql.hash} (100%)
create mode 100644 package/oracle-mysql/oracle-mysql.mkSignature · 1 line
2.9.3
RFC v3 1/3 mysql: rename package to oracle-mysql
---
package/Config.in | 2 +-
.../0000-ac_cache_check.patch | 0
.../0001-configure-ps-cache-check.patch | 0
.../0002-use-new-readline-iface.patch | 0
.../0003-ac_stack_direction-is-unset.patch | 0
.../0004-Fix-gen_lex_hash-execution.patch | 0
.../0005-bison_3_breaks_mysql_server_build.patch | 0
.../0006-no-force-static-build.patch | 0
.../0007-dont-install-in-mysql-directory.patch | 0
package/{mysql => oracle-mysql}/Config.in | 12 ++--
package/{mysql => oracle-mysql}/S97mysqld | 0
package/{mysql => oracle-mysql}/mysqld.service | 0
.../mysql.hash => oracle-mysql/oracle-mysql.hash} | 0
.../mysql.mk => oracle-mysql/oracle-mysql.mk} | 66 +++++++++++-----------
14 files changed, 40 insertions(+), 40 deletions(-)
rename package/{mysql => oracle-mysql}/0000-ac_cache_check.patch (100%)
rename package/{mysql => oracle-mysql}/0001-configure-ps-cache-check.patch (100%)
rename package/{mysql => oracle-mysql}/0002-use-new-readline-iface.patch (100%)
rename package/{mysql => oracle-mysql}/0003-ac_stack_direction-is-unset.patch (100%)
rename package/{mysql => oracle-mysql}/0004-Fix-gen_lex_hash-execution.patch (100%)
rename package/{mysql => oracle-mysql}/0005-bison_3_breaks_mysql_server_build.patch (100%)
rename package/{mysql => oracle-mysql}/0006-no-force-static-build.patch (100%)
rename package/{mysql => oracle-mysql}/0007-dont-install-in-mysql-directory.patch (100%)
rename package/{mysql => oracle-mysql}/Config.in (65%)
rename package/{mysql => oracle-mysql}/S97mysqld (100%)
rename package/{mysql => oracle-mysql}/mysqld.service (100%)
rename package/{mysql/mysql.hash => oracle-mysql/oracle-mysql.hash} (100%)
rename package/{mysql/mysql.mk => oracle-mysql/oracle-mysql.mk} (65%)package/Config.in +1 -1
@@ -910,7 +910,7 @@ menu "Database" source "package/leveldb/Config.in" source "package/libpqxx/Config.in" source "package/mongodb/Config.in" - source "package/mysql/Config.in" + source "package/oracle-mysql/Config.in" source "package/postgresql/Config.in" source "package/redis/Config.in" source "package/sqlcipher/Config.in"
package/oracle-mysql/0000-ac_cache_check.patch renamed from package/mysql/0000-ac_cache_check.patch +0 -0
package/oracle-mysql/0001-configure-ps-cache-check.patch renamed from package/mysql/0001-configure-ps-cache-check.patch +0 -0
package/oracle-mysql/0002-use-new-readline-iface.patch renamed from package/mysql/0002-use-new-readline-iface.patch +0 -0
package/oracle-mysql/0003-ac_stack_direction-is-unset.patch renamed from package/mysql/0003-ac_stack_direction-is-unset.patch +0 -0
package/oracle-mysql/0004-Fix-gen_lex_hash-execution.patch renamed from package/mysql/0004-Fix-gen_lex_hash-execution.patch +0 -0
package/oracle-mysql/0005-bison_3_breaks_mysql_server_build.patch renamed from package/mysql/0005-bison_3_breaks_mysql_server_build.patch +0 -0
package/oracle-mysql/0006-no-force-static-build.patch renamed from package/mysql/0006-no-force-static-build.patch +0 -0
package/oracle-mysql/0007-dont-install-in-mysql-directory.patch renamed from package/mysql/0007-dont-install-in-mysql-directory.patch +0 -0
package/oracle-mysql/Config.in renamed from package/mysql/Config.in +6 -6
@@ -1,5 +1,5 @@ -config BR2_PACKAGE_MYSQL - bool "MySQL" +config BR2_PACKAGE_ORACLE_MYSQL + bool "oracle mysql" depends on BR2_INSTALL_LIBSTDCPP depends on BR2_USE_MMU # fork() depends on BR2_TOOLCHAIN_HAS_THREADS
@@ -10,15 +10,15 @@ config BR2_PACKAGE_MYSQL http://www.mysql.com/ -if BR2_PACKAGE_MYSQL +if BR2_PACKAGE_ORACLE_MYSQL -config BR2_PACKAGE_MYSQL_SERVER - bool "MySQL server" +config BR2_PACKAGE_ORACLE_MYSQL_SERVER + bool "oracle mysql server" help Install the MySQL server on the target. endif -comment "MySQL needs a toolchain w/ C++, threads" +comment "oracle mysql needs a toolchain w/ C++, threads" depends on BR2_USE_MMU depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
package/oracle-mysql/S97mysqld renamed from package/mysql/S97mysqld +0 -0
package/oracle-mysql/mysqld.service renamed from package/mysql/mysqld.service +0 -0
package/oracle-mysql/oracle-mysql.hash renamed from package/mysql/mysql.hash +0 -0
package/oracle-mysql/oracle-mysql.mk renamed from package/mysql/mysql.mk +33 -33
142 lines not on this page · raw message
Signature · 1 line
2.9.3
RFC v3 2/3 mariadb: new package
In reply to Ryan Coe--- DEVELOPERS | 3 + package/Config.in | 1 + .../mariadb/0001-add-extra-check-for-librt.patch | 26 +++++ ...ld-failure-when-HAVE_STACKTRACE-is-not-de.patch | 33 ++++++ package/mariadb/Config.in | 32 ++++++ package/mariadb/S97mysqld | 77 ++++++++++++++ package/mariadb/mariadb.hash | 2 + package/mariadb/mariadb.mk | 113 +++++++++++++++++++++ package/mariadb/mysqld.service | 13 +++ package/oracle-mysql/Config.in | 1 + 10 files changed, 301 insertions(+) create mode 100644 package/mariadb/0001-add-extra-check-for-librt.patch create mode 100644 package/mariadb/0002-prevent-build-failure-when-HAVE_STACKTRACE-is-not-de.patch create mode 100644 package/mariadb/Config.in create mode 100644 package/mariadb/S97mysqld create mode 100644 package/mariadb/mariadb.hash create mode 100644 package/mariadb/mariadb.mk create mode 100644 package/mariadb/mysqld.service
DEVELOPERS +3 -0
@@ -1241,6 +1241,9 @@ F: package/python-pysnmp-apps/ F: package/python-pysnmp-mibs/ F: package/python-tornado/ +N: Ryan Coe <[email protected]> +F: package/mariadb/ + N: Ryan Wilkins <[email protected]> F: package/biosdevname/
package/Config.in +1 -0
@@ -909,6 +909,7 @@ menu "Database" source "package/kompexsqlite/Config.in" source "package/leveldb/Config.in" source "package/libpqxx/Config.in" + source "package/mariadb/Config.in" source "package/mongodb/Config.in" source "package/oracle-mysql/Config.in" source "package/postgresql/Config.in"
package/mariadb/0001-add-extra-check-for-librt.patch new file +26 -0
@@ -0,0 +1,26 @@ +From 31094bd1fcccba2fb8b234735bb9bf60ba4afa28 Mon Sep 17 00:00:00 2001 +From: Ryan Coe <[email protected]> +Date: Sun, 18 Sep 2016 16:35:59 -0700 +Subject: [PATCH 1/1] add extra check for librt + +Signed-off-by: Ryan Coe <[email protected]> +--- + 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
package/mariadb/0002-prevent-build-failure-when-HAVE_STACKTRACE-is-not-de.patch new file +33 -0
@@ -0,0 +1,33 @@ +From 3a0d3c159c581a5202de75064836fc3b22e5a71c Mon Sep 17 00:00:00 2001 +From: Ryan Coe <[email protected]> +Date: Sat, 24 Sep 2016 18:19:44 -0700 +Subject: [PATCH 2/2] prevent build failure when HAVE_STACKTRACE is not defined + +Signed-off-by: Ryan Coe <[email protected]> +--- + sql/signal_handler.cc | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/sql/signal_handler.cc b/sql/signal_handler.cc +index 9dd3e532d1e73bbb0bd0531c5ac8c7204df98f19..6379e6473de8356cce4764f075d817e24667839c 100644 +--- a/sql/signal_handler.cc ++++ b/sql/signal_handler.cc +@@ -276,6 +276,7 @@ extern "C" sig_handler handle_fatal_signal(int sig) + "\"mlockall\" bugs.\n"); + } + ++#ifdef HAVE_STACKTRACE + if (print_invalid_query_pointer) + { + my_safe_printf_stderr( +@@ -285,6 +286,7 @@ extern "C" sig_handler handle_fatal_signal(int sig) + my_write_stderr(thd->query(), MY_MIN(65536U, thd->query_length())); + my_safe_printf_stderr("\n\n"); + } ++#endif + + #ifdef HAVE_WRITE_CORE + if (test_flags & TEST_CORE_ON_SIGNAL) +-- +2.9.3 +
package/mariadb/Config.in new file +32 -0
@@ -0,0 +1,32 @@ +config BR2_PACKAGE_MARIADB + bool "mariadb" + depends on BR2_INSTALL_LIBSTDCPP + depends on BR2_USE_MMU # fork() + depends on BR2_TOOLCHAIN_HAS_THREADS + depends on BR2_PACKAGE_LIBAIO_ARCH_SUPPORTS + depends on !BR2_PACKAGE_ORACLE_MYSQL + select BR2_PACKAGE_LIBAIO + select BR2_PACKAGE_LIBXML2 + select BR2_PACKAGE_NCURSES + select BR2_PACKAGE_OPENSSL + select BR2_PACKAGE_READLINE + help + MariaDB is one of the most popular database servers in the world. + It's made by the original developers of MySQL and guaranteed to + stay open source. + + http://www.mariadb.org/ + +if BR2_PACKAGE_MARIADB + +config BR2_PACKAGE_MARIADB_SERVER + bool "mariadb server" + help + Install the mariadb server on the target. + +endif + +comment "mariadb needs a toolchain w/ C++, threads" + depends on BR2_USE_MMU + depends on BR2_PACKAGE_LIBAIO_ARCH_SUPPORTS + depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
package/mariadb/S97mysqld new file +77 -0
77 lines not on this page · raw message
package/mariadb/mariadb.hash new file +2 -0
@@ -0,0 +1,2 @@ +# Locally computed +sha256 4ca45ac5e34418761868115ebc8c068d511fed08e283b2cac52559d63ba4aab5 mariadb-10.1.17.tar.gz
package/mariadb/mariadb.mk new file +113 -0
113 lines not on this page · raw message
package/mariadb/mysqld.service new file +13 -0
@@ -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
package/oracle-mysql/Config.in +1 -0
@@ -3,6 +3,7 @@ config BR2_PACKAGE_ORACLE_MYSQL depends on BR2_INSTALL_LIBSTDCPP depends on BR2_USE_MMU # fork() depends on BR2_TOOLCHAIN_HAS_THREADS + depends on !BR2_PACKAGE_MARIADB select BR2_PACKAGE_NCURSES select BR2_PACKAGE_READLINE help
Signature · 1 line
2.9.3
RFC v3 3/3 mysql: convert to virtual package
In reply to Ryan Coe--- package/Config.in | 3 +- package/mariadb/Config.in | 32 -------------- package/mariadb/mariadb.mk | 1 + package/mysql/Config.in | 83 ++++++++++++++++++++++++++++++++++++ package/mysql/mysql.mk | 7 +++ package/oracle-mysql/Config.in | 25 ----------- package/oracle-mysql/oracle-mysql.mk | 1 + 7 files changed, 93 insertions(+), 59 deletions(-) delete mode 100644 package/mariadb/Config.in create mode 100644 package/mysql/Config.in create mode 100644 package/mysql/mysql.mk delete mode 100644 package/oracle-mysql/Config.in
package/Config.in +1 -2
@@ -909,9 +909,8 @@ menu "Database" source "package/kompexsqlite/Config.in" source "package/leveldb/Config.in" source "package/libpqxx/Config.in" - source "package/mariadb/Config.in" source "package/mongodb/Config.in" - source "package/oracle-mysql/Config.in" + source "package/mysql/Config.in" source "package/postgresql/Config.in" source "package/redis/Config.in" source "package/sqlcipher/Config.in"
package/mariadb/Config.in deleted +0 -32
@@ -1,32 +0,0 @@ -config BR2_PACKAGE_MARIADB - bool "mariadb" - depends on BR2_INSTALL_LIBSTDCPP - depends on BR2_USE_MMU # fork() - depends on BR2_TOOLCHAIN_HAS_THREADS - depends on BR2_PACKAGE_LIBAIO_ARCH_SUPPORTS - depends on !BR2_PACKAGE_ORACLE_MYSQL - select BR2_PACKAGE_LIBAIO - select BR2_PACKAGE_LIBXML2 - select BR2_PACKAGE_NCURSES - select BR2_PACKAGE_OPENSSL - select BR2_PACKAGE_READLINE - help - MariaDB is one of the most popular database servers in the world. - It's made by the original developers of MySQL and guaranteed to - stay open source. - - http://www.mariadb.org/ - -if BR2_PACKAGE_MARIADB - -config BR2_PACKAGE_MARIADB_SERVER - bool "mariadb server" - help - Install the mariadb server on the target. - -endif - -comment "mariadb needs a toolchain w/ C++, threads" - depends on BR2_USE_MMU - depends on BR2_PACKAGE_LIBAIO_ARCH_SUPPORTS - depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
package/mariadb/mariadb.mk +1 -0
@@ -10,6 +10,7 @@ MARIADB_SITE = https://downloads.mariadb.org/interstitial/mariadb-$(MARIADB_VERS MARIADB_LICENSE = GPLv2 (server), GPLv2 with FLOSS exception (GPL client library), LGPLv2 (LGPL client library) MARIADB_LICENSE_FILES = README COPYING COPYING.LESSER MARIADB_INSTALL_STAGING = YES +MARIADB_PROVIDES = mysql MARIADB_DEPENDENCIES = \ host-mariadb \
package/mysql/Config.in new file +83 -0
83 lines not on this page · raw message
package/mysql/mysql.mk new file +7 -0
@@ -0,0 +1,7 @@ +################################################################################ +# +# mysql +# +################################################################################ + +$(eval $(virtual-package))
package/oracle-mysql/Config.in deleted +0 -25
@@ -1,25 +0,0 @@ -config BR2_PACKAGE_ORACLE_MYSQL - bool "oracle mysql" - depends on BR2_INSTALL_LIBSTDCPP - depends on BR2_USE_MMU # fork() - depends on BR2_TOOLCHAIN_HAS_THREADS - depends on !BR2_PACKAGE_MARIADB - select BR2_PACKAGE_NCURSES - select BR2_PACKAGE_READLINE - help - The MySQL Open Source Database System - - http://www.mysql.com/ - -if BR2_PACKAGE_ORACLE_MYSQL - -config BR2_PACKAGE_ORACLE_MYSQL_SERVER - bool "oracle mysql server" - help - Install the MySQL server on the target. - -endif - -comment "oracle mysql needs a toolchain w/ C++, threads" - depends on BR2_USE_MMU - depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
package/oracle-mysql/oracle-mysql.mk +1 -0
@@ -13,6 +13,7 @@ ORACLE_MYSQL_DEPENDENCIES = readline ncurses ORACLE_MYSQL_AUTORECONF = YES ORACLE_MYSQL_LICENSE = GPLv2 ORACLE_MYSQL_LICENSE_FILES = README COPYING +ORACLE_MYSQL_PROVIDES = mysql # Unix socket. This variable can also be consulted by other buildroot packages MYSQL_SOCKET = /run/mysql/mysql.sock
Signature · 1 line
2.9.3
RFC v3 2/3 mariadb: new package
In reply to Ryan CoeHi Ryan,
Quoted 40 lines · Ryan Coe
package/mariadb/mariadb.mk new file +34
-0@@ -0,0 +1,113 @@ +################################################################################ +# +# mariadb +# +################################################################################ + +MARIADB_VERSION = 10.1.17 +MARIADB_SOURCE = mariadb-$(MARIADB_VERSION).tar.gz +MARIADB_SITE = https://downloads.mariadb.org/interstitial/mariadb-$(MARIADB_VERSION)/source +MARIADB_LICENSE = GPLv2 (server), GPLv2 with FLOSS exception (GPL client library), LGPLv2 (LGPL client library) +MARIADB_LICENSE_FILES = README COPYING COPYING.LESSER +MARIADB_INSTALL_STAGING = YES + +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
package/mariadb/mariadb.mk line 44
Quoted 10 lines
package/mariadb/mariadb.mk new file +10
-0+# 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 + +# Make it explicit that we are cross-compiling +MARIADB_CONF_OPTS += -DCMAKE_CROSSCOMPILING=1 +
The next time you re-spin your patch, could you add the following lines to it?
# Explicitly disable dtrace to avoid detection of a host version MARIADB_CONF_OPTS += -DENABLE_DTRACE=0
With this change, mariadb appears to build and run fine for me.
Also, fwiw, I didn't apply the other patches in the series since it didn't look like BR2_PACKAGE_HAS_MYSQL was propagated to all of the packages that depended on mysql. I just deleted the mysql package completely and changed all references to mariadb.
Thanks,
Frank
Quoted 107 lines
package/mariadb/mariadb.mk new file +69
-0+ifeq ($(BR2_PACKAGE_MARIADB_SERVER),y) +MARIADB_CONF_OPTS += -DWITH_EMBEDDED_SERVER=ON +else +MARIADB_CONF_OPTS += -DWITHOUT_SERVER=ON +endif + +MARIADB_CONF_OPTS += \ + -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) + +# 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 + +define MARIADB_POST_INSTALL + mkdir -p $(TARGET_DIR)/var/lib/mysql + $(INSTALL) -D -m 644 $(TARGET_DIR)/usr/share/mysql/my-small.cnf \ + $(TARGET_DIR)/etc/mysql/my.cnf + # We don't need this on the target as it's only useful in staging + $(RM) $(TARGET_DIR)/usr/bin/mysql_config + # Remove test suite + $(RM) -r $(TARGET_DIR)/usr/share/mysql/test +endef + +MARIADB_POST_INSTALL_TARGET_HOOKS += MARIADB_POST_INSTALL + +$(eval $(cmake-package)) +$(eval $(host-cmake-package))package/mariadb/mysqld.service new file +13
-0@@ -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.targetpackage/oracle-mysql/Config.in +1
-1@@ -3,6 +3,7 @@ config BR2_PACKAGE_ORACLE_MYSQL depends on BR2_INSTALL_LIBSTDCPP depends on BR2_USE_MMU # fork() depends on BR2_TOOLCHAIN_HAS_THREADS + depends on !BR2_PACKAGE_MARIADB select BR2_PACKAGE_NCURSES select BR2_PACKAGE_READLINE help --2.9.3
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 4 lines
Frank Hunleth Troodon Software LLC Embedded Software Development http://troodon-software.com/
RFC v3 2/3 mariadb: new package
Frank, All,
I've been away for awhile and I am finally getting ready to send a new version.
Quoted 60 lines · Frank Hunleth
Hi Ryan,
Quoted 40 lines · Ryan Coe
package/mariadb/mariadb.mk new file +34
-0@@ -0,0 +1,113 @@ +################################################################################ +# +# mariadb +# +################################################################################ + +MARIADB_VERSION = 10.1.17 +MARIADB_SOURCE = mariadb-$(MARIADB_VERSION).tar.gz +MARIADB_SITE = https://downloads.mariadb.org/interstitial/mariadb-$(MARIADB_VERSION)/source +MARIADB_LICENSE = GPLv2 (server), GPLv2 with FLOSS exception (GPL client library), LGPLv2 (LGPL client library) +MARIADB_LICENSE_FILES = README COPYING COPYING.LESSER +MARIADB_INSTALL_STAGING = YES + +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 uppackage/mariadb/mariadb.mk line 44
Quoted 10 lines
package/mariadb/mariadb.mk new file +10
-0+# 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 + +# Make it explicit that we are cross-compiling +MARIADB_CONF_OPTS += -DCMAKE_CROSSCOMPILING=1 +The next time you re-spin your patch, could you add the following lines to it?
# Explicitly disable dtrace to avoid detection of a host version
MARIADB_CONF_OPTS+= -DENABLE_DTRACE=0With this change, mariadb appears to build and run fine for me.
Quoted 7 lines
Also, fwiw, I didn't apply the other patches in the series since it didn't look like
BR2_PACKAGE_HAS_MYSQLwas propagated to all of the packages that depended on mysql. I just deleted the mysql package completely and changed all references to mariadb.Thanks,
Frank
I added the "-DENABLE_DTRACE" above. I am, however, confused about your comment about BR2_PACKAGE_HAS_MYSQL. I am probably missing something, but doesn't the dependency to still exist on all of the packages that depend on mysql? Either of the oracle-mysql or mariadb virtual packages provides mysql.
Quoted 103 lines
Quoted 103 lines
package/mariadb/mariadb.mk new file +69
-0+ifeq ($(BR2_PACKAGE_MARIADB_SERVER),y) +MARIADB_CONF_OPTS += -DWITH_EMBEDDED_SERVER=ON +else +MARIADB_CONF_OPTS += -DWITHOUT_SERVER=ON +endif + +MARIADB_CONF_OPTS += \ + -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) + +# 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 + +define MARIADB_POST_INSTALL + mkdir -p $(TARGET_DIR)/var/lib/mysql + $(INSTALL) -D -m 644 $(TARGET_DIR)/usr/share/mysql/my-small.cnf \ + $(TARGET_DIR)/etc/mysql/my.cnf + # We don't need this on the target as it's only useful in staging + $(RM) $(TARGET_DIR)/usr/bin/mysql_config + # Remove test suite + $(RM) -r $(TARGET_DIR)/usr/share/mysql/test +endef + +MARIADB_POST_INSTALL_TARGET_HOOKS += MARIADB_POST_INSTALL + +$(eval $(cmake-package)) +$(eval $(host-cmake-package))package/mariadb/mysqld.service new file +13
-0@@ -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.targetpackage/oracle-mysql/Config.in +1
-1@@ -3,6 +3,7 @@ config BR2_PACKAGE_ORACLE_MYSQL depends on BR2_INSTALL_LIBSTDCPP depends on BR2_USE_MMU # fork() depends on BR2_TOOLCHAIN_HAS_THREADS + depends on !BR2_PACKAGE_MARIADB select BR2_PACKAGE_NCURSES select BR2_PACKAGE_READLINE help --2.9.3
Quoted 6 lines
Quoted 4 lines
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Thanks,
Ryan