* [Buildroot] [PATCH 1/4] mysql: fix missing directory
@ 2014-03-04 14:50 Marcelo Gutiérrez
2014-03-04 14:50 ` [Buildroot] [PATCH 2/4] mysql: add mysql user Marcelo Gutiérrez
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Marcelo Gutiérrez @ 2014-03-04 14:50 UTC (permalink / raw)
To: buildroot
Signed-off-by: Marcelo Guti?rrez <kuyurix@gmail.com>
---
package/mysql/mysql.mk | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/package/mysql/mysql.mk b/package/mysql/mysql.mk
index 95b30b7..eb3a70e 100644
--- a/package/mysql/mysql.mk
+++ b/package/mysql/mysql.mk
@@ -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
--
1.7.10.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 2/4] mysql: add mysql user
2014-03-04 14:50 [Buildroot] [PATCH 1/4] mysql: fix missing directory Marcelo Gutiérrez
@ 2014-03-04 14:50 ` Marcelo Gutiérrez
2014-07-21 22:10 ` Thomas Petazzoni
2014-03-04 14:50 ` [Buildroot] [PATCH 3/4] mysql: add mysql init script Marcelo Gutiérrez
` (2 subsequent siblings)
3 siblings, 1 reply; 11+ messages in thread
From: Marcelo Gutiérrez @ 2014-03-04 14:50 UTC (permalink / raw)
To: buildroot
Signed-off-by: Marcelo Guti?rrez <kuyurix@gmail.com>
---
package/mysql/mysql.mk | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/package/mysql/mysql.mk b/package/mysql/mysql.mk
index eb3a70e..3b69bdc 100644
--- a/package/mysql/mysql.mk
+++ b/package/mysql/mysql.mk
@@ -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
--
1.7.10.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 3/4] mysql: add mysql init script
2014-03-04 14:50 [Buildroot] [PATCH 1/4] mysql: fix missing directory Marcelo Gutiérrez
2014-03-04 14:50 ` [Buildroot] [PATCH 2/4] mysql: add mysql user Marcelo Gutiérrez
@ 2014-03-04 14:50 ` Marcelo Gutiérrez
2014-07-21 22:11 ` Thomas Petazzoni
2014-03-04 14:50 ` [Buildroot] [PATCH 4/4] mysql: host-mysql depends on host-zlib Marcelo Gutiérrez
2014-07-21 22:09 ` [Buildroot] [PATCH 1/4] mysql: fix missing directory Thomas Petazzoni
3 siblings, 1 reply; 11+ messages in thread
From: Marcelo Gutiérrez @ 2014-03-04 14:50 UTC (permalink / raw)
To: buildroot
Signed-off-by: Marcelo Guti?rrez <kuyurix@gmail.com>
---
package/mysql/S97mysqld | 22 ++++++++++++++++++++++
package/mysql/mysql.mk | 5 +++++
2 files changed, 27 insertions(+)
create mode 100644 package/mysql/S97mysqld
diff --git a/package/mysql/S97mysqld b/package/mysql/S97mysqld
new file mode 100644
index 0000000..91ddb44
--- /dev/null
+++ b/package/mysql/S97mysqld
@@ -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
diff --git a/package/mysql/mysql.mk b/package/mysql/mysql.mk
index 3b69bdc..c35fef5 100644
--- a/package/mysql/mysql.mk
+++ b/package/mysql/mysql.mk
@@ -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
--
1.7.10.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 4/4] mysql: host-mysql depends on host-zlib
2014-03-04 14:50 [Buildroot] [PATCH 1/4] mysql: fix missing directory Marcelo Gutiérrez
2014-03-04 14:50 ` [Buildroot] [PATCH 2/4] mysql: add mysql user Marcelo Gutiérrez
2014-03-04 14:50 ` [Buildroot] [PATCH 3/4] mysql: add mysql init script Marcelo Gutiérrez
@ 2014-03-04 14:50 ` Marcelo Gutiérrez
2014-03-04 17:52 ` Thomas Petazzoni
2014-07-21 22:11 ` Thomas Petazzoni
2014-07-21 22:09 ` [Buildroot] [PATCH 1/4] mysql: fix missing directory Thomas Petazzoni
3 siblings, 2 replies; 11+ messages in thread
From: Marcelo Gutiérrez @ 2014-03-04 14:50 UTC (permalink / raw)
To: buildroot
Signed-off-by: Marcelo Guti?rrez <kuyurix@gmail.com>
---
package/mysql/mysql.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/mysql/mysql.mk b/package/mysql/mysql.mk
index c35fef5..9a8612b 100644
--- a/package/mysql/mysql.mk
+++ b/package/mysql/mysql.mk
@@ -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
--
1.7.10.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 4/4] mysql: host-mysql depends on host-zlib
2014-03-04 14:50 ` [Buildroot] [PATCH 4/4] mysql: host-mysql depends on host-zlib Marcelo Gutiérrez
@ 2014-03-04 17:52 ` Thomas Petazzoni
2014-03-04 18:30 ` Marcelo Gutierrez
2014-07-21 22:11 ` Thomas Petazzoni
1 sibling, 1 reply; 11+ messages in thread
From: Thomas Petazzoni @ 2014-03-04 17:52 UTC (permalink / raw)
To: buildroot
Dear Marcelo Guti?rrez,
On Tue, 4 Mar 2014 14:50:03 +0000, Marcelo Guti?rrez wrote:
>
> Signed-off-by: Marcelo Guti?rrez <kuyurix@gmail.com>
> ---
> package/mysql/mysql.mk | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/package/mysql/mysql.mk b/package/mysql/mysql.mk
> index c35fef5..9a8612b 100644
> --- a/package/mysql/mysql.mk
> +++ b/package/mysql/mysql.mk
> @@ -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
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 4/4] mysql: host-mysql depends on host-zlib
2014-03-04 17:52 ` Thomas Petazzoni
@ 2014-03-04 18:30 ` Marcelo Gutierrez
2014-03-04 20:03 ` Marcelo Gutierrez
0 siblings, 1 reply; 11+ messages in thread
From: Marcelo Gutierrez @ 2014-03-04 18:30 UTC (permalink / raw)
To: buildroot
Hi Thomas, all.
Hum, why? I have built the mysql server successfully without this
> 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>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 4/4] mysql: host-mysql depends on host-zlib
2014-03-04 18:30 ` Marcelo Gutierrez
@ 2014-03-04 20:03 ` Marcelo Gutierrez
0 siblings, 0 replies; 11+ messages in thread
From: Marcelo Gutierrez @ 2014-03-04 20:03 UTC (permalink / raw)
To: buildroot
Hi Thomas,
> 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>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 1/4] mysql: fix missing directory
2014-03-04 14:50 [Buildroot] [PATCH 1/4] mysql: fix missing directory Marcelo Gutiérrez
` (2 preceding siblings ...)
2014-03-04 14:50 ` [Buildroot] [PATCH 4/4] mysql: host-mysql depends on host-zlib Marcelo Gutiérrez
@ 2014-07-21 22:09 ` Thomas Petazzoni
3 siblings, 0 replies; 11+ messages in thread
From: Thomas Petazzoni @ 2014-07-21 22:09 UTC (permalink / raw)
To: buildroot
Dear Marcelo Guti?rrez,
On Tue, 4 Mar 2014 14:50:00 +0000, Marcelo Guti?rrez wrote:
>
> Signed-off-by: Marcelo Guti?rrez <kuyurix@gmail.com>
> ---
> package/mysql/mysql.mk | 7 +++++++
> 1 file changed, 7 insertions(+)
Applied, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 2/4] mysql: add mysql user
2014-03-04 14:50 ` [Buildroot] [PATCH 2/4] mysql: add mysql user Marcelo Gutiérrez
@ 2014-07-21 22:10 ` Thomas Petazzoni
0 siblings, 0 replies; 11+ messages in thread
From: Thomas Petazzoni @ 2014-07-21 22:10 UTC (permalink / raw)
To: buildroot
Dear Marcelo Guti?rrez,
On Tue, 4 Mar 2014 14:50:01 +0000, Marcelo Guti?rrez wrote:
> +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
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 3/4] mysql: add mysql init script
2014-03-04 14:50 ` [Buildroot] [PATCH 3/4] mysql: add mysql init script Marcelo Gutiérrez
@ 2014-07-21 22:11 ` Thomas Petazzoni
0 siblings, 0 replies; 11+ messages in thread
From: Thomas Petazzoni @ 2014-07-21 22:11 UTC (permalink / raw)
To: buildroot
Dear Marcelo Guti?rrez,
On Tue, 4 Mar 2014 14:50:02 +0000, Marcelo Guti?rrez wrote:
> +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...
> + ;;
> + 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
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 4/4] mysql: host-mysql depends on host-zlib
2014-03-04 14:50 ` [Buildroot] [PATCH 4/4] mysql: host-mysql depends on host-zlib Marcelo Gutiérrez
2014-03-04 17:52 ` Thomas Petazzoni
@ 2014-07-21 22:11 ` Thomas Petazzoni
1 sibling, 0 replies; 11+ messages in thread
From: Thomas Petazzoni @ 2014-07-21 22:11 UTC (permalink / raw)
To: buildroot
Dear Marcelo Guti?rrez,
On Tue, 4 Mar 2014 14:50:03 +0000, Marcelo Guti?rrez wrote:
>
> Signed-off-by: Marcelo Guti?rrez <kuyurix@gmail.com>
> ---
> 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
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2014-07-21 22:11 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-04 14:50 [Buildroot] [PATCH 1/4] mysql: fix missing directory Marcelo Gutiérrez
2014-03-04 14:50 ` [Buildroot] [PATCH 2/4] mysql: add mysql user Marcelo Gutiérrez
2014-07-21 22:10 ` Thomas Petazzoni
2014-03-04 14:50 ` [Buildroot] [PATCH 3/4] mysql: add mysql init script Marcelo Gutiérrez
2014-07-21 22:11 ` Thomas Petazzoni
2014-03-04 14:50 ` [Buildroot] [PATCH 4/4] mysql: host-mysql depends on host-zlib Marcelo Gutiérrez
2014-03-04 17:52 ` Thomas Petazzoni
2014-03-04 18:30 ` Marcelo Gutierrez
2014-03-04 20:03 ` Marcelo Gutierrez
2014-07-21 22:11 ` Thomas Petazzoni
2014-07-21 22:09 ` [Buildroot] [PATCH 1/4] mysql: fix missing directory Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox