summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Kang <kai.kang@windriver.com>2015-12-04 15:09:16 +0800
committerArmin Kuster <akuster808@gmail.com>2015-12-20 14:27:21 -0800
commit456eb95308e5c79209bf75acb7e064b37670f46b (patch)
treee489bcbc632ea6eea739f3d2d696a837662beadf
parentc9b4fcea6fec17db4d4c7c1394a4d9168c946384 (diff)
downloadmeta-openembedded-456eb95308e5c79209bf75acb7e064b37670f46b.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> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-oe/recipes-support/mcelog/mcelog/mcelog-debash.patch36
-rw-r--r--meta-oe/recipes-support/mcelog/mcelog/run-ptest3
-rw-r--r--meta-oe/recipes-support/mcelog/mcelog_1.09.bb32
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 000000000..bea2f6293
--- /dev/null
+++ b/meta-oe/recipes-support/mcelog/mcelog/mcelog-debash.patch
@@ -0,0 +1,36 @@
1From 8f57d35747a3b3fabc33466563077373090f869c Mon Sep 17 00:00:00 2001
2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Tue, 2 Sep 2014 07:05:15 -0700
4Subject: [PATCH] cache-error-trigger: remove bashism
5
6Use "$(cat $F)" to instead of "$(< $F)" to debash.
7
8Upstream-Status: Pending
9
10Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
11---
12 triggers/cache-error-trigger | 4 ++--
13 1 file changed, 2 insertions(+), 2 deletions(-)
14
15diff --git a/triggers/cache-error-trigger b/triggers/cache-error-trigger
16index 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--
351.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 000000000..ba7a2c768
--- /dev/null
+++ b/meta-oe/recipes-support/mcelog/mcelog/run-ptest
@@ -0,0 +1,3 @@
1#!/bin/sh
2
3make -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 34ff643a5..542b2ba19 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
4and should run on all Linux systems that need error handling." 4and should run on all Linux systems that need error handling."
5HOMEPAGE = "http://mcelog.org/" 5HOMEPAGE = "http://mcelog.org/"
6SECTION = "System Environment/Base" 6SECTION = "System Environment/Base"
7DEPENDS += "bash" 7
8SRC_URI = "git://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git" 8SRC_URI = "git://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git \
9 file://mcelog-debash.patch \
10 file://run-ptest \
11"
12
9SRCREV = "0fc9f702232cb2d9969916f899c67c3e64deedda" 13SRCREV = "0fc9f702232cb2d9969916f899c67c3e64deedda"
14
10LICENSE = "GPLv2" 15LICENSE = "GPLv2"
11LIC_FILES_CHKSUM = "file://README;md5=3eb76ca64fa07ad53ebb0ebb5b4c8ede" 16LIC_FILES_CHKSUM = "file://README;md5=3eb76ca64fa07ad53ebb0ebb5b4c8ede"
12 17
13S = "${WORKDIR}/git" 18S = "${WORKDIR}/git"
14 19
15do_install() { 20inherit 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
24COMPATIBLE_HOST = '(x86_64.*|i.86.*)-linux' 22COMPATIBLE_HOST = '(x86_64.*|i.86.*)-linux'
25 23
26RDEPENDS_${PN} = "bash" 24do_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
30do_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
36RDEPENDS_${PN}-ptest += "${PN} make bash mce-inject"