Skip to contentSkip to conversation

package/mariadb: bump version to 10.4.11

PATCH New Ryan Coe 2 participants 9 messages Dec 15, 2019 – Dec 17, 2019

lore
Share & tools
lore

Ryan Coe

author
#0 lore raw

PATCH v2 1/3 package/mariadb: bump version to 10.4.11

Release notes:
https://mariadb.com/kb/en/library/mariadb-10411-release-notes/

Changelog:
https://mariadb.com/kb/en/library/mariadb-10411-changelog/

Upgrading from 10.3 to 10.4:
https://mariadb.com/kb/en/library/upgrading-from-mariadb-103-to-mariadb-104/

The hash for README.md has been updated due to minor changes throughout the document. The text in licensing section is unchanged.

Patch 0002-fix-build-error-with-newer-cmake.patch has been removed as it has been applied upstream.

The startup scripts have been adjusted to prevent an error from occurring in mysql_install_db. Instead, the initial database is created as user root. Afterwards, chown is called to change the user and group to mysql.

---
Changes v1 -> v2:
- bump version to 10.4.11 instead of 10.4.10
- replace patch for mysql_install_db (suggested by Thomas)
- split other changes to startup scripts into separate patch (suggested by Thomas)

---
 ...002-fix-build-error-with-newer-cmake.patch | 44 -------------------
 package/mariadb/S97mysqld                     |  3 +-
 package/mariadb/mariadb.hash                  | 12 ++---
 package/mariadb/mariadb.mk                    |  5 ++-
 package/mariadb/mysqld.service                |  2 +-
 5 files changed, 13 insertions(+), 53 deletions(-)
 delete mode 100644 package/mariadb/0002-fix-build-error-with-newer-cmake.patch
package/mariadb/0002-fix-build-error-with-newer-cmake.patch deleted +0 -44
deleted file mode 100644
index 5ffac688a3..0000000000
@@ -1,44 +0,0 @@
-From c90ae2ca3dff267b9e21595376d22de397f6f78f Mon Sep 17 00:00:00 2001
-From: Ryan Coe <[email protected]>
-Date: Tue, 20 Aug 2019 06:22:43 -0700
-Subject: [PATCH] Fix build error with newer cmake
-
-Fixes the following build error:
-
-CMake Error at cmake/os/Linux.cmake:29 (STRING):
-STRING sub-command REPLACE requires at least four arguments.
-Call Stack (most recent call first):
-CMakeLists.txt:101 (INCLUDE)
-
-CMake Error at cmake/os/Linux.cmake:29 (STRING):
-STRING sub-command REPLACE requires at least four arguments.
-Call Stack (most recent call first):
-CMakeLists.txt:101 (INCLUDE)
-
-https://jira.mariadb.org/browse/MDEV-20596
-
-Signed-off-by: Ryan Coe <[email protected]>
----
- cmake/os/Linux.cmake | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/cmake/os/Linux.cmake b/cmake/os/Linux.cmake
-index 50a2b21c838d8d6ca4cacc0704a9be4da3a57a0a..b871586acc9cfaddc3836cc9afafd85969120420 100644
---- a/cmake/os/Linux.cmake
-+++ b/cmake/os/Linux.cmake
-@@ -26,9 +26,9 @@ SET(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -D_GNU_SOURCE=1)
- 
- # Fix CMake (< 2.8) flags. -rdynamic exports too many symbols.
- FOREACH(LANG C CXX)
--  STRING(REPLACE "-rdynamic" "" 
--  CMAKE_SHARED_LIBRARY_LINK_${LANG}_FLAGS
--  ${CMAKE_SHARED_LIBRARY_LINK_${LANG}_FLAGS}  
-+  STRING(REPLACE "-rdynamic" ""
-+  "CMAKE_SHARED_LIBRARY_LINK_${LANG}_FLAGS"
-+  "${CMAKE_SHARED_LIBRARY_LINK_${LANG}_FLAGS}"
-   )
- ENDFOREACH()
- 
--- 
-2.17.1
-
package/mariadb/S97mysqld +2 -1
index 62357fa8c4..270eea51dd 100644
@@ -23,12 +23,13 @@ wait_for_ready() {
 start() {
 	if [ `ls -1 $MYSQL_LIB | wc -l` = 0 ] ; then
 		printf "Creating mysql system tables ... "
-		$MYSQL_BIN/mysql_install_db --basedir=/usr --user=mysql \
+		$MYSQL_BIN/mysql_install_db --basedir=/usr \
 			--datadir=$MYSQL_LIB > /dev/null 2>&1
 		if [ $? != 0 ]; then
 			echo "FAIL"
 			exit 1
 		fi
+		chown -R mysql:mysql /var/lib/mysql
 		echo "OK"
 	fi
 
package/mariadb/mariadb.hash +6 -6
index a742d87daa..a8a9541ced 100644
@@ -1,9 +1,9 @@
-# From https://downloads.mariadb.org/mariadb/10.3.18
-md5 b3524c0825c3a1c255496daea38304a0  mariadb-10.3.18.tar.gz
-sha1 922a317edd6f44baacc49831ca278e7a9878a363  mariadb-10.3.18.tar.gz
-sha256 69456ca85bf9d96c6d28b4ade2a9f6787d79a602e27ef941f9ba4e0b55dddedc  mariadb-10.3.18.tar.gz
-sha512 817253d18f20c74f9ec8030678fd50a28b1726fd59153023a3a5e9b3f79e1f44d79feb24ae9ed72d8c1c04017110c932aba7be0610fb06245590c7f5610db242  mariadb-10.3.18.tar.gz
+# From https://downloads.mariadb.org/mariadb/10.4.11
+md5 d0de881ab8ead46928cafb7d558535c1  mariadb-10.4.11.tar.gz
+sha1 e633ea0bff6dcd22722bda4cdc66fdfdd1afc4a5  mariadb-10.4.11.tar.gz
+sha256 4c076232b99433b09eb3c6d62f607192b3474d022703699b8f6aef4e79de3fb9  mariadb-10.4.11.tar.gz
+sha512 2a1a8d90e326530b41a8a7d6889325cefcba5914451a48c6a20d5d5cd68004835e76e6ecac628554167a014f9c0b1487c15f37151afd771ea0166a4c40afd7d2  mariadb-10.4.11.tar.gz
 
 # Hash for license files
-sha256 a4665c1189fe31e0bbc27e9b55439df7dad6e99805407fe58d78da7aabe678f8  README.md
+sha256 fbcc1db54ebdc4af733aeaea9a00ec140f5f5fc43683f3966645450734c05747  README.md
 sha256 240a15a1d0f34d3abca462cdb7e5fb89470967563f16b0e71169e51c1e74cf2b  COPYING
package/mariadb/mariadb.mk +4 -1
index 82e3c16daf..6ad4a8e6a7 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-MARIADB_VERSION = 10.3.18
+MARIADB_VERSION = 10.4.11
 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
@@ -57,6 +57,9 @@ MARIADB_CONF_OPTS += -DCMAKE_CROSSCOMPILING=1
 # Explicitly disable dtrace to avoid detection of a host version
 MARIADB_CONF_OPTS += -DENABLE_DTRACE=0
 
+# Disable support for REST and JDBC
+MARIADB_CONF_OPTS += -DCONNECT_WITH_REST=OFF -DCONNECT_WITH_JDBC=OFF
+
 ifeq ($(BR2_PACKAGE_MARIADB_SERVER),y)
 ifeq ($(BR2_PACKAGE_MARIADB_SERVER_EMBEDDED),y)
 MARIADB_CONF_OPTS += -DWITH_EMBEDDED_SERVER=ON
package/mariadb/mysqld.service +1 -1
index cd308310c6..3eaef173e1 100644
@@ -2,7 +2,7 @@
 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'
+ExecStartPre=/bin/sh -c 'test "`ls -1 /var/lib/mysql | wc -l`" != "0" || mysql_install_db --basedir=/usr --datadir=/var/lib/mysql && chown -R mysql:mysql /var/lib/mysql'
 ExecStart=/usr/bin/mysqld_safe
 Restart=always
 User=mysql
Signature · 1 line
2.24.1
author
#1 lore raw

PATCH v2 2/3 package/mariadb: update startup scripts

The init scripts have been modified to create a directory under /var/log/mysql and specify mysqld to use it for logging. The directory test to call mysql_install_db has been redirected to /dev/null to prevent an error message from showing if /var/lib/mysql does not exist.

---
 package/mariadb/S97mysqld      | 19 +++++++++++++------
 package/mariadb/mysqld.service |  3 ++-
 2 files changed, 15 insertions(+), 7 deletions(-)
package/mariadb/S97mysqld +13 -6
index 270eea51dd..9cb8ce0d1c 100644
@@ -5,7 +5,9 @@
 
 MYSQL_LIB="/var/lib/mysql"
 MYSQL_RUN="/run/mysql"
-MYSQL_PID="$MYSQL_RUN/mysqld.pid"
+MYSQL_PIDFILE="$MYSQL_RUN/mysqld.pid"
+MYSQL_LOG="/var/log/mysql"
+MYSQL_LOGFILE="$MYSQL_LOG/mysqld.log"
 MYSQL_BIN="/usr/bin"
 
 wait_for_ready() {
@@ -21,7 +23,9 @@ wait_for_ready() {
 }
 
 start() {
-	if [ `ls -1 $MYSQL_LIB | wc -l` = 0 ] ; then
+	# stderr is redirected to prevent a warning
+	# if mysql lib directory doesn't exist
+	if [ `ls -1 $MYSQL_LIB 2> /dev/null | wc -l` = 0 ] ; then
 		printf "Creating mysql system tables ... "
 		$MYSQL_BIN/mysql_install_db --basedir=/usr \
 			--datadir=$MYSQL_LIB > /dev/null 2>&1
@@ -37,19 +41,22 @@ start() {
 	# so create a subdirectory for mysql.
 	install -d -o mysql -g root -m 0755 $MYSQL_RUN
 
+	# Also create logging directory as user mysql.
+	install -d -o mysql -g root -m 0755 $MYSQL_LOG
+
 	# 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 &
+	$MYSQL_BIN/mysqld_safe --pid-file=$MYSQL_PIDFILE --user=mysql \
+		--log-error=$MYSQL_LOGFILE > /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
+	if [ -f $MYSQL_PIDFILE ]; then
+		kill `cat $MYSQL_PIDFILE` > /dev/null 2>&1
 		[ $? = 0 ] && echo "OK" || echo "FAIL"
 	else
 		echo "FAIL"
package/mariadb/mysqld.service +2 -1
index 3eaef173e1..0166a32dff 100644
@@ -3,7 +3,8 @@ 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 && chown -R mysql:mysql /var/lib/mysql'
-ExecStart=/usr/bin/mysqld_safe
+ExecStartPre=install -d -o mysql -g root -m 0755 /var/log/mysql
+ExecStart=/usr/bin/mysqld_safe --pid-file=/var/run/mysql/mysqld.pid --log-error=/var/log/mysql/mysqld.log
 Restart=always
 User=mysql
 RuntimeDirectory=mysql
Signature · 1 line
2.24.1
#2 lore raw

PATCH v2 2/3 package/mariadb: update startup scripts

Hello,

Quoted 6 lines · On Sun, 15 Dec 2019 13:33:25 -0800 Ryan Coe <[email protected]> wrote:

The init scripts have been modified to create a directory under /var/log/mysql and specify mysqld to use it for logging. The directory test to call mysql_install_db has been redirected to /dev/null to prevent an error message from showing if /var/lib/mysql does not exist.

A commit title that says "update startup scripts" is a good hint that the splitting of changes is not good. It hints that you're doing several things at once in the same commit, which are unrelated to each other.

There are (at least?) three independent changes here:

- Redirection of stderr when listing $MYSQL_LIB

- Rename of the MYSQL_PID variable

- Move the logs to /var/log/mysql

Three independent changes should lead to three independent commits.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
author
#3 lore raw

PATCH v2 2/3 package/mariadb: update startup scripts

Thomas,

Quoted 18 lines · Thomas Petazzoni

Hello,

Quoted 6 lines · On Sun, 15 Dec 2019 13:33:25 -0800 Ryan Coe <[email protected]> wrote:

The init scripts have been modified to create a directory under /var/log/mysql and specify mysqld to use it for logging. The directory test to call mysql_install_db has been redirected to /dev/null to prevent an error message from showing if /var/lib/mysql does not exist.

A commit title that says "update startup scripts" is a good hint that the splitting of changes is not good. It hints that you're doing several things at once in the same commit, which are unrelated to each other.

There are (at least?) three independent changes here:

Quoted 7 lines

- Redirection of stderr when listing $MYSQL_LIB

- Rename of the MYSQL_PID variable

- Move the logs to /var/log/mysql

Three independent changes should lead to three independent commits.

I will re-submit.

Quoted 4 lines

Thanks!

Thomas

author
#4 lore raw

PATCH v2 3/3 package/mariadb: prefix sysroot in mariadb_config

In reply to Ryan Coe

This patch adds @CMAKE_SYSROOT@ to mariadb_config.c.in. Without it, mariadb_config incorrectly returns host paths for include paths and library paths.

This also removes mariadb_config from the target like is done for mysql_config.

---
 ...2-add-sysroot-path-to-mariadb_config.patch | 28 +++++++++++++++++++
 package/mariadb/mariadb.mk                    |  5 ++--
 2 files changed, 31 insertions(+), 2 deletions(-)
 create mode 100644 package/mariadb/0002-add-sysroot-path-to-mariadb_config.patch
package/mariadb/0002-add-sysroot-path-to-mariadb_config.patch new file +28 -0
new file mode 100644
index 0000000000..5eca8ec402
@@ -0,0 +1,28 @@
+From 7e1b6aafeb9fe6558da7506b304c0efb5ea82281 Mon Sep 17 00:00:00 2001
+From: Ryan Coe <[email protected]>
+Date: Fri, 13 Dec 2019 17:13:26 -0800
+Subject: [PATCH 1/1] add sysroot path to mariadb_config
+
+Signed-off-by: Ryan Coe <[email protected]>
+---
+ libmariadb/mariadb_config/mariadb_config.c.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libmariadb/mariadb_config/mariadb_config.c.in b/libmariadb/mariadb_config/mariadb_config.c.in
+index 703c9466a1d9214a85f3638d2e3b4ecfef0c7bd6..f5513333e670373f060a3c2574d1d42facfd0337 100644
+--- a/libmariadb/mariadb_config/mariadb_config.c.in
++++ b/libmariadb/mariadb_config/mariadb_config.c.in
+@@ -5,8 +5,8 @@
+ 
+ static char *mariadb_progname;
+ 
+-#define INCLUDE "-I at CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@ -I at CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@/mysql"
+-#define LIBS    "-L at CMAKE_INSTALL_PREFIX@/@INSTALL_LIBDIR@/ -lmariadb"
++#define INCLUDE "-I at CMAKE_SYSROOT@/@CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@ -I at CMAKE_SYSROOT@/@CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@/mysql"
++#define LIBS    "-L at CMAKE_SYSROOT@/@CMAKE_INSTALL_PREFIX@/@INSTALL_LIBDIR@/ -lmariadb"
+ #define LIBS_SYS "@extra_dynamic_LDFLAGS@"
+ #define CFLAGS  INCLUDE
+ #define VERSION "@MARIADB_CLIENT_VERSION@"
+-- 
+2.24.1
+
package/mariadb/mariadb.mk +3 -2
index 6ad4a8e6a7..6f8f59f282 100644
@@ -129,11 +129,12 @@ define MARIADB_INSTALL_INIT_SYSTEMD
 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
+# We don't need mysql_config or mariadb_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) $(TARGET_DIR)/usr/bin/mariadb_config
 	$(RM) -r $(TARGET_DIR)/usr/share/mysql/test
 endef
 
Signature · 1 line
2.24.1
author
#5 lore raw

PATCH v2 3/3 package/mariadb: prefix sysroot in mariadb_config

Thomas,

I have a couple of questions for you below.

Quoted 37 lines · Ryan Coe

This patch adds @CMAKE_SYSROOT@ to mariadb_config.c.in. Without it, mariadb_config incorrectly returns host paths for include paths and library paths.

This also removes mariadb_config from the target like is done for mysql_config.

---
  ...2-add-sysroot-path-to-mariadb_config.patch | 28 +++++++++++++++++++
  package/mariadb/mariadb.mk                    |  5 ++--
  2 files changed, 31 insertions(+), 2 deletions(-)

create mode 100644 package/mariadb/0002-add-sysroot-path-to-mariadb_config.patch

package/mariadb/0002-add-sysroot-path-to-mariadb_config.patch new file +16 -0
new file mode 100644
index 0000000000..5eca8ec402
@@ -0,0 +1,28 @@
+From 7e1b6aafeb9fe6558da7506b304c0efb5ea82281 Mon Sep 17 00:00:00 2001
+From: Ryan Coe <[email protected]>
+Date: Fri, 13 Dec 2019 17:13:26 -0800
+Subject: [PATCH 1/1] add sysroot path to mariadb_config
+
+Signed-off-by: Ryan Coe <[email protected]>
+---
+ libmariadb/mariadb_config/mariadb_config.c.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libmariadb/mariadb_config/mariadb_config.c.in b/libmariadb/mariadb_config/mariadb_config.c.in
+index 703c9466a1d9214a85f3638d2e3b4ecfef0c7bd6..f5513333e670373f060a3c2574d1d42facfd0337 100644
+--- a/libmariadb/mariadb_config/mariadb_config.c.in
++++ b/libmariadb/mariadb_config/mariadb_config.c.in
+@@ -5,8 +5,8 @@
+

package/mariadb/0002-add-sysroot-path-to-mariadb_config.patch line 26

Quoted 10 lines
package/mariadb/0002-add-sysroot-path-to-mariadb_config.patch new file +10 -0
+ static char *mariadb_progname;
+
+-#define INCLUDE "-I at CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@ -I at CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@/mysql"
+-#define LIBS    "-L at CMAKE_INSTALL_PREFIX@/@INSTALL_LIBDIR@/ -lmariadb"
++#define INCLUDE "-I at CMAKE_SYSROOT@/@CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@ -I at CMAKE_SYSROOT@/@CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@/mysql"
++#define LIBS    "-L at CMAKE_SYSROOT@/@CMAKE_INSTALL_PREFIX@/@INSTALL_LIBDIR@/ -lmariadb"
+ #define LIBS_SYS "@extra_dynamic_LDFLAGS@"
+ #define CFLAGS  INCLUDE
+ #define VERSION "@MARIADB_CLIENT_VERSION@"
+--

Since this is a bug fix, should this patch occur before the version bump?

Quoted 8 lines
package/mariadb/0002-add-sysroot-path-to-mariadb_config.patch new file +2 -0
+2.24.1
+
package/mariadb/mariadb.mk +0 -0
index 6ad4a8e6a7..6f8f59f282 100644
@@ -129,11 +129,12 @@ define MARIADB_INSTALL_INIT_SYSTEMD
  endef

package/mariadb/mariadb.mk define MARIADB_INSTALL_INIT_SYSTEMD · line 137

Quoted 10 lines
package/mariadb/mariadb.mk +3 -2
  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
+# We don't need mysql_config or mariadb_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) $(TARGET_DIR)/usr/bin/mariadb_config

Should this change be a separate change?

package/mariadb/mariadb.mk define MARIADB_INSTALL_INIT_SYSTEMD · line 140

Quoted 3 lines
package/mariadb/mariadb.mk +0 -0
  	$(RM) -r $(TARGET_DIR)/usr/share/mysql/test
  endef
 

Thanks,

Ryan

#6 lore raw

PATCH v2 3/3 package/mariadb: prefix sysroot in mariadb_config

Hello Ryan,

Quoted 25 lines · On Mon, 16 Dec 2019 16:38:36 -0800 Ryan Coe <[email protected]> wrote:
Quoted 25 lines
package/mariadb/0002-add-sysroot-path-to-mariadb_config.patch new file +19 -0
new file mode 100644
index 0000000000..5eca8ec402
@@ -0,0 +1,28 @@
+From 7e1b6aafeb9fe6558da7506b304c0efb5ea82281 Mon Sep 17 00:00:00 2001
+From: Ryan Coe <[email protected]>
+Date: Fri, 13 Dec 2019 17:13:26 -0800
+Subject: [PATCH 1/1] add sysroot path to mariadb_config
+
+Signed-off-by: Ryan Coe <[email protected]>
+---
+ libmariadb/mariadb_config/mariadb_config.c.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libmariadb/mariadb_config/mariadb_config.c.in b/libmariadb/mariadb_config/mariadb_config.c.in
+index 703c9466a1d9214a85f3638d2e3b4ecfef0c7bd6..f5513333e670373f060a3c2574d1d42facfd0337 100644
+--- a/libmariadb/mariadb_config/mariadb_config.c.in
++++ b/libmariadb/mariadb_config/mariadb_config.c.in
+@@ -5,8 +5,8 @@
+
+ static char *mariadb_progname;
+
+-#define INCLUDE "-I at CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@ -I at CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@/mysql"
Quoted 8 lines

package/mariadb/0002-add-sysroot-path-to-mariadb_config.patch line 26

Quoted 7 lines
package/mariadb/0002-add-sysroot-path-to-mariadb_config.patch new file +7 -0
+-#define LIBS    "-L at CMAKE_INSTALL_PREFIX@/@INSTALL_LIBDIR@/ -lmariadb"
++#define INCLUDE "-I at CMAKE_SYSROOT@/@CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@ -I at CMAKE_SYSROOT@/@CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@/mysql"
++#define LIBS    "-L at CMAKE_SYSROOT@/@CMAKE_INSTALL_PREFIX@/@INSTALL_LIBDIR@/ -lmariadb"
+ #define LIBS_SYS "@extra_dynamic_LDFLAGS@"
+ #define CFLAGS  INCLUDE
+ #define VERSION "@MARIADB_CLIENT_VERSION@"
+--  

Since this is a bug fix, should this patch occur before the version bump?

If it is a bug that affects the current version of mariadb in use by Buildroot, then yes it should be a separate patch, and a patch that occurs before the version bump.

Quoted 9 lines

package/mariadb/0002-add-sysroot-path-to-mariadb_config.patch

Quoted 8 lines
package/mariadb/0002-add-sysroot-path-to-mariadb_config.patch new file +3 -2
-# 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
+# We don't need mysql_config or mariadb_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) $(TARGET_DIR)/usr/bin/mariadb_config  

Should this change be a separate change?

I'd say yes.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#7 lore raw

PATCH v2 1/3 package/mariadb: bump version to 10.4.11

In reply to Ryan Coe

Hello Ryan,

Thanks for the update. A few questions below.

Quoted 6 lines · On Sun, 15 Dec 2019 13:33:24 -0800 Ryan Coe <[email protected]> wrote:
package/mariadb/S97mysqld +0 -0
index 62357fa8c4..270eea51dd 100644
@@ -23,12 +23,13 @@ wait_for_ready() {
 start() {

package/mariadb/S97mysqld wait_for_ready() { · line 32

Quoted 10 lines
package/mariadb/S97mysqld +2 -1
 	if [ `ls -1 $MYSQL_LIB | wc -l` = 0 ] ; then
 		printf "Creating mysql system tables ... "
-		$MYSQL_BIN/mysql_install_db --basedir=/usr --user=mysql \
+		$MYSQL_BIN/mysql_install_db --basedir=/usr \
 			--datadir=$MYSQL_LIB > /dev/null 2>&1
 		if [ $? != 0 ]; then
 			echo "FAIL"
 			exit 1
 		fi
+		chown -R mysql:mysql /var/lib/mysql

Is this change related to the version bump ?

package/mariadb/mysqld.service line 5

Quoted 10 lines
package/mariadb/mysqld.service +1 -1
index cd308310c6..3eaef173e1 100644
@@ -2,7 +2,7 @@
 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'
+ExecStartPre=/bin/sh -c 'test "`ls -1 /var/lib/mysql | wc -l`" != "0" || mysql_install_db --basedir=/usr --datadir=/var/lib/mysql && chown -R mysql:mysql /var/lib/mysql'

So before this, the database files were owned by root? How could have the mysqld daemon, which runs as the mysql user, use them? Isn't this change a bug fix, that is completely independent of the version bump, and should come before the version bump, and even be backported to stable versions of Buildroot ?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
author
#8 lore raw

PATCH v2 1/3 package/mariadb: bump version to 10.4.11

Thomas,

Quoted 16 lines · Thomas Petazzoni

Hello Ryan,

Thanks for the update. A few questions below.

Quoted 9 lines · On Sun, 15 Dec 2019 13:33:24 -0800 Ryan Coe <[email protected]> wrote:
package/mariadb/S97mysqld +0 -1
index 62357fa8c4..270eea51dd 100644
@@ -23,12 +23,13 @@ wait_for_ready() {
  start() {
  	if [ `ls -1 $MYSQL_LIB | wc -l` = 0 ] ; then
  		printf "Creating mysql system tables ... "
-		$MYSQL_BIN/mysql_install_db --basedir=/usr --user=mysql \
Quoted 9 lines

package/mariadb/S97mysqld wait_for_ready() { · line 32

Quoted 7 lines
package/mariadb/S97mysqld +2 -0
+		$MYSQL_BIN/mysql_install_db --basedir=/usr \
  			--datadir=$MYSQL_LIB > /dev/null 2>&1
  		if [ $? != 0 ]; then
  			echo "FAIL"
  			exit 1
  		fi
+		chown -R mysql:mysql /var/lib/mysql

Is this change related to the version bump ?

This is the work-around for the problem with the mysql_install_db script.? If we don't pass --user=mysql, the code that causes the problem does not execute.? Then, we change the user and group to mysql like what should have happened in the mysql_install_db script.

Quoted 7 lines
Quoted 7 lines
package/mariadb/mysqld.service +0 -0
index cd308310c6..3eaef173e1 100644
@@ -2,7 +2,7 @@
  Description=MySQL database server
 
Quoted 8 lines

package/mariadb/mysqld.service line 5

Quoted 3 lines
package/mariadb/mysqld.service +1 -1
  [Service]
-ExecStartPre=/bin/sh -c 'test "`ls -1 /var/lib/mysql | wc -l`" != "0" || mysql_install_db --basedir=/usr --datadir=/var/lib/mysql'
+ExecStartPre=/bin/sh -c 'test "`ls -1 /var/lib/mysql | wc -l`" != "0" || mysql_install_db --basedir=/usr --datadir=/var/lib/mysql && chown -R mysql:mysql /var/lib/mysql'

So before this, the database files were owned by root? How could have the mysqld daemon, which runs as the mysql user, use them? Isn't this change a bug fix, that is completely independent of the version bump, and should come before the version bump, and even be backported to stable versions of Buildroot ?

Yes, this would be a bug fix for the exact reasons you mentioned.? I will split this change out.

Quoted 4 lines

Thanks,

Thomas