summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2021-08-02 04:00:14 +0100
committerSam James <sam@gentoo.org>2021-08-02 04:17:09 +0100
commitafcc82fb9728ae744ad890e54a4c1b60145d64fa (patch)
treee30aac330ba0e8336744d72b49ed7fd1e353e5aa /sys-apps/edac-utils
parentsys-apps/edac-utils: update EAPI 5 -> 7 (diff)
downloadgentoo-afcc82fb9728ae744ad890e54a4c1b60145d64fa.tar.gz
gentoo-afcc82fb9728ae744ad890e54a4c1b60145d64fa.tar.bz2
gentoo-afcc82fb9728ae744ad890e54a4c1b60145d64fa.zip
sys-apps/edac-utils: install init script/systemd unit, CC fix
1) The previous revision mentioned udev but the udev rule was dropped upstream quite some time ago as it was found to be unreliable. We now install an init script and a systemd unit to load the edac rules. The simple systemd unit was nabbed from Fedora. 2) We now call eautoreconf in order to refesh libtool and friends to fix calling gcc directly. Closes: https://bugs.gentoo.org/725540 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sys-apps/edac-utils')
-rw-r--r--sys-apps/edac-utils/edac-utils-0.18-r1.ebuild53
-rw-r--r--sys-apps/edac-utils/files/edac.init16
-rw-r--r--sys-apps/edac-utils/files/edac.service11
3 files changed, 80 insertions, 0 deletions
diff --git a/sys-apps/edac-utils/edac-utils-0.18-r1.ebuild b/sys-apps/edac-utils/edac-utils-0.18-r1.ebuild
new file mode 100644
index 000000000000..b48d523eff5d
--- /dev/null
+++ b/sys-apps/edac-utils/edac-utils-0.18-r1.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools systemd
+
+DESCRIPTION="Userspace helper for Linux kernel EDAC drivers"
+HOMEPAGE="https://github.com/grondo/edac-utils"
+SRC_URI="https://github.com/grondo/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64"
+IUSE="debug"
+
+DEPEND="sys-fs/sysfsutils"
+RDEPEND="${DEPEND}
+ sys-apps/dmidecode"
+
+src_prepare() {
+ default
+
+ # Needed to refresh libtool and friends to not call CC directly
+ # bug #725540
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --disable-static \
+ $(use_enable debug)
+}
+
+src_install() {
+ default
+
+ # Dump the inappropriate-for-us bundled init script
+ rm -rf "${ED}/etc/init.d" || die
+
+ # Install our own
+ newinitd "${FILESDIR}"/edac.init edac
+ systemd_dounit "${FILESDIR}"/edac.service
+
+ find "${ED}" -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+ elog "There must be an entry for your mainboard in ${EROOT}/etc/edac/labels.db"
+ elog "in case you want nice labels in /sys/module/*_edac/"
+ elog "Run the following command to check whether such an entry is already available:"
+ elog " edac-ctl --print-labels"
+}
diff --git a/sys-apps/edac-utils/files/edac.init b/sys-apps/edac-utils/files/edac.init
new file mode 100644
index 000000000000..23318b37e10c
--- /dev/null
+++ b/sys-apps/edac-utils/files/edac.init
@@ -0,0 +1,16 @@
+#!/sbin/openrc-run
+# Copyright 2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+command=/usr/bin/edac-ctl
+
+start() {
+ ebegin "Registering edac-utils labels"
+ /usr/sbin/edac-ctl --register-labels
+ eend $?
+}
+
+stop() {
+ ebegin "Unregistering edac-utils labels"
+ /usr/sbin/edac-ctl --unload
+ eend $?
+}
diff --git a/sys-apps/edac-utils/files/edac.service b/sys-apps/edac-utils/files/edac.service
new file mode 100644
index 000000000000..b94a4b6b5443
--- /dev/null
+++ b/sys-apps/edac-utils/files/edac.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Initialize EDAC Drivers For Machine Hardware
+
+[Service]
+Type=oneshot
+ExecStart=/usr/sbin/edac-ctl --register-labels
+ExecStop=/usr/sbin/edac-ctl --unload
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target