diff options
author | Kai Kang <kai.kang@windriver.com> | 2015-12-04 15:09:16 +0800 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2015-12-18 12:39:50 +0100 |
commit | e91bab37468e3bea5fc279f44ed1dbe1687f328a (patch) | |
tree | 33c73726e282455068dd4a7e1962db920d94735f /meta-oe/recipes-support | |
parent | 906cb0dcf0d40893849b5bd76189b119e9a6c7dc (diff) | |
download | meta-openembedded-e91bab37468e3bea5fc279f44ed1dbe1687f328a.tar.gz |
mcelog: remove bashism and create ptest subpackage
Create ptest subpackage. Add a patch to remove bashism and then only
ptest package depends on bash.
Inherit autotools-brokensep and re-write do_install as well.
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support')
-rw-r--r-- | meta-oe/recipes-support/mcelog/mcelog/mcelog-debash.patch | 36 | ||||
-rw-r--r-- | meta-oe/recipes-support/mcelog/mcelog/run-ptest | 3 | ||||
-rw-r--r-- | meta-oe/recipes-support/mcelog/mcelog_1.09.bb | 32 |
3 files changed, 60 insertions, 11 deletions
diff --git a/meta-oe/recipes-support/mcelog/mcelog/mcelog-debash.patch b/meta-oe/recipes-support/mcelog/mcelog/mcelog-debash.patch new file mode 100644 index 0000000000..bea2f6293c --- /dev/null +++ b/meta-oe/recipes-support/mcelog/mcelog/mcelog-debash.patch | |||
@@ -0,0 +1,36 @@ | |||
1 | From 8f57d35747a3b3fabc33466563077373090f869c Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Yang <liezhi.yang@windriver.com> | ||
3 | Date: Tue, 2 Sep 2014 07:05:15 -0700 | ||
4 | Subject: [PATCH] cache-error-trigger: remove bashism | ||
5 | |||
6 | Use "$(cat $F)" to instead of "$(< $F)" to debash. | ||
7 | |||
8 | Upstream-Status: Pending | ||
9 | |||
10 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
11 | --- | ||
12 | triggers/cache-error-trigger | 4 ++-- | ||
13 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
14 | |||
15 | diff --git a/triggers/cache-error-trigger b/triggers/cache-error-trigger | ||
16 | index e32bfd6..785526f 100755 | ||
17 | --- a/triggers/cache-error-trigger | ||
18 | +++ b/triggers/cache-error-trigger | ||
19 | @@ -1,4 +1,4 @@ | ||
20 | -#!/bin/bash | ||
21 | +#!/bin/sh | ||
22 | # cache error trigger. This shell script is executed by mcelog in daemon mode | ||
23 | # when a CPU reports excessive corrected cache errors. This could be a indication | ||
24 | # for future uncorrected errors. | ||
25 | @@ -28,7 +28,7 @@ for i in $AFFECTED_CPUS ; do | ||
26 | logger -s -p daemon.crit -t mcelog "Offlining CPU $i due to cache error threshold" | ||
27 | F=$(printf "/sys/devices/system/cpu/cpu%d/online" $i) | ||
28 | echo 0 > $F | ||
29 | - if [ "$(< $F)" != "0" ] ; then | ||
30 | + if [ "$(cat $F)" != "0" ] ; then | ||
31 | logger -s -p daemon.warn -t mcelog "Offlining CPU $i failed" | ||
32 | EXIT=1 | ||
33 | fi | ||
34 | -- | ||
35 | 1.7.9.5 | ||
36 | |||
diff --git a/meta-oe/recipes-support/mcelog/mcelog/run-ptest b/meta-oe/recipes-support/mcelog/mcelog/run-ptest new file mode 100644 index 0000000000..ba7a2c7683 --- /dev/null +++ b/meta-oe/recipes-support/mcelog/mcelog/run-ptest | |||
@@ -0,0 +1,3 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | make -C tests test | ||
diff --git a/meta-oe/recipes-support/mcelog/mcelog_1.09.bb b/meta-oe/recipes-support/mcelog/mcelog_1.09.bb index 34ff643a56..542b2ba19a 100644 --- a/meta-oe/recipes-support/mcelog/mcelog_1.09.bb +++ b/meta-oe/recipes-support/mcelog/mcelog_1.09.bb | |||
@@ -4,23 +4,33 @@ and 64bit Linux kernels (since early 2.6 kernel releases) to log machine checks | |||
4 | and should run on all Linux systems that need error handling." | 4 | and should run on all Linux systems that need error handling." |
5 | HOMEPAGE = "http://mcelog.org/" | 5 | HOMEPAGE = "http://mcelog.org/" |
6 | SECTION = "System Environment/Base" | 6 | SECTION = "System Environment/Base" |
7 | DEPENDS += "bash" | 7 | |
8 | SRC_URI = "git://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git" | 8 | SRC_URI = "git://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git \ |
9 | file://mcelog-debash.patch \ | ||
10 | file://run-ptest \ | ||
11 | " | ||
12 | |||
9 | SRCREV = "0fc9f702232cb2d9969916f899c67c3e64deedda" | 13 | SRCREV = "0fc9f702232cb2d9969916f899c67c3e64deedda" |
14 | |||
10 | LICENSE = "GPLv2" | 15 | LICENSE = "GPLv2" |
11 | LIC_FILES_CHKSUM = "file://README;md5=3eb76ca64fa07ad53ebb0ebb5b4c8ede" | 16 | LIC_FILES_CHKSUM = "file://README;md5=3eb76ca64fa07ad53ebb0ebb5b4c8ede" |
12 | 17 | ||
13 | S = "${WORKDIR}/git" | 18 | S = "${WORKDIR}/git" |
14 | 19 | ||
15 | do_install() { | 20 | inherit autotools-brokensep ptest |
16 | install -d ${D}/${sbindir} | ||
17 | install -m 0755 ${S}/mcelog ${D}/${sbindir} | ||
18 | install -d ${D}/${mandir}/man8 | ||
19 | install -m 0644 ${S}/mcelog.8 ${D}/${mandir}/man8/ | ||
20 | install -d ${D}/etc/cron.hourly | ||
21 | install -m 0755 ${S}/mcelog.cron ${D}/etc/cron.hourly/ | ||
22 | } | ||
23 | 21 | ||
24 | COMPATIBLE_HOST = '(x86_64.*|i.86.*)-linux' | 22 | COMPATIBLE_HOST = '(x86_64.*|i.86.*)-linux' |
25 | 23 | ||
26 | RDEPENDS_${PN} = "bash" | 24 | do_install_append() { |
25 | install -d ${D}${sysconfdir}/cron.hourly | ||
26 | install -m 0755 ${S}/mcelog.cron ${D}${sysconfdir}/cron.hourly/ | ||
27 | sed -i 's/bash/sh/' ${D}${sysconfdir}/cron.hourly/mcelog.cron | ||
28 | } | ||
29 | |||
30 | do_install_ptest() { | ||
31 | install -d ${D}${PTEST_PATH} | ||
32 | cp -r ${S}/tests ${S}/input ${D}${PTEST_PATH} | ||
33 | sed -i 's#../../mcelog#mcelog#' ${D}${PTEST_PATH}/tests/test | ||
34 | } | ||
35 | |||
36 | RDEPENDS_${PN}-ptest += "${PN} make bash mce-inject" | ||