commit:     c74e7cf4220c1f0d398f2e60f33b1cf8e83d521a
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 15 02:31:45 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Dec 15 02:32:10 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c74e7cf4

sys-apps/irqbalance: backport fix for systemd journal noise

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../irqbalance-1.9.3-systemd-journal-noise.patch   | 21 ++++++
 sys-apps/irqbalance/irqbalance-1.9.3-r1.ebuild     | 78 ++++++++++++++++++++++
 2 files changed, 99 insertions(+)

diff --git 
a/sys-apps/irqbalance/files/irqbalance-1.9.3-systemd-journal-noise.patch 
b/sys-apps/irqbalance/files/irqbalance-1.9.3-systemd-journal-noise.patch
new file mode 100644
index 000000000000..7cf465f62e7d
--- /dev/null
+++ b/sys-apps/irqbalance/files/irqbalance-1.9.3-systemd-journal-noise.patch
@@ -0,0 +1,21 @@
+https://github.com/Irqbalance/irqbalance/issues/281
+https://github.com/Irqbalance/irqbalance/commit/f3282f4ddc10be44e6c423de6de8db600f748f85
+
+From f3282f4ddc10be44e6c423de6de8db600f748f85 Mon Sep 17 00:00:00 2001
+From: Neil Horman <[email protected]>
+Date: Thu, 30 Nov 2023 16:55:30 -0500
+Subject: [PATCH] filter console only output when using journal mode
+
+Fixes #281
+--- a/irqbalance.h
++++ b/irqbalance.h
+@@ -138,7 +138,8 @@ extern unsigned int log_mask;
+ #ifdef HAVE_LIBSYSTEMD
+ #define log(mask, lvl, fmt, args...) do {                                     
\
+       if (journal_logging) {                                                  
\
+-              sd_journal_print(lvl, fmt, ##args);                             
\
++        if (log_mask & mask & TO_SYSLOG) \
++            sd_journal_print(lvl, fmt, ##args);                       \
+               if (log_mask & mask & TO_CONSOLE)                               
\
+                       printf(fmt, ##args);                                    
\
+       } else {                                                                
\

diff --git a/sys-apps/irqbalance/irqbalance-1.9.3-r1.ebuild 
b/sys-apps/irqbalance/irqbalance-1.9.3-r1.ebuild
new file mode 100644
index 000000000000..ddb504106b0a
--- /dev/null
+++ b/sys-apps/irqbalance/irqbalance-1.9.3-r1.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools udev systemd linux-info optfeature
+
+DESCRIPTION="Distribute hardware interrupts across processors on a 
multiprocessor system"
+HOMEPAGE="https://github.com/Irqbalance/irqbalance";
+SRC_URI="https://github.com/Irqbalance/${PN}/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~x86"
+IUSE="caps +numa systemd selinux thermal tui"
+# Hangs
+RESTRICT="test"
+
+DEPEND="
+       dev-libs/glib:2
+       caps? ( sys-libs/libcap-ng )
+       numa? ( sys-process/numactl )
+       systemd? ( sys-apps/systemd:= )
+       thermal? ( dev-libs/libnl:3 )
+       tui? ( sys-libs/ncurses:=[unicode(+)] )
+"
+BDEPEND="
+       virtual/pkgconfig
+"
+RDEPEND="
+       ${DEPEND}
+       selinux? ( sec-policy/selinux-irqbalance )
+"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-systemd-journal-noise.patch
+)
+
+pkg_setup() {
+       CONFIG_CHECK="~PCI_MSI"
+       linux-info_pkg_setup
+}
+
+src_prepare() {
+       # Follow systemd policies
+       # https://wiki.gentoo.org/wiki/Project:Systemd/Ebuild_policy
+       sed \
+               -e 's/ $IRQBALANCE_ARGS//' \
+               -e '/EnvironmentFile/d' \
+               -i misc/irqbalance.service || die
+
+       default
+       eautoreconf
+}
+
+src_configure() {
+       local myeconfargs=(
+               $(use_with caps libcap-ng)
+               $(use_enable numa)
+               $(use_with systemd)
+               $(use_enable thermal)
+               $(use_with tui irqbalance-ui)
+       )
+       econf "${myeconfargs[@]}"
+}
+
+src_install() {
+       default
+
+       newinitd "${FILESDIR}"/irqbalance.init.4 irqbalance
+       newconfd "${FILESDIR}"/irqbalance.confd-1 irqbalance
+       systemd_dounit misc/irqbalance.service
+       udev_dorules misc/90-irqbalance.rules
+}
+
+pkg_postinst() {
+       optfeature "thermal events support (requires USE=thermal)" 
sys-power/thermald
+}

Reply via email to