Skip to contentSkip to conversation

edac-utils: add systemd init script for edac

PATCH In review Dengke Du 1 participant 2 messages Sep 28, 2016

lore
Share & tools
lore

Dengke Du

author
#0 lore raw

PATCH 1/1 edac-utils: add systemd init script for edac

In order to add the systemd init script for edac, we need to add some perl module to make sure the correct startup.

(LOCAL REV: NOT UPSTREAM) -- Send to meta-openembedded 20160928

---
 meta-oe/recipes-support/edac-utils/edac-utils_git.bb  | 14 +++++++++++++-
 meta-oe/recipes-support/edac-utils/files/edac.service | 11 +++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-support/edac-utils/files/edac.service
meta-oe/recipes-support/edac-utils/edac-utils_git.bb +13 -1
index c0ad665..b3ff1cc 100644
@@ -14,9 +14,10 @@ S = "${WORKDIR}/git"
 SRC_URI = "git://github.com/grondo/edac-utils \
     file://make-init-script-be-able-to-automatically-load-EDAC-.patch \
     file://add-restart-to-initscript.patch \
+    file://edac.service \
 "
 
-inherit autotools-brokensep
+inherit autotools-brokensep systemd
 
 do_configure_prepend () {
     touch ${S}/ChangeLog
@@ -31,4 +32,15 @@ RDEPENDS_${PN}_powerpc = "dmidecode"
 RDEPENDS_${PN}_powerpc64 = "dmidecode"
 RDEPENDS_${PN}_append = " \
     perl-module-file-basename perl-module-file-find perl-module-getopt-long perl-module-posix \
+    perl-module-overload \
+    perl-module-overloading \
+    perl-module-file-glob \
 "
+
+do_install_append() {
+	install -d ${D}${systemd_unitdir}/system
+	install -m 644 ${WORKDIR}/edac.service ${D}/${systemd_unitdir}/system
+	sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}/${systemd_unitdir}/system/edac.service
+}
+
+SYSTEMD_SERVICE_${PN} = "edac.service"
meta-oe/recipes-support/edac-utils/files/edac.service new file +11 -0
new file mode 100644
index 0000000..9f687a8
@@ -0,0 +1,11 @@
+[Unit]
+Description=Initialize EDAC Drivers For Machine Hardware
+
+[Service]
+Type=oneshot
+ExecStart=@SBINDIR@/edac-ctl --register-labels
+ExecStop=@SBINDIR@/edac-ctl --unload
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
Signature · 1 line
2.7.4
author
#1 lore raw

Please ignore!

Thanks

//Dengke

Quoted 61 lines · Dengke Du

In order to add the systemd init script for edac, we need to add some perl module to make sure the correct startup.

(LOCAL REV: NOT UPSTREAM) -- Send to meta-openembedded 20160928

---
  meta-oe/recipes-support/edac-utils/edac-utils_git.bb  | 14 +++++++++++++-
  meta-oe/recipes-support/edac-utils/files/edac.service | 11 +++++++++++
  2 files changed, 24 insertions(+), 1 deletion(-)

create mode 100644 meta-oe/recipes-support/edac-utils/files/edac.service

meta-oe/recipes-support/edac-utils/edac-utils_git.bb +13 -1
index c0ad665..b3ff1cc 100644
@@ -14,9 +14,10 @@ S = "${WORKDIR}/git"
  SRC_URI = "git://github.com/grondo/edac-utils \
      file://make-init-script-be-able-to-automatically-load-EDAC-.patch \
      file://add-restart-to-initscript.patch \
+    file://edac.service \
  "
 
-inherit autotools-brokensep
+inherit autotools-brokensep systemd
 
  do_configure_prepend () {
      touch ${S}/ChangeLog
@@ -31,4 +32,15 @@ RDEPENDS_${PN}_powerpc = "dmidecode"
  RDEPENDS_${PN}_powerpc64 = "dmidecode"
  RDEPENDS_${PN}_append = " \
      perl-module-file-basename perl-module-file-find perl-module-getopt-long perl-module-posix \
+    perl-module-overload \
+    perl-module-overloading \
+    perl-module-file-glob \
  "
+
+do_install_append() {
+	install -d ${D}${systemd_unitdir}/system
+	install -m 644 ${WORKDIR}/edac.service ${D}/${systemd_unitdir}/system
+	sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}/${systemd_unitdir}/system/edac.service
+}
+
+SYSTEMD_SERVICE_${PN} = "edac.service"
meta-oe/recipes-support/edac-utils/files/edac.service new file +11 -0
new file mode 100644
index 0000000..9f687a8
@@ -0,0 +1,11 @@
+[Unit]
+Description=Initialize EDAC Drivers For Machine Hardware
+
+[Service]
+Type=oneshot
+ExecStart=@SBINDIR@/edac-ctl --register-labels
+ExecStop=@SBINDIR@/edac-ctl --unload
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target