diff options
-rw-r--r-- | packages/mysql/files/my.cnf | 21 | ||||
-rw-r--r-- | packages/mysql/files/mysqld.sh | 20 | ||||
-rw-r--r-- | packages/mysql/mysql_4.1.18.bb | 36 |
3 files changed, 71 insertions, 6 deletions
diff --git a/packages/mysql/files/my.cnf b/packages/mysql/files/my.cnf new file mode 100644 index 0000000000..15a8b1b4ab --- /dev/null +++ b/packages/mysql/files/my.cnf @@ -0,0 +1,21 @@ +[client] +#password = password +port = 3306 +socket = /tmp/mysql.sock + +[mysqld_safe] +err-log = /var/log/mysql.err + +[mysqld] +user = mysql +port = 3306 +socket = /tmp/mysql.sock +pid-file = /var/run/mysqld.pid +log-error = /var/log/mysqld.err +basedir = /usr +datadir = /var/mysql +skip-locking +skip-innodb +skip-networking +bind-address = localhost + diff --git a/packages/mysql/files/mysqld.sh b/packages/mysql/files/mysqld.sh new file mode 100644 index 0000000000..c94772e202 --- /dev/null +++ b/packages/mysql/files/mysqld.sh @@ -0,0 +1,20 @@ +# MySQL init script + +. /etc/default/rcS + +case "$1" in + start) + /usr/bin/mysqld_safe & + ;; + stop) + if test -f /var/run/mysqld.pid ; then + PID=`cat /var/run/mysqld.pid` + kill $PID + fi + ;; + *) + echo "Usage: /etc/init.d/mysqld {start|stop}" + ;; +esac + +exit 0 diff --git a/packages/mysql/mysql_4.1.18.bb b/packages/mysql/mysql_4.1.18.bb index d35442b50a..53165ac8d4 100644 --- a/packages/mysql/mysql_4.1.18.bb +++ b/packages/mysql/mysql_4.1.18.bb @@ -3,19 +3,25 @@ SECTION = "libs" HOMEPAGE = "http://www.mysql.com/" DEPENDS += "ncurses mysql-native" LICENSE = "GPL" -PR = "r1" +PR="r2" SRC_URI = "http://mirrors.develooper.com/mysql/Downloads/MySQL-4.1/mysql-${PV}.tar.gz \ file://autofoo.patch;patch=1 \ - file://gen_lex_hash.patch;patch=1" + file://gen_lex_hash.patch;patch=1 \ + file://my.cnf \ + file://mysqld.sh" S = "${WORKDIR}/mysql-${PV}" FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/mysql-${PV}', '${FILE_DIRNAME}/files', '${FILE_DIRNAME}' ], d)}" BINCONFIG_GLOB = "mysql_config" -inherit autotools binconfig +inherit autotools binconfig update-rc.d + +INITSCRIPT_PACKAGES = "mysql-server" +INITSCRIPT_NAME = "mysqld" +INITSCRIPT_PARAMS = "start 45 S . stop 45 0 6 1 ." EXTRA_OEMAKE = "'GEN_LEX_HASH=${STAGING_BINDIR}/gen_lex_hash'" EXTRA_OECONF = " --with-embedded-server --prefix=/usr --sysconfdir=/etc/mysql --localstatedir=/var/mysql --datadir=/var/mysql --disable-dependency-tracking --without-raid --without-debug --with-low-memory --without-query-cache --without-man --without-docs --without-innodb " @@ -30,13 +36,29 @@ do_install() { oe_runmake 'DESTDIR=${D}' install mv -f ${D}${libdir}/mysql/* ${D}${libdir} rmdir ${D}${libdir}/mysql + + install -d ${D}/etc/init.d + install -m 0644 ${WORKDIR}/my.cnf ${D}/etc/ + install -m 0755 ${WORKDIR}/mysqld.sh ${D}/etc/init.d/mysqld } -pkg_postinst () { +pkg_postinst_mysql-server () { + if [ "x$D" != "x" ]; then + exit 1 + fi + grep mysql /etc/passwd || adduser --disabled-password --home=/var/mysql --ingroup nogroup mysql + + #Install the database + test -d /usr/bin || mkdir -p /usr/bin + test -e /usr/bin/hostname || ln -s /bin/hostname /usr/bin/hostname + chmod go+rw /var/run + + mysql_install_db + } -pkg_postrm () { +pkg_postrm_mysql-server () { grep mysql /etc/passwd && deluser mysql } @@ -112,4 +134,6 @@ ${sbindir}/ndb_cpcd \ ${sbindir}/ndbd \ ${sbindir}/ndb_mgmd \ ${datadir}/mysql/ \ -${localstatedir}/mysql/" +${localstatedir}/mysql/ \ +${sysconfdir}/init.d \ +${sysconfdir}/my.cnf" |