diff options
author | Armin Kuster <akuster808@gmail.com> | 2017-10-26 14:19:17 -0700 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2018-03-01 16:10:37 -0800 |
commit | 50759d254a16165f070807fb992815319b97dddd (patch) | |
tree | 7d96a4062534638aefaedd9086acb7b826413cc8 /meta-oe/recipes-bsp | |
parent | 40877b12448e98fa9d7df65c264f00ab6a16515f (diff) | |
download | meta-openembedded-50759d254a16165f070807fb992815319b97dddd.tar.gz |
edac-utils: move to recipes-bsp
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'meta-oe/recipes-bsp')
4 files changed, 188 insertions, 0 deletions
diff --git a/meta-oe/recipes-bsp/edac-utils/edac-utils_git.bb b/meta-oe/recipes-bsp/edac-utils/edac-utils_git.bb new file mode 100644 index 000000000..2c0914d30 --- /dev/null +++ b/meta-oe/recipes-bsp/edac-utils/edac-utils_git.bb | |||
@@ -0,0 +1,47 @@ | |||
1 | SUMMARY = "Userspace helper for Linux kernel EDAC drivers" | ||
2 | HOMEPAGE = "https://github.com/grondo/edac-utils" | ||
3 | SECTION = "Applications/System" | ||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" | ||
6 | |||
7 | DEPENDS = " sysfsutils" | ||
8 | |||
9 | SRCREV = "f9aa96205f610de39a79ff43c7478b7ef02e3138" | ||
10 | PV = "0.18+git${SRCPV}" | ||
11 | |||
12 | S = "${WORKDIR}/git" | ||
13 | |||
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 | file://edac.service \ | ||
18 | " | ||
19 | |||
20 | inherit autotools-brokensep systemd | ||
21 | |||
22 | do_configure_prepend () { | ||
23 | touch ${S}/ChangeLog | ||
24 | ${S}/bootstrap | ||
25 | } | ||
26 | |||
27 | RDEPENDS_${PN}_x86 = "dmidecode" | ||
28 | RDEPENDS_${PN}_x86-64 = "dmidecode" | ||
29 | RDEPENDS_${PN}_arm = "dmidecode" | ||
30 | RDEPENDS_${PN}_aarch64 = "dmidecode" | ||
31 | RDEPENDS_${PN}_powerpc = "dmidecode" | ||
32 | RDEPENDS_${PN}_powerpc64 = "dmidecode" | ||
33 | RDEPENDS_${PN}_append = " \ | ||
34 | perl-module-file-basename perl-module-file-find perl-module-getopt-long perl-module-posix \ | ||
35 | perl-module-overload \ | ||
36 | perl-module-overloading \ | ||
37 | perl-module-file-glob \ | ||
38 | " | ||
39 | |||
40 | do_install_append() { | ||
41 | install -d ${D}${systemd_unitdir}/system | ||
42 | install -m 644 ${WORKDIR}/edac.service ${D}/${systemd_unitdir}/system | ||
43 | sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}/${systemd_unitdir}/system/edac.service | ||
44 | } | ||
45 | |||
46 | SYSTEMD_SERVICE_${PN} = "edac.service" | ||
47 | SYSTEMD_AUTO_ENABLE_${PN} = "disable" | ||
diff --git a/meta-oe/recipes-bsp/edac-utils/files/add-restart-to-initscript.patch b/meta-oe/recipes-bsp/edac-utils/files/add-restart-to-initscript.patch new file mode 100644 index 000000000..87051da90 --- /dev/null +++ b/meta-oe/recipes-bsp/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-bsp/edac-utils/files/edac.service b/meta-oe/recipes-bsp/edac-utils/files/edac.service new file mode 100644 index 000000000..f6b211e91 --- /dev/null +++ b/meta-oe/recipes-bsp/edac-utils/files/edac.service | |||
@@ -0,0 +1,10 @@ | |||
1 | [Unit] | ||
2 | Description=Initialize EDAC Drivers For Machine Hardware | ||
3 | |||
4 | [Service] | ||
5 | Type=oneshot | ||
6 | ExecStart=@SBINDIR@/edac-ctl --register-labels | ||
7 | RemainAfterExit=yes | ||
8 | |||
9 | [Install] | ||
10 | WantedBy=multi-user.target | ||
diff --git a/meta-oe/recipes-bsp/edac-utils/files/make-init-script-be-able-to-automatically-load-EDAC-.patch b/meta-oe/recipes-bsp/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-bsp/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 | |||