diff options
author | Ross Burton <ross@openedhand.com> | 2007-11-05 17:32:08 +0000 |
---|---|---|
committer | Ross Burton <ross@openedhand.com> | 2007-11-05 17:32:08 +0000 |
commit | 2188cf09e11398447a6e59ee8a2819877f90b45c (patch) | |
tree | 53ac6e0fbb0c318feef6d67b45d54f5208154ed6 /meta-extras/packages/ubootchart | |
parent | 378c8dbafe89e22ad8ce3463968c366c4d745d4d (diff) | |
download | poky-2188cf09e11398447a6e59ee8a2819877f90b45c.tar.gz |
ubootchart: add a launcher to stop the profiling, alternatives to optionally replace /sbin/init, and cleanly pretend to be /sbin/init
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3071 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta-extras/packages/ubootchart')
4 files changed, 48 insertions, 3 deletions
diff --git a/meta-extras/packages/ubootchart/files/pass-args.patch b/meta-extras/packages/ubootchart/files/pass-args.patch new file mode 100644 index 0000000000..9ad4282f21 --- /dev/null +++ b/meta-extras/packages/ubootchart/files/pass-args.patch | |||
@@ -0,0 +1,21 @@ | |||
1 | Index: ubootchartd | ||
2 | =================================================================== | ||
3 | --- ubootchartd (revision 9) | ||
4 | +++ ubootchartd (working copy) | ||
5 | @@ -7,9 +7,11 @@ | ||
6 | # can read. | ||
7 | . /etc/ubootchart/ubootchart.conf | ||
8 | |||
9 | -#################################################### | ||
10 | -# Now start capturing the stats: | ||
11 | -#################################################### | ||
12 | -/sbin/ubootchartd_bin & | ||
13 | -exec $init_prog | ||
14 | +if [ $$ -eq 1 ]; then | ||
15 | + #################################################### | ||
16 | + # Now start capturing the stats: | ||
17 | + #################################################### | ||
18 | + /sbin/ubootchartd_bin & | ||
19 | +fi | ||
20 | |||
21 | +exec $init_prog "$@" | ||
diff --git a/meta-extras/packages/ubootchart/files/ubootchart-stop b/meta-extras/packages/ubootchart/files/ubootchart-stop new file mode 100644 index 0000000000..3444069c9a --- /dev/null +++ b/meta-extras/packages/ubootchart/files/ubootchart-stop | |||
@@ -0,0 +1,3 @@ | |||
1 | #! /bin/sh | ||
2 | |||
3 | kill -USR1 $(pidof ubootchartd_bin) | ||
diff --git a/meta-extras/packages/ubootchart/files/ubootchart.desktop b/meta-extras/packages/ubootchart/files/ubootchart.desktop new file mode 100644 index 0000000000..5552b3bc6f --- /dev/null +++ b/meta-extras/packages/ubootchart/files/ubootchart.desktop | |||
@@ -0,0 +1,6 @@ | |||
1 | [Desktop Entry] | ||
2 | Encoding=UTF-8 | ||
3 | Exec=/sbin/ubootchart-stop | ||
4 | Name=Stop Bootchart | ||
5 | Type=Application | ||
6 | Categories=Programming; | ||
diff --git a/meta-extras/packages/ubootchart/ubootchart_svn.bb b/meta-extras/packages/ubootchart/ubootchart_svn.bb index 95e09c98a8..7ab485c58c 100644 --- a/meta-extras/packages/ubootchart/ubootchart_svn.bb +++ b/meta-extras/packages/ubootchart/ubootchart_svn.bb | |||
@@ -2,22 +2,37 @@ DESCRIPTION = "A boot profiling tool" | |||
2 | HOMEPAGE = "http://code.google.com/p/ubootchart/" | 2 | HOMEPAGE = "http://code.google.com/p/ubootchart/" |
3 | LICENSE = "GPLv3" | 3 | LICENSE = "GPLv3" |
4 | PV = "0.0+r${SRCREV}" | 4 | PV = "0.0+r${SRCREV}" |
5 | PR = "r2" | ||
6 | |||
7 | RRECOMMENDS = "acct" | ||
5 | 8 | ||
6 | SRC_URI = "svn://ubootchart.googlecode.com/svn/;proto=http;module=trunk \ | 9 | SRC_URI = "svn://ubootchart.googlecode.com/svn/;proto=http;module=trunk \ |
7 | file://sysvinit.patch;patch=1;pnum=0" | 10 | file://sysvinit.patch;patch=1;pnum=0 \ |
11 | file://pass-args.patch;patch=1;pnum=0 \ | ||
12 | file://ubootchart-stop \ | ||
13 | file://ubootchart.desktop" | ||
8 | 14 | ||
9 | S = "${WORKDIR}/trunk" | 15 | S = "${WORKDIR}/trunk" |
10 | 16 | ||
17 | inherit update-alternatives | ||
18 | |||
19 | ALTERNATIVE_NAME = "init" | ||
20 | ALTERNATIVE_LINK = "${base_sbindir}/init" | ||
21 | ALTERNATIVE_PATH = "${base_sbindir}/ubootchartd" | ||
22 | ALTERNATIVE_PRIORITY = "20" | ||
23 | |||
11 | do_compile() { | 24 | do_compile() { |
12 | ${CC} ${CFLAGS} ${LDFLAGS} ${LIBS} ${INCLUDES} ${S}/ubootchartd_bin.c -o ubootchartd_bin | 25 | ${CC} ${CFLAGS} ${LDFLAGS} ${LIBS} ${INCLUDES} ${S}/ubootchartd_bin.c -o ubootchartd_bin |
13 | } | 26 | } |
14 | 27 | ||
15 | do_install() { | 28 | do_install() { |
16 | install -m 0755 -d ${D}/sbin ${D}/etc/ubootchart | 29 | install -m 0755 -d ${D}/sbin ${D}/etc/ubootchart ${D}/usr/share/applications |
17 | install -m 0755 ${S}/ubootchartd_bin ${D}/sbin | 30 | install -m 0755 ${S}/ubootchartd_bin ${D}/sbin |
18 | install -m 0755 ${S}/ubootchartd ${D}/sbin | 31 | install -m 0755 ${S}/ubootchartd ${D}/sbin |
19 | install -m 0644 ${S}/ubootchart.conf ${D}/etc/ubootchart | 32 | install -m 0644 ${S}/ubootchart.conf ${D}/etc/ubootchart |
20 | install -m 0755 ${S}/start.sh ${D}/etc/ubootchart | 33 | install -m 0755 ${S}/start.sh ${D}/etc/ubootchart |
21 | install -m 0755 ${S}/finish.sh ${D}/etc/ubootchart | 34 | install -m 0755 ${S}/finish.sh ${D}/etc/ubootchart |
35 | |||
36 | install -m 0755 ${WORKDIR}/ubootchart-stop ${D}/sbin | ||
37 | install -m 0644 ${WORKDIR}/ubootchart.desktop ${D}/usr/share/applications | ||
22 | } | 38 | } |
23 | |||