aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/mysql/mysql5_5.1.40.inc
blob: 40b6b01cf86ba17c5ab68b2aaabb46094ec3d019 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
DESCRIPTION = "The MySQL Open Source Database System"
HOMEPAGE = "http://www.mysql.com/"
SECTION = "libs"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=477ab0a4c8ca64b482b3f2a365d0fdfa"

DEPENDS = "ncurses"
PR = "r8"

SRC_URI = "http://downloads.mysql.com/archives/mysql-5.1/mysql-${PV}.tar.gz \
           file://configure.in.patch \
           file://plug.in.patch \
           file://misc.m4.patch \
           file://Makefile.am.patch \
           file://fix_host_path.patch \
	   file://configure-ps-cache-check.patch \
           file://fix-abi-check-gcc45.patch \
           file://my.cnf \
           file://mysqld.sh"

S = "${WORKDIR}/mysql-${PV}"

BINCONFIG_GLOB = "mysql_config"

inherit autotools binconfig update-rc.d

INITSCRIPT_PACKAGES = "${PN}-server"
INITSCRIPT_NAME = "mysqld"
INITSCRIPT_PARAMS = "start 45 S . stop 45 0 6 1 ."

export ac_cv_path_PS="/bin/ps"
export ac_cv_FIND_PROC="/bin/ps p \$\$PID | grep -v grep | grep mysqld > /dev/null"
PARALLEL_MAKE = " "
EXTRA_OEMAKE = "'GEN_LEX_HASH=${STAGING_BINDIR_NATIVE}/gen_lex_hash'"
EXTRA_OECONF = " --with-atomic-ops=up --with-embedded-server --prefix=/usr --sysconfdir=/etc/mysql --localstatedir=/var/mysql --disable-dependency-tracking --without-raid --without-debug --with-low-memory --without-query-cache --without-man --without-docs --without-innodb "

do_configure_append() {
     sed -i /comp_err/d ${S}/sql/share/Makefile
}

SYSROOT_PREPROCESS_FUNCS += "mysql5_sysroot_preprocess"

# We need to append this so it runs *after* binconfig's preprocess function
mysql5_sysroot_preprocess () {
	sed -i -es,^pkgincludedir=\'/usr/include/mysql\',pkgincludedir=\'${STAGING_INCDIR}/mysql\', ${SYSROOT_DESTDIR}${bindir_crossscripts}/mysql_config
	sed -i -es,^pkglibdir=\'/usr/lib/mysql\',pkglibdir=\'${STAGING_LIBDIR}\', ${SYSROOT_DESTDIR}${bindir_crossscripts}/mysql_config
}

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_mysql5-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
	mkdir /var/lib/mysql
	chown mysql.nogroup /var/lib/mysql

	mysql_install_db

}

pkg_postrm_mysql5-server () {
	grep mysql /etc/passwd && deluser mysql
}

PACKAGES = "${PN}-dbg ${PN} \
libmysqlclient-r libmysqlclient-r-dev libmysqlclient-r-staticdev libmysqlclient-r-dbg \
libmysqlclient libmysqlclient-dev libmysqlclient-staticdev libmysqlclient-dbg \
${PN}-client ${PN}-server ${PN}-leftovers"
CONFFILES_${PN}-server += "${sysconfdir}/my.cnf"

FILES_${PN} = " "
RDEPENDS_${PN} = "${PN}-client ${PN}-server"
ALLOW_EMPTY_${PN} = "1"

FILES_libmysqlclient = "\
${libdir}/libmysqlclient.so.* \
${libdir}/plugin/*.so.*"
FILES_libmysqlclient-dev = " \
${includedir}/mysql/ \
${libdir}/libmysqlclient.so \
${libdir}/libmysqlclient.la \
${libdir}/plugin/*.so \
${libdir}/plugin/*.la \
${sysconfdir}/aclocal \
${bindir}/mysql_config"
FILES_libmysqlclient-staticdev = "\
${libdir}/*.a \
${libdir}/plugin/*.a"
FILES_libmysqlclient-dbg = "${libdir}/plugin/.debug/ \
/usr/mysql-test/lib/My/SafeProcess/.debug/my_safe_process"

FILES_libmysqlclient-r = "${libdir}/libmysqlclient_r.so.*"
FILES_libmysqlclient-r-dev = "\
${libdir}/libmysqlclient_r.so \
${libdir}/libmysqlclient_r.la"
FILES_libmysqlclient-r-staticdev = "${libdir}/libmysqlclient_r.a"
FILES_libmysqlclient-r-dbg = "${libdir}/plugin/.debuglibmysqlclient_r.so.*"

FILES_${PN}-client = "\
${bindir}/myisam_ftdump \
${bindir}/mysql \
${bindir}/mysql_client_test \
${bindir}/mysql_client_test_embedded \
${bindir}/mysql_find_rows \
${bindir}/mysql_fix_extensions \
${bindir}/mysql_waitpid \
${bindir}/mysqlaccess \
${bindir}/mysqladmin \
${bindir}/mysqlbug \
${bindir}/mysqlcheck \
${bindir}/mysqldump \
${bindir}/mysqldumpslow \
${bindir}/mysqlimport \
${bindir}/mysqlshow \
${bindir}/mysqlslap \
${bindir}/mysqltest_embedded \
${libexecdir}/mysqlmanager"

FILES_${PN}-server = "\
${bindir}/comp_err \
${bindir}/isamchk \
${bindir}/isamlog \
${bindir}/msql2mysql \
${bindir}/my_print_defaults \
${bindir}/myisamchk \
${bindir}/myisamlog \
${bindir}/myisampack \
${bindir}/mysql_convert_table_format \
${bindir}/mysql_fix_privilege_tables \
${bindir}/mysql_install_db \
${bindir}/mysql_secure_installation \
${bindir}/mysql_setpermission \
${bindir}/mysql_tzinfo_to_sql \
${bindir}/mysql_upgrade \
${bindir}/mysql_zap \
${bindir}/mysqlbinlog \
${bindir}/mysqld_multi \
${bindir}/mysqld_safe \
${bindir}/mysqlhotcopy \
${bindir}/mysqltest \
${bindir}/ndb_delete_all \
${bindir}/ndb_desc \
${bindir}/ndb_drop_index \
${bindir}/ndb_drop_table \
${bindir}/ndb_mgm \
${bindir}/ndb_restore \
${bindir}/ndb_select_all \
${bindir}/ndb_select_count \
${bindir}/ndb_show_tables \
${bindir}/ndb_waiter \
${bindir}/pack_isam \
${bindir}/perror \
${bindir}/replace \
${bindir}/resolve_stack_dump \
${bindir}/resolveip \
${libexecdir}/mysqld \
${sbindir}/mysqld \
${sbindir}/ndb_cpcd \
${sbindir}/ndbd \
${sbindir}/ndb_mgmd \
${datadir}/mysql/ \
${localstatedir}/mysql/ \
${sysconfdir}/init.d \
${sysconfdir}/my.cnf"

DESCRIPTION_${PN}-leftovers = "unpackaged and probably unneeded files for ${PN}"
FILES_${PN}-leftovers = "/"
qemuarm'>rbt/qemuarm OpenEmbedded Core user contribution treesGrokmirror user
summaryrefslogtreecommitdiffstats
path: root/scripts/oe-time-dd-test.sh
blob: 81748b8c9e46e11608ff1b17dddb40f7ae77ae63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/bin/bash
#
# Copyright OpenEmbedded Contributors
#
# SPDX-License-Identifier: MIT
#
# oe-time-dd-test records how much time it takes to 
# write <count> number of kilobytes to the filesystem.
# It also records the number of processes that are in
# running (R), uninterruptible sleep (D) and interruptible
# sleep (S) state from the output of "top" command.
# The purporse of this script is to find which part of
# the build system puts stress on the filesystem io and
# log all the processes.
usage() {
	echo "$0 is used to detect i/o latency and runs commands to display host information."
	echo "The following commands are run in order:"
	echo "1) top -c -b -n1 -w 512"
	echo "2) iostat -y -z -x 5 1"
	echo "3) tail -30 tmp*/log/cooker/*/console-latest.log to gather cooker log."
	echo " "
	echo "Options:"
	echo "-c | --count <amount>		dd (transfer) <amount> KiB of data within specified timeout to detect latency."
	echo "				Must enable -t option."
	echo "-t | --timeout <time>		timeout in seconds for the <count> amount of data to be transferred."
	echo "-l | --log-only			run the commands without performing the data transfer."
	echo "-h | --help			show help"

}

run_cmds() {
    echo "start: top output"
	top -c -b -n1 -w 512
	echo "end: top output"
	echo "start: iostat"
	iostat -y -z -x 5 1
	echo "end: iostat"
	echo "start: cooker log"
	tail -30 tmp*/log/cooker/*/console-latest.log
	echo "end: cooker log"
}

if [ $# -lt 1 ]; then
	usage
	exit 1
fi

re_c='^[0-9]+$'
#re_t='^[0-9]+([.][0-9]+)?$'

while [[ $# -gt 0 ]]; do
	key="$1"

	case $key in
		-c|--count)
			COUNT=$2
			shift
			shift
			if ! [[ $COUNT =~ $re_c ]] || [[ $COUNT -le 0 ]] ; then
				usage
				exit 1
			fi
			;;
		-t|--timeout)
			TIMEOUT=$2
			shift
			shift
			if ! [[ $TIMEOUT =~ $re_c ]] || [[ $TIMEOUT -le 0 ]] ; then
				usage
				exit 1
			fi
			;;
		-l|--log-only)
			LOG_ONLY="true"
			shift
			shift
			;;
		-h|--help)
			usage
			exit 0
			;;
		*)
			usage
			exit 1
			;;
	esac
done


if [ "$LOG_ONLY" = "true" ] ; then
    uptime
    run_cmds
    exit
fi

if [ -z ${TIMEOUT+x} ] || [ -z ${COUNT+x} ] ; then
    usage
    exit 1
fi

uptime
echo "Timeout used: ${TIMEOUT}"
timeout ${TIMEOUT} dd if=/dev/zero of=oe-time-dd-test.dat bs=1024 count=${COUNT} conv=fsync
if [ $? -ne 0 ]; then
    run_cmds
fi