Skip to content

Commit

Permalink
user/tuned: new package
Browse files Browse the repository at this point in the history
  • Loading branch information
tulilirockz committed Sep 19, 2024
1 parent 407aa7e commit c0aa2dc
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 0 deletions.
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")

0 comments on commit c0aa2dc

Please sign in to comment.