summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Kang <kai.kang@windriver.com>2015-12-02 17:51:40 +0800
committerMartin Jansa <Martin.Jansa@gmail.com>2016-01-14 11:22:07 +0100
commit53d75fdf0b5930db64e07782437061be4debbdf8 (patch)
treecbeaa2c5900d3dec8fca8cc1ead07af89a411659
parentad6133a2e95f4b83b6b3ea413598e2cd5fb3fd90 (diff)
downloadmeta-openembedded-53d75fdf0b5930db64e07782437061be4debbdf8.tar.gz
edac-utils: add patches for initscript
Update LIC_FILES_CHKSUM that the whole license file should be used rather than the first 2 lines. Remove COMPATIBLE_HOST that edac-utils could build for all architectures. Update runtime dependencies: * add perl modules that edac-ctl needs * add dmidecode for the archs which are in COMPATIBLE_HOST of dmidecode that dmidecode is required by command edac-ctl. And add patches for initscripts to: * add restart subcommand * make init script be able to load EDAC module automatically 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/edac-utils/edac-utils_git.bb19
-rw-r--r--meta-oe/recipes-support/edac-utils/files/add-restart-to-initscript.patch33
-rw-r--r--meta-oe/recipes-support/edac-utils/files/make-init-script-be-able-to-automatically-load-EDAC-.patch98
3 files changed, 145 insertions, 5 deletions
diff --git a/meta-oe/recipes-support/edac-utils/edac-utils_git.bb b/meta-oe/recipes-support/edac-utils/edac-utils_git.bb
index e5621ade6..9bd2f0ae9 100644
--- a/meta-oe/recipes-support/edac-utils/edac-utils_git.bb
+++ b/meta-oe/recipes-support/edac-utils/edac-utils_git.bb
@@ -2,7 +2,7 @@ SUMMARY = "Userspace helper for Linux kernel EDAC drivers"
2HOMEPAGE = "https://github.com/grondo/edac-utils" 2HOMEPAGE = "https://github.com/grondo/edac-utils"
3SECTION = "Applications/System" 3SECTION = "Applications/System"
4LICENSE = "GPLv2" 4LICENSE = "GPLv2"
5LIC_FILES_CHKSUM = "file://COPYING;beginline=1;endline=2;md5=1fbd81241fe252ec0f5658a521ab7dd8" 5LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
6 6
7DEPENDS = " sysfsutils" 7DEPENDS = " sysfsutils"
8 8
@@ -11,7 +11,10 @@ PV = "0.16+git${SRCPV}"
11 11
12S = "${WORKDIR}/git" 12S = "${WORKDIR}/git"
13 13
14SRC_URI = "git://github.com/grondo/edac-utils;protocol=http" 14SRC_URI = "git://github.com/grondo/edac-utils \
15 file://make-init-script-be-able-to-automatically-load-EDAC-.patch \
16 file://add-restart-to-initscript.patch \
17"
15 18
16inherit autotools-brokensep 19inherit autotools-brokensep
17 20
@@ -20,6 +23,12 @@ do_configure_prepend () {
20 ${S}/bootstrap 23 ${S}/bootstrap
21} 24}
22 25
23COMPATIBLE_HOST = '(x86_64.*|i.86.*)-linux' 26RDEPENDS_${PN}_x86 = "dmidecode"
24 27RDEPENDS_${PN}_x86-64 = "dmidecode"
25RDEPENDS_${PN} = " perl" 28RDEPENDS_${PN}_arm = "dmidecode"
29RDEPENDS_${PN}_aarch64 = "dmidecode"
30RDEPENDS_${PN}_powerpc = "dmidecode"
31RDEPENDS_${PN}_powerpc64 = "dmidecode"
32RDEPENDS_${PN}_append = " \
33 perl-module-file-basename perl-module-file-find perl-module-getopt-long perl-module-posix \
34"
diff --git a/meta-oe/recipes-support/edac-utils/files/add-restart-to-initscript.patch b/meta-oe/recipes-support/edac-utils/files/add-restart-to-initscript.patch
new file mode 100644
index 000000000..87051da90
--- /dev/null
+++ b/meta-oe/recipes-support/edac-utils/files/add-restart-to-initscript.patch
@@ -0,0 +1,33 @@
1From 3ade837f64de0cfe2aed5bc52f7919760f350531 Mon Sep 17 00:00:00 2001
2From: Wenzong Fan <wenzong.fan@windriver.com>
3Date: Fri, 7 Mar 2014 00:57:12 -0500
4Subject: [PATCH] edac: add restart to initscript
5
6Upstream-Status: Pending
7
8Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
9---
10 src/etc/edac.init.in | 6 +++++-
11 1 file changed, 5 insertions(+), 1 deletion(-)
12
13diff --git a/src/etc/edac.init.in b/src/etc/edac.init.in
14index adf76ee..007a519 100644
15--- a/src/etc/edac.init.in
16+++ b/src/etc/edac.init.in
17@@ -155,8 +155,12 @@ case "$1" in
18 status)
19 service_status
20 ;;
21+ restart)
22+ service_stop
23+ service_start
24+ ;;
25 *)
26- COMMANDS="start|stop|status"
27+ COMMANDS="start|stop|status|restart"
28 echo "Usage: $0 {${COMMANDS}}"
29 exit 2
30 ;;
31--
321.7.9.5
33
diff --git a/meta-oe/recipes-support/edac-utils/files/make-init-script-be-able-to-automatically-load-EDAC-.patch b/meta-oe/recipes-support/edac-utils/files/make-init-script-be-able-to-automatically-load-EDAC-.patch
new file mode 100644
index 000000000..fddc25f60
--- /dev/null
+++ b/meta-oe/recipes-support/edac-utils/files/make-init-script-be-able-to-automatically-load-EDAC-.patch
@@ -0,0 +1,98 @@
1make init script be able to automatically load EDAC module.
2
3Upstream-Status: Inappropriate [embedded specific]
4
5Signed-off-by: Roy.Li <rongqing.li@windriver.com>
6---
7 src/etc/edac.init.in | 49 +++++++++++++++++++++++++++++++++++++++++++++++--
8 1 file changed, 47 insertions(+), 2 deletions(-)
9
10diff --git a/src/etc/edac.init.in b/src/etc/edac.init.in
11index 7a51da9..5b568c4 100644
12--- a/src/etc/edac.init.in
13+++ b/src/etc/edac.init.in
14@@ -42,7 +42,6 @@ for dir in "$sysconfdir/default" "$sysconfdir/sysconfig"; do
15 [ -f "$dir/$SERVICE" ] && . "$dir/$SERVICE"
16 done
17
18-
19 ###############################################################################
20
21 service_start ()
22@@ -52,6 +51,46 @@ service_start ()
23 # Assume that if EDAC_DRIVER is not set, then EDAC is configured
24 # automatically, thus return successfully, but don't do anything.
25 #
26+ if [ ! -f /etc/edac/edac-driver ]; then
27+ [ -d /sys/bus/edac/devices/mc/mc0 ] && \
28+ echo `lsmod | grep _edac | cut -d" " -f1` > /etc/edac/edac-driver
29+ fi
30+
31+ [ -f /etc/edac/edac-driver ] && EDAC_DRIVER=`cat /etc/edac/edac-driver`
32+
33+ if [ -z "$EDAC_DRIVER" ]; then
34+
35+ DRIVER_PATH=/lib/modules/`uname -r`/kernel/drivers/edac
36+ oldpath=`pwd`
37+ if [ -d $DRIVER_PATH ]; then
38+
39+ cd $DRIVER_PATH
40+
41+ for i in $(/bin/ls | /usr/bin/cut -d. -f1) ; do
42+ /sbin/modprobe $i 2>/dev/null
43+ if [ -d /sys/bus/edac/devices/mc/mc0 ]; then
44+ echo $i> /etc/edac/edac-driver
45+ EDAC_DRIVER=$i
46+ break
47+ fi
48+ /sbin/modprobe -r $i 2>/dev/null
49+ done
50+
51+ cd "$oldpath"
52+
53+
54+ if [ -z "$EDAC_DRIVER" ]; then
55+ echo "This board may not support EDAC, or EDAC module may not be compiled in"
56+ exit
57+ fi
58+
59+ else
60+ echo "This board may not support EDAC, or EDAC module may not be compiled in"
61+ exit
62+ fi
63+
64+ fi
65+
66 if [ -n "$EDAC_DRIVER" ]; then
67 echo -n "Starting ${SERVICE}: "
68 modprobe $EDAC_DRIVER
69@@ -76,12 +115,15 @@ service_start ()
70 service_stop ()
71 {
72 echo -n "Disabling ${SERVICE}: "
73+
74+ [ -f /etc/edac/edac-driver ] && EDAC_DRIVER=`cat /etc/edac/edac-driver`
75+
76 if [ -n "$EDAC_DRIVER" ]; then
77 modprobe -r $EDAC_DRIVER
78 STATUS=$?
79 [ $STATUS -eq 0 ] && echo success || echo failure
80 else
81- echo "Not supported for this configuration."
82+ echo "Not supported for this configuration, or EDAC Module is not loaded."
83 STATUS=6
84 fi
85 }
86@@ -92,6 +134,9 @@ service_status ()
87 {
88 # Print the current status of the service. Required by LSB.
89 #
90+ [ -f /etc/edac/edac-driver ] && EDAC_DRIVER=`cat /etc/edac/edac-driver`
91+ [ -z "$EDAC_DRIVER" ] && STATUS=1 && exit
92+
93 edac-ctl --status
94 STATUS=0
95 }
96--
971.7.10.4
98