[crux-commits] ports/contrib (3.6): rtkit: included polkit rule to allow a user to set realtime level

crux at crux.nu crux at crux.nu
Fri Jul 2 08:21:30 UTC 2021


commit 2c9b6de2a4abb43b0474a05fc9bcbd5e6726fc75
Author: Tim Biermann <tbier at posteo.de>
Date:   Fri Jul 2 07:30:19 2021 +0000

    rtkit: included polkit rule to allow a user to set realtime level

diff --git a/rtkit/.footprint b/rtkit/.footprint
index 01c1b8f1a..8d5bf79ca 100644
--- a/rtkit/.footprint
+++ b/rtkit/.footprint
@@ -1,4 +1,7 @@
 drwxr-xr-x	root/root	etc/
+drwxr-xr-x	root/root	etc/polkit-1/
+drwxr-xr-x	root/root	etc/polkit-1/rules.d/
+-rwxr-xr-x	root/root	etc/polkit-1/rules.d/60-rtkit.rules
 drwxr-xr-x	root/root	etc/rc.d/
 -rwxr-xr-x	root/root	etc/rc.d/rtkit
 drwxr-xr-x	root/root	usr/
diff --git a/rtkit/Pkgfile b/rtkit/Pkgfile
index 62769d4cb..e30b828a3 100644
--- a/rtkit/Pkgfile
+++ b/rtkit/Pkgfile
@@ -5,9 +5,9 @@
 
 name=rtkit
 version=0.13
-release=2
+release=3
 source=(https://github.com/heftig/rtkit/releases/download/v$version/$name-$version.tar.xz
-  rtkit.service org.freedesktop.RealtimeKit1.conf)
+  rtkit.service org.freedesktop.RealtimeKit1.conf rtkit.rules)
 
 build() {
   # allow rtkit group to own the service besides rtkit user and root
@@ -23,6 +23,7 @@ build() {
   DESTDIR=$PKG meson install -C build
 
   install -Dm755 $SRC/rtkit.service $PKG/etc/rc.d/rtkit
+  install -Dm755 $SRC/rtkit.rules $PKG/etc/polkit-1/rules.d/60-rtkit.rules
 
   rm -r $PKG/usr/lib/systemd
   rm -r $PKG/usr/share/dbus-1/system-services
diff --git a/rtkit/rtkit.rules b/rtkit/rtkit.rules
new file mode 100644
index 000000000..250495a9f
--- /dev/null
+++ b/rtkit/rtkit.rules
@@ -0,0 +1,6 @@
+polkit.addRule(function(action, subject) {
+    if (action.id == "org.freedesktop.RealtimeKit1.acquire-high-priority"
+     || action.id == "org.freedesktop.RealtimeKit1.acquire-real-time") {
+        return polkit.Result.YES;
+    }
+});


More information about the crux-commits mailing list