mysql: fix missing directory
PATCH 1/4 mysql: fix missing directory
--- package/mysql/mysql.mk | 7 +++++++ 1 file changed, 7 insertions(+)
package/mysql/mysql.mk +7 -0
@@ -40,6 +40,7 @@ HOST_MYSQL_CONF_OPT = \ --with-embedded-server MYSQL_CONF_OPT += \ + --localstatedir=/var/mysql \ --disable-dependency-tracking \ --with-atomic-ops=up \ --with-embedded-server \
@@ -78,6 +79,12 @@ define HOST_MYSQL_INSTALL_CMDS $(INSTALL) -m 0755 $(@D)/sql/gen_lex_hash $(HOST_DIR)/usr/bin/ endef +define MYSQL_ADD_FOLDER + $(INSTALL) -d $(TARGET_DIR)/var/mysql +endef + +MYSQL_POST_INSTALL_TARGET_HOOKS += MYSQL_ADD_FOLDER + else MYSQL_CONF_OPT += \ --without-server
Signature · 1 line
1.7.10.4
PATCH 2/4 mysql: add mysql user
--- package/mysql/mysql.mk | 4 ++++ 1 file changed, 4 insertions(+)
package/mysql/mysql.mk +4 -0
@@ -79,6 +79,10 @@ define HOST_MYSQL_INSTALL_CMDS $(INSTALL) -m 0755 $(@D)/sql/gen_lex_hash $(HOST_DIR)/usr/bin/ endef +define MYSQL_USERS + mysql -1 nogroup -1 = /var/mysql /bin/sh - +endef + define MYSQL_ADD_FOLDER $(INSTALL) -d $(TARGET_DIR)/var/mysql endef
Signature · 1 line
1.7.10.4
PATCH 2/4 mysql: add mysql user
Dear Marcelo Guti?rrez,
package/mysql/mysql.mk define HOST_MYSQL_INSTALL_CMDS · line 84
Quoted 3 lines · Marcelo Guti?rrez
package/mysql/mysql.mk +3
-0+define MYSQL_USERS + mysql -1 nogroup -1 = /var/mysql /bin/sh - +endef
I've changed = to * to generate an user that cannot log in. I've changed /bin/sh to - because there's no point in having a shell defined. And I've added a description of the user.
Applied with those changes, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 3/4 mysql: add mysql init script
In reply to Marcelo Gutiérrez--- package/mysql/S97mysqld | 22 ++++++++++++++++++++++ package/mysql/mysql.mk | 5 +++++ 2 files changed, 27 insertions(+) create mode 100644 package/mysql/S97mysqld
package/mysql/S97mysqld new file +22 -0
@@ -0,0 +1,22 @@ +#!/bin/sh +# +#MySQL init script. +# +case "$1" in + start) + /usr/bin/mysqld_safe & + ;; + stop) + if test -f /var/lib/mysql/mysqld.pid ; then + PID=`cat /var/lib/mysql/mysqld.pid` + kill $PID + fi + ;; + restart) + "$0" stop + "$0" start + ;; + *) + echo "Usage: /etc/init.d/mysqld {start|stop|restart}" + ;; +esac
package/mysql/mysql.mk +5 -0
@@ -89,6 +89,11 @@ endef MYSQL_POST_INSTALL_TARGET_HOOKS += MYSQL_ADD_FOLDER +define MYSQL_INSTALL_INIT_SYSV + $(INSTALL) -D -m 0755 package/mysql/S97mysqld \ + $(TARGET_DIR)/etc/init.d/S97mysqld +endef + else MYSQL_CONF_OPT += \ --without-server
Signature · 1 line
1.7.10.4
PATCH 3/4 mysql: add mysql init script
Dear Marcelo Guti?rrez,
package/mysql/S97mysqld line 7
Quoted 3 lines · Marcelo Guti?rrez
package/mysql/S97mysqld new file +3
-0+case "$1" in + start) + /usr/bin/mysqld_safe &
I've added a call to mysql_install_db on the first boot, to generate the MySQL system tables, otherwise the server refuses to start. I've also used --pid-file when calling mysqld_safe to explicitly specify where the pid file should be stored, because...
package/mysql/S97mysqld line 11
Quoted 4 lines
package/mysql/S97mysqld new file +4
-0+ ;; + stop) + if test -f /var/lib/mysql/mysqld.pid ; then + PID=`cat /var/lib/mysql/mysqld.pid`
... it wasn't stored there, so I fixed that up as well.
Committed with those changes, thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 4/4 mysql: host-mysql depends on host-zlib
In reply to Marcelo Gutiérrez--- package/mysql/mysql.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
package/mysql/mysql.mk +1 -1
@@ -34,7 +34,7 @@ MYSQL_CONF_OPT = \ ifeq ($(BR2_PACKAGE_MYSQL_SERVER),y) MYSQL_DEPENDENCIES += host-mysql host-bison -HOST_MYSQL_DEPENDENCIES = +HOST_MYSQL_DEPENDENCIES = host-zlib HOST_MYSQL_CONF_OPT = \ --with-embedded-server
Signature · 1 line
1.7.10.4
PATCH 4/4 mysql: host-mysql depends on host-zlib
Dear Marcelo Guti?rrez,
Quoted 11 lines · Marcelo Guti?rrez
Signed-off-by Marcelo Guti?rrez <[email protected]>--- package/mysql/mysql.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)package/mysql/mysql.mk +0
-0
package/mysql/mysql.mk MYSQL_CONF_OPT = \ · line 37
Quoted 5 lines
package/mysql/mysql.mk +1
-1@@ -34,7 +34,7 @@ MYSQL_CONF_OPT = \ ifeq ($(BR2_PACKAGE_MYSQL_SERVER),y) MYSQL_DEPENDENCIES += host-mysql host-bison -HOST_MYSQL_DEPENDENCIES = +HOST_MYSQL_DEPENDENCIES = host-zlib
Hum, why? I have built the mysql server successfully without this patch. Can you give some details about why this is needed?
And by the way, thanks a lot for the patches!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 4/4 mysql: host-mysql depends on host-zlib
Hi Thomas, all.
Hum, why? I have built the mysql server successfully without this
Quoted 2 lines
patch. Can you give some details about why this is needed?
I downloaded a fresh "git buildroot" and I've only selected MySQL client and MySQL server.
When it was compiling "host-mysql", could not find "libzlt.la" library.
So I've added host-zlib and that issue completely gone.
Regards,
Marcelo.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20140304/cba326e5/attachment.html>
PATCH 4/4 mysql: host-mysql depends on host-zlib
Hi Thomas,
Quoted 7 lines
I downloaded a fresh "git buildroot" and I've only selected MySQL client and MySQL server.
When it was compiling "host-mysql", could not find "libzlt.la" library.
So I've added host-zlib and that issue completely gone.
More details about host-zlib dependency....
I'm using a Debian distro and if remove "zlib1g-dev" package. I got the following error message without host-zlib.
libtool: link: cannot find the library ../zlib/libzlt.la' or unhandled argument ../zlib/libzlt.la'
Therefore, zlib1g-dev makes the difference.
Regards,
Marcelo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20140304/72838d63/attachment.html>
PATCH 4/4 mysql: host-mysql depends on host-zlib
In reply to Marcelo GutiérrezDear Marcelo Guti?rrez,
Quoted 5 lines · Marcelo Guti?rrez
Signed-off-by Marcelo Guti?rrez <[email protected]>--- package/mysql/mysql.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks. I've added a reference to the autobuilder issue being fixed by this commit. Next time, make sure to include such a reference. Thanks a lot!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
Thomas Petazzoni
AppliedPATCH 1/4 mysql: fix missing directory
In reply to Marcelo GutiérrezDear Marcelo Guti?rrez,
Quoted 5 lines · Marcelo Guti?rrez
Signed-off-by Marcelo Guti?rrez <[email protected]>--- package/mysql/mysql.mk | 7 +++++++ 1 file changed, 7 insertions(+)
Applied, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com