Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

user/tuned: new package #2952

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions user/python-linux-procfs/template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
pkgname = "python-linux-procfs"
pkgver = "0.7.3"
pkgrel = 0
build_style = "python_pep517"
hostmakedepends = [
"python-build",
"python-installer",
"python-setuptools",
]
depends = [
"python-six",
]
pkgdesc = "Python bindings for the linux procfs filesystem"
maintainer = "tulilirockz <tulilirockz@outlook.com>"
license = "GPL-2.0-only"
url = "https://git.kernel.org/pub/scm/libs/python/python-linux-procfs/python-linux-procfs.git"
source = f"{url}/snapshot/python-linux-procfs-{pkgver}.tar.gz"
sha256 = "a8750f07f6b1a4c1cda6c50a33af9dc92a1a9c6cf538fd269c0db8d4c93d8ede"
# check: test is invalid using pytest
options = ["!check"]
3 changes: 3 additions & 0 deletions user/tuned/files/tuned
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type = process
command = /usr/bin/tuned
depends-on = local.target
3 changes: 3 additions & 0 deletions user/tuned/files/tuned-ppd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type = process
command = /usr/bin/tuned-ppd
depends-on = local.target
11 changes: 11 additions & 0 deletions user/tuned/patches/bsdsed.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/Makefile 2024-09-17 17:42:29.176715156 -0300
+++ b/Makefile 2024-09-17 17:47:13.423932661 -0300
@@ -53,7 +53,7 @@
BASH_COMPLETIONS = $(DATADIR)/bash-completion/completions

copy_executable = install -Dm 0755 $(1) $(2)
-rewrite_shebang = sed -i -r -e $(SHEBANG_REWRITE_REGEX) $(1)
+rewrite_shebang = sed -i "" -r -e $(SHEBANG_REWRITE_REGEX) $(1)
restore_timestamp = touch -r $(1) $(2)
install_python_script = $(call copy_executable,$(1),$(2)) \
&& $(call rewrite_shebang,$(2)) && $(call restore_timestamp,$(1),$(2));
11 changes: 11 additions & 0 deletions user/tuned/patches/install.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/Makefile 2024-09-17 14:32:25.679368793 -0300
+++ b/Makefile 2024-09-17 14:33:07.494989958 -0300
@@ -165,7 +165,7 @@
echo -n > $(DESTDIR)$(SYSCONFDIR)/tuned/profile_mode
echo -n > $(DESTDIR)$(SYSCONFDIR)/tuned/post_loaded_profile
install -Dpm 0644 bootcmdline $(DESTDIR)$(SYSCONFDIR)/tuned/bootcmdline
- install -Dpm 0644 modules.conf $(DESTDIR)$(SYSCONFDIR)/modprobe.d/tuned.conf
+ install -Dpm 0644 modules.conf $(DESTDIR)/usr/lib/modprobe.d/tuned.conf

# profiles & system config
cp -a profiles/* $(DESTDIR)$(TUNED_PROFILES_DIR)/
31 changes: 31 additions & 0 deletions user/tuned/patches/no-gui.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
--- a/Makefile 2024-08-07 17:09:40.000000000 -0300
+++ b/Makefile 2024-09-19 14:26:22.790244522 -0300
@@ -146,15 +146,12 @@
# binaries
$(call install_python_script,tuned.py,$(DESTDIR)/usr/sbin/tuned)
$(call install_python_script,tuned-adm.py,$(DESTDIR)/usr/sbin/tuned-adm)
- $(call install_python_script,tuned-gui.py,$(DESTDIR)/usr/sbin/tuned-gui)

$(foreach file, diskdevstat netdevstat scomes, \
install -Dpm 0755 systemtap/$(file) $(DESTDIR)/usr/sbin/$(notdir $(file));)
$(call install_python_script, \
systemtap/varnetload, $(DESTDIR)/usr/sbin/varnetload)

- # glade
- install -Dpm 0644 tuned-gui.glade $(DESTDIR)$(DATADIR)/tuned/ui/tuned-gui.glade

# tools
$(call install_python_script, \
@@ -221,12 +218,7 @@
$(call install_python_script, \
$(file), $(DESTDIR)/usr/libexec/tuned/$(notdir $(file))))

- # icon
- install -Dpm 0644 icons/tuned.svg $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/apps/tuned.svg

- # desktop file
- install -dD $(DESTDIR)$(DATADIR)/applications
- desktop-file-install --dir=$(DESTDIR)$(DATADIR)/applications tuned-gui.desktop

install-ppd: install
$(call install_python_script,tuned-ppd.py,$(DESTDIR)/usr/sbin/tuned-ppd)
10 changes: 10 additions & 0 deletions user/tuned/patches/no-systemtap.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- a/Makefile 2024-09-17 18:02:01.204836491 -0300
+++ b/Makefile 2024-09-17 18:02:15.591686531 -0300
@@ -148,8 +148,6 @@
$(call install_python_script,tuned-adm.py,$(DESTDIR)/usr/sbin/tuned-adm)
$(call install_python_script,tuned-gui.py,$(DESTDIR)/usr/sbin/tuned-gui)

- $(foreach file, diskdevstat netdevstat scomes, \
- install -Dpm 0755 systemtap/$(file) $(DESTDIR)/usr/sbin/$(notdir $(file));)
$(call install_python_script, \
systemtap/varnetload, $(DESTDIR)/usr/sbin/varnetload)
20 changes: 20 additions & 0 deletions user/tuned/patches/systemd.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--- a/Makefile 2024-08-07 17:09:40.000000000 -0300
+++ a/Makefile 2024-09-19 14:25:08.566481285 -0300
@@ -192,8 +192,6 @@
# runtime directory
install -Dpm 0644 tuned.tmpfiles $(DESTDIR)$(TMPFILESDIR)/tuned.conf

- # systemd units
- install -Dpm 0644 tuned.service $(DESTDIR)$(UNITDIR)/tuned.service

# dbus configuration
install -Dpm 0644 dbus.conf $(DESTDIR)$(DATADIR)/dbus-1/system.d/com.redhat.tuned.conf
@@ -230,7 +228,6 @@

install-ppd: install
$(call install_python_script,tuned-ppd.py,$(DESTDIR)/usr/sbin/tuned-ppd)
- install -Dpm 0644 tuned/ppd/tuned-ppd.service $(DESTDIR)$(UNITDIR)/tuned-ppd.service
install -Dpm 0644 tuned/ppd/tuned-ppd.dbus.service $(DESTDIR)$(DATADIR)/dbus-1/system-services/net.hadess.PowerProfiles.service
install -Dpm 0644 tuned/ppd/dbus.conf $(DESTDIR)$(DATADIR)/dbus-1/system.d/net.hadess.PowerProfiles.conf
install -Dpm 0644 tuned/ppd/tuned-ppd.policy $(DESTDIR)$(DATADIR)/polkit-1/actions/net.hadess.PowerProfiles.policy

30 changes: 30 additions & 0 deletions user/tuned/template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
pkgname = "tuned"
pkgver = "2.24.0"
pkgrel = 0
build_style = "makefile"
make_install_target = "install-ppd"
hostmakedepends = ["pkgconf", "python"]
depends = ["python-dbus", "python-linux-procfs", "virt-what"]
pkgdesc = "Daemon for monitoring and adaptive tuning of system devices"
maintainer = "tulilirockz <tulilirockz@outlook.com>"
license = "GPL-2.0-only"
url = "https://github.com/redhat-performance/tuned"
source = f"{url}/archive/refs/tags/v{pkgver}.tar.gz"
sha256 = "0f4a72c89772deb8a4e572df70ee3967ba33c1351096a6e87d67674f72830e0e"
# check: tests are broken due to no device binding to cbuild container
options = ["!check"]


def pre_install(self):
self.install_dir("usr/bin")
self.install_link("usr/sbin", "bin")


def post_install(self):
self.uninstall("usr/sbin")
self.install_service(self.files_path / "tuned")
self.install_service(self.files_path / "tuned-ppd")
# GUI depends on systemctl / service CLIs to interact with tuned
# these depends on systemtap
for uninstalled in ["tuned-gui", "diskdevstat", "netdevstat", "scomes"]:
self.uninstall(f"usr/share/man/man8/{uninstalled}.8")
13 changes: 13 additions & 0 deletions user/virt-what/template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
pkgname = "virt-what"
pkgver = "1.27"
pkgrel = 0
build_style = "gnu_configure"
hostmakedepends = ["automake"]
pkgdesc = "Script for getting host virtual-machine context"
maintainer = "tulilirockz <tulilirockz@outlook.com>"
license = "GPL-2.0-only"
url = "https://people.redhat.com/~rjones/virt-what"
source = f"{url}/files/virt-what-{pkgver}.tar.gz"
sha256 = "d4d9bd9d4ae59095597443fac663495315c7eb4330b872aa5f062df38ac69bf1"
# check: tests depend on kvm kernel module (and other modules)
options = ["!check"]