From 190f21fe32b4be430bb6da28edead3fb45ebdb68 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Fri, 5 Feb 2021 03:18:16 +0100 Subject: [PATCH] Add system files to set up group access for performance mode Add a sysusers.d file to create a 'surface-control' group as well as udev rules to change the group ownership of the sysfs 'perf_mode' attribute to that group. This group can then be used to change the performance mode without sudo. --- etc/sysusers/surface-control.conf | 1 + etc/udev/40-surface-control.rules | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 etc/sysusers/surface-control.conf create mode 100644 etc/udev/40-surface-control.rules diff --git a/etc/sysusers/surface-control.conf b/etc/sysusers/surface-control.conf new file mode 100644 index 0000000..4613fcb --- /dev/null +++ b/etc/sysusers/surface-control.conf @@ -0,0 +1 @@ +g surface-control - - diff --git a/etc/udev/40-surface-control.rules b/etc/udev/40-surface-control.rules new file mode 100644 index 0000000..db90d63 --- /dev/null +++ b/etc/udev/40-surface-control.rules @@ -0,0 +1,2 @@ +KERNEL=="01:03:01:00:01", SUBSYSTEM=="surface_aggregator", RUN+="/usr/bin/chmod 664 /sys/bus/surface_aggregator/devices/01:03:01:00:01/perf_mode" +KERNEL=="01:03:01:00:01", SUBSYSTEM=="surface_aggregator", RUN+="/usr/bin/chown root:surface-control /sys/bus/surface_aggregator/devices/01:03:01:00:01/perf_mode"