diff options
author | Kai Kang <kai.kang@windriver.com> | 2015-12-02 17:51:40 +0800 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2015-12-18 12:42:08 +0100 |
commit | 49e6d6103e35e1646674c6fd7e70c387b1b127b4 (patch) | |
tree | c263109e50beb42f4bf3bed9d66a892b57f5b71b /meta-oe | |
parent | 30f03b584a0ef569c5a431e66a6d910246dd2d4f (diff) | |
download | meta-openembedded-49e6d6103e35e1646674c6fd7e70c387b1b127b4.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>
Diffstat (limited to 'meta-oe')
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" | |||
2 | HOMEPAGE = "https://github.com/grondo/edac-utils" | 2 | HOMEPAGE = "https://github.com/grondo/edac-utils" |
3 | SECTION = "Applications/System" | 3 | SECTION = "Applications/System" |
4 | LICENSE = "GPLv2" | 4 | LICENSE = "GPLv2" |
5 | LIC_FILES_CHKSUM = "file://COPYING;beginline=1;endline=2;md5=1fbd81241fe252ec0f5658a521ab7dd8" | 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" |
6 | 6 | ||
7 | DEPENDS = " sysfsutils" | 7 | DEPENDS = " sysfsutils" |
8 | 8 | ||
@@ -11,7 +11,10 @@ PV = "0.16+git${SRCPV}" | |||
11 | 11 | ||
12 | S = "${WORKDIR}/git" | 12 | S = "${WORKDIR}/git" |
13 | 13 | ||
14 | SRC_URI = "git://github.com/grondo/edac-utils;protocol=http" | 14 | SRC_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 | ||
16 | inherit autotools-brokensep | 19 | inherit autotools-brokensep |
17 | 20 | ||
@@ -20,6 +23,12 @@ do_configure_prepend () { | |||
20 | ${S}/bootstrap | 23 | ${S}/bootstrap |
21 | } | 24 | } |
22 | 25 | ||
23 | COMPATIBLE_HOST = '(x86_64.*|i.86.*)-linux' | 26 | RDEPENDS_${PN}_x86 = "dmidecode" |
24 | 27 | RDEPENDS_${PN}_x86-64 = "dmidecode" | |
25 | RDEPENDS_${PN} = " perl" | 28 | RDEPENDS_${PN}_arm = "dmidecode" |
29 | RDEPENDS_${PN}_aarch64 = "dmidecode" | ||
30 | RDEPENDS_${PN}_powerpc = "dmidecode" | ||
31 | RDEPENDS_${PN}_powerpc64 = "dmidecode" | ||
32 | RDEPENDS_${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 @@ | |||
1 | From 3ade837f64de0cfe2aed5bc52f7919760f350531 Mon Sep 17 00:00:00 2001 | ||
2 | From: Wenzong Fan <wenzong.fan@windriver.com> | ||
3 | Date: Fri, 7 Mar 2014 00:57:12 -0500 | ||
4 | Subject: [PATCH] edac: add restart to initscript | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Signed-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 | |||
13 | diff --git a/src/etc/edac.init.in b/src/etc/edac.init.in | ||
14 | index 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 | -- | ||
32 | 1.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 @@ | |||
1 | make init script be able to automatically load EDAC module. | ||
2 | |||
3 | Upstream-Status: Inappropriate [embedded specific] | ||
4 | |||
5 | Signed-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 | |||
10 | diff --git a/src/etc/edac.init.in b/src/etc/edac.init.in | ||
11 | index 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 | -- | ||
97 | 1.7.10.4 | ||
98 | |||