All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/3] package/mariadb: bump version to 10.4.11
@ 2019-12-15 21:33 Ryan Coe
  2019-12-15 21:33 ` [Buildroot] [PATCH v2 2/3] package/mariadb: update startup scripts Ryan Coe
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Ryan Coe @ 2019-12-15 21:33 UTC (permalink / raw)
  To: buildroot

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.

Signed-off-by: Ryan Coe <bluemrp9@gmail.com>
---
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

diff --git a/package/mariadb/0002-fix-build-error-with-newer-cmake.patch b/package/mariadb/0002-fix-build-error-with-newer-cmake.patch
deleted file mode 100644
index 5ffac688a3..0000000000
--- a/package/mariadb/0002-fix-build-error-with-newer-cmake.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From c90ae2ca3dff267b9e21595376d22de397f6f78f Mon Sep 17 00:00:00 2001
-From: Ryan Coe <bluemrp9@gmail.com>
-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 <bluemrp9@gmail.com>
----
- 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
-
diff --git a/package/mariadb/S97mysqld b/package/mariadb/S97mysqld
index 62357fa8c4..270eea51dd 100644
--- a/package/mariadb/S97mysqld
+++ b/package/mariadb/S97mysqld
@@ -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
 
diff --git a/package/mariadb/mariadb.hash b/package/mariadb/mariadb.hash
index a742d87daa..a8a9541ced 100644
--- a/package/mariadb/mariadb.hash
+++ b/package/mariadb/mariadb.hash
@@ -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
diff --git a/package/mariadb/mariadb.mk b/package/mariadb/mariadb.mk
index 82e3c16daf..6ad4a8e6a7 100644
--- a/package/mariadb/mariadb.mk
+++ b/package/mariadb/mariadb.mk
@@ -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
diff --git a/package/mariadb/mysqld.service b/package/mariadb/mysqld.service
index cd308310c6..3eaef173e1 100644
--- a/package/mariadb/mysqld.service
+++ b/package/mariadb/mysqld.service
@@ -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
-- 
2.24.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH v2 2/3] package/mariadb: update startup scripts
  2019-12-15 21:33 [Buildroot] [PATCH v2 1/3] package/mariadb: bump version to 10.4.11 Ryan Coe
@ 2019-12-15 21:33 ` Ryan Coe
  2019-12-16  8:35   ` Thomas Petazzoni
  2019-12-15 21:33 ` [Buildroot] [PATCH v2 3/3] package/mariadb: prefix sysroot in mariadb_config Ryan Coe
  2019-12-16  8:33 ` [Buildroot] [PATCH v2 1/3] package/mariadb: bump version to 10.4.11 Thomas Petazzoni
  2 siblings, 1 reply; 9+ messages in thread
From: Ryan Coe @ 2019-12-15 21:33 UTC (permalink / raw)
  To: buildroot

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.

Signed-off-by: Ryan Coe <bluemrp9@gmail.com>
---
 package/mariadb/S97mysqld      | 19 +++++++++++++------
 package/mariadb/mysqld.service |  3 ++-
 2 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/package/mariadb/S97mysqld b/package/mariadb/S97mysqld
index 270eea51dd..9cb8ce0d1c 100644
--- a/package/mariadb/S97mysqld
+++ b/package/mariadb/S97mysqld
@@ -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"
diff --git a/package/mariadb/mysqld.service b/package/mariadb/mysqld.service
index 3eaef173e1..0166a32dff 100644
--- a/package/mariadb/mysqld.service
+++ b/package/mariadb/mysqld.service
@@ -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
-- 
2.24.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH v2 3/3] package/mariadb: prefix sysroot in mariadb_config
  2019-12-15 21:33 [Buildroot] [PATCH v2 1/3] package/mariadb: bump version to 10.4.11 Ryan Coe
  2019-12-15 21:33 ` [Buildroot] [PATCH v2 2/3] package/mariadb: update startup scripts Ryan Coe
@ 2019-12-15 21:33 ` Ryan Coe
  2019-12-17  0:38   ` Ryan Coe
  2019-12-16  8:33 ` [Buildroot] [PATCH v2 1/3] package/mariadb: bump version to 10.4.11 Thomas Petazzoni
  2 siblings, 1 reply; 9+ messages in thread
From: Ryan Coe @ 2019-12-15 21:33 UTC (permalink / raw)
  To: buildroot

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.

Reported-by: Alexey Lukyanchuk <skif@skif-web.ru>
Signed-off-by: Ryan Coe <bluemrp9@gmail.com>
---
 ...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

diff --git a/package/mariadb/0002-add-sysroot-path-to-mariadb_config.patch b/package/mariadb/0002-add-sysroot-path-to-mariadb_config.patch
new file mode 100644
index 0000000000..5eca8ec402
--- /dev/null
+++ b/package/mariadb/0002-add-sysroot-path-to-mariadb_config.patch
@@ -0,0 +1,28 @@
+From 7e1b6aafeb9fe6558da7506b304c0efb5ea82281 Mon Sep 17 00:00:00 2001
+From: Ryan Coe <bluemrp9@gmail.com>
+Date: Fri, 13 Dec 2019 17:13:26 -0800
+Subject: [PATCH 1/1] add sysroot path to mariadb_config
+
+Signed-off-by: Ryan Coe <bluemrp9@gmail.com>
+---
+ 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
+
diff --git a/package/mariadb/mariadb.mk b/package/mariadb/mariadb.mk
index 6ad4a8e6a7..6f8f59f282 100644
--- a/package/mariadb/mariadb.mk
+++ b/package/mariadb/mariadb.mk
@@ -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
 
-- 
2.24.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH v2 1/3] package/mariadb: bump version to 10.4.11
  2019-12-15 21:33 [Buildroot] [PATCH v2 1/3] package/mariadb: bump version to 10.4.11 Ryan Coe
  2019-12-15 21:33 ` [Buildroot] [PATCH v2 2/3] package/mariadb: update startup scripts Ryan Coe
  2019-12-15 21:33 ` [Buildroot] [PATCH v2 3/3] package/mariadb: prefix sysroot in mariadb_config Ryan Coe
@ 2019-12-16  8:33 ` Thomas Petazzoni
  2019-12-17  0:12   ` Ryan Coe
  2 siblings, 1 reply; 9+ messages in thread
From: Thomas Petazzoni @ 2019-12-16  8:33 UTC (permalink / raw)
  To: buildroot

Hello Ryan,

Thanks for the update. A few questions below.

On Sun, 15 Dec 2019 13:33:24 -0800
Ryan Coe <bluemrp9@gmail.com> wrote:

> diff --git a/package/mariadb/S97mysqld b/package/mariadb/S97mysqld
> index 62357fa8c4..270eea51dd 100644
> --- a/package/mariadb/S97mysqld
> +++ b/package/mariadb/S97mysqld
> @@ -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

Is this change related to the version bump ?

> diff --git a/package/mariadb/mysqld.service b/package/mariadb/mysqld.service
> index cd308310c6..3eaef173e1 100644
> --- a/package/mariadb/mysqld.service
> +++ b/package/mariadb/mysqld.service
> @@ -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
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH v2 2/3] package/mariadb: update startup scripts
  2019-12-15 21:33 ` [Buildroot] [PATCH v2 2/3] package/mariadb: update startup scripts Ryan Coe
@ 2019-12-16  8:35   ` Thomas Petazzoni
  2019-12-17  0:03     ` Ryan Coe
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas Petazzoni @ 2019-12-16  8:35 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 15 Dec 2019 13:33:25 -0800
Ryan Coe <bluemrp9@gmail.com> 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.
> 
> Signed-off-by: Ryan Coe <bluemrp9@gmail.com>

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
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH v2 2/3] package/mariadb: update startup scripts
  2019-12-16  8:35   ` Thomas Petazzoni
@ 2019-12-17  0:03     ` Ryan Coe
  0 siblings, 0 replies; 9+ messages in thread
From: Ryan Coe @ 2019-12-17  0:03 UTC (permalink / raw)
  To: buildroot

Thomas,

On 12/16/19 12:35 AM, Thomas Petazzoni wrote:
> Hello,
>
> On Sun, 15 Dec 2019 13:33:25 -0800
> Ryan Coe <bluemrp9@gmail.com> 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.
>>
>> Signed-off-by: Ryan Coe <bluemrp9@gmail.com>
> 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.
I will re-submit.
>
> Thanks!
>
> Thomas

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH v2 1/3] package/mariadb: bump version to 10.4.11
  2019-12-16  8:33 ` [Buildroot] [PATCH v2 1/3] package/mariadb: bump version to 10.4.11 Thomas Petazzoni
@ 2019-12-17  0:12   ` Ryan Coe
  0 siblings, 0 replies; 9+ messages in thread
From: Ryan Coe @ 2019-12-17  0:12 UTC (permalink / raw)
  To: buildroot

Thomas,

On 12/16/19 12:33 AM, Thomas Petazzoni wrote:
> Hello Ryan,
>
> Thanks for the update. A few questions below.
>
> On Sun, 15 Dec 2019 13:33:24 -0800
> Ryan Coe <bluemrp9@gmail.com> wrote:
>
>> diff --git a/package/mariadb/S97mysqld b/package/mariadb/S97mysqld
>> index 62357fa8c4..270eea51dd 100644
>> --- a/package/mariadb/S97mysqld
>> +++ b/package/mariadb/S97mysqld
>> @@ -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
> 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.

>> diff --git a/package/mariadb/mysqld.service b/package/mariadb/mysqld.service
>> index cd308310c6..3eaef173e1 100644
>> --- a/package/mariadb/mysqld.service
>> +++ b/package/mariadb/mysqld.service
>> @@ -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 ?
Yes, this would be a bug fix for the exact reasons you mentioned.? I 
will split this change out.
>
> Thanks,
>
> Thomas

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH v2 3/3] package/mariadb: prefix sysroot in mariadb_config
  2019-12-15 21:33 ` [Buildroot] [PATCH v2 3/3] package/mariadb: prefix sysroot in mariadb_config Ryan Coe
@ 2019-12-17  0:38   ` Ryan Coe
  2019-12-17  7:58     ` Thomas Petazzoni
  0 siblings, 1 reply; 9+ messages in thread
From: Ryan Coe @ 2019-12-17  0:38 UTC (permalink / raw)
  To: buildroot

Thomas,

I have a couple of questions for you below.

On 12/15/19 1:33 PM, Ryan Coe wrote:
> 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.
>
> Reported-by: Alexey Lukyanchuk <skif@skif-web.ru>
> Signed-off-by: Ryan Coe <bluemrp9@gmail.com>
> ---
>   ...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
>
> diff --git a/package/mariadb/0002-add-sysroot-path-to-mariadb_config.patch b/package/mariadb/0002-add-sysroot-path-to-mariadb_config.patch
> new file mode 100644
> index 0000000000..5eca8ec402
> --- /dev/null
> +++ b/package/mariadb/0002-add-sysroot-path-to-mariadb_config.patch
> @@ -0,0 +1,28 @@
> +From 7e1b6aafeb9fe6558da7506b304c0efb5ea82281 Mon Sep 17 00:00:00 2001
> +From: Ryan Coe <bluemrp9@gmail.com>
> +Date: Fri, 13 Dec 2019 17:13:26 -0800
> +Subject: [PATCH 1/1] add sysroot path to mariadb_config
> +
> +Signed-off-by: Ryan Coe <bluemrp9@gmail.com>
> +---
> + 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@"
> +--
Since this is a bug fix, should this patch occur before the version bump?
> +2.24.1
> +
> diff --git a/package/mariadb/mariadb.mk b/package/mariadb/mariadb.mk
> index 6ad4a8e6a7..6f8f59f282 100644
> --- a/package/mariadb/mariadb.mk
> +++ b/package/mariadb/mariadb.mk
> @@ -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
Should this change be a separate change?
>   	$(RM) -r $(TARGET_DIR)/usr/share/mysql/test
>   endef
>   

Thanks,

Ryan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH v2 3/3] package/mariadb: prefix sysroot in mariadb_config
  2019-12-17  0:38   ` Ryan Coe
@ 2019-12-17  7:58     ` Thomas Petazzoni
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2019-12-17  7:58 UTC (permalink / raw)
  To: buildroot

Hello Ryan,

On Mon, 16 Dec 2019 16:38:36 -0800
Ryan Coe <bluemrp9@gmail.com> wrote:

> > diff --git a/package/mariadb/0002-add-sysroot-path-to-mariadb_config.patch b/package/mariadb/0002-add-sysroot-path-to-mariadb_config.patch
> > new file mode 100644
> > index 0000000000..5eca8ec402
> > --- /dev/null
> > +++ b/package/mariadb/0002-add-sysroot-path-to-mariadb_config.patch
> > @@ -0,0 +1,28 @@
> > +From 7e1b6aafeb9fe6558da7506b304c0efb5ea82281 Mon Sep 17 00:00:00 2001
> > +From: Ryan Coe <bluemrp9@gmail.com>
> > +Date: Fri, 13 Dec 2019 17:13:26 -0800
> > +Subject: [PATCH 1/1] add sysroot path to mariadb_config
> > +
> > +Signed-off-by: Ryan Coe <bluemrp9@gmail.com>
> > +---
> > + 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@"
> > +--  
> 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.

> > -# 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
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-12-17  7:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-15 21:33 [Buildroot] [PATCH v2 1/3] package/mariadb: bump version to 10.4.11 Ryan Coe
2019-12-15 21:33 ` [Buildroot] [PATCH v2 2/3] package/mariadb: update startup scripts Ryan Coe
2019-12-16  8:35   ` Thomas Petazzoni
2019-12-17  0:03     ` Ryan Coe
2019-12-15 21:33 ` [Buildroot] [PATCH v2 3/3] package/mariadb: prefix sysroot in mariadb_config Ryan Coe
2019-12-17  0:38   ` Ryan Coe
2019-12-17  7:58     ` Thomas Petazzoni
2019-12-16  8:33 ` [Buildroot] [PATCH v2 1/3] package/mariadb: bump version to 10.4.11 Thomas Petazzoni
2019-12-17  0:12   ` Ryan Coe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.