-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The newer Ryzen controller does not like to be run as root (sandbox complain). Better run the application as a normal user and let the user space binary run as root if launched via the ryzen controller app and user bellongs to the ryzenadj group.
- Loading branch information
Showing
8 changed files
with
206 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
abi <abi/3.0>, | ||
|
||
include <tunables/global> | ||
|
||
/usr/bin/ryzenadj flags=(enforce) { | ||
include <abstractions/base> | ||
include <abstractions/consoles> | ||
include <abstractions/nameservice> | ||
include if exists <local/usr.bin.ryzenadj> | ||
|
||
capability sys_admin, | ||
capability sys_rawio, | ||
|
||
# Needed for some files in /proc see | ||
# https://gitlab.com/apparmor/apparmor/-/wikis/TechnicalDoc_Proc_and_ptrace#apparmor-3-with-ptrace-rules | ||
# https://bugs.launchpad.net/ubuntu/+source/gpsd/+bug/1872175 | ||
capability sys_ptrace, | ||
ptrace read peer=unconfined, | ||
|
||
/etc/ld.so.cache r, | ||
/lib/@{multiarch}/ld-*.so* mr, | ||
/lib/@{multiarch}/libc-*.so* mr, | ||
/lib/@{multiarch}/libgcc_s.so* mr, | ||
/lib/@{multiarch}/libld-*.so* mr, | ||
/lib/libgcc_s.so* mr, | ||
/lib{,32,64}/ld-*.so* mr, | ||
/lib{,32,64}/libc-*.so* mr, | ||
/lib{,32,64}/libld-*.so* mr, | ||
/usr/bin/ryzenadj mr, | ||
/usr/lib/@{multiarch}/libpci.so* mr, | ||
/usr/lib/@{multiarch}/libudev.so* mr, | ||
/usr/lib/@{multiarch}/libz.so* mr, | ||
/usr/lib/libpci.so* mr, | ||
/usr/lib/libudev.so* mr, | ||
/usr/lib/libz.so* mr, | ||
@{PROC}/ r, | ||
@{PROC}/[0-9]*/ r, | ||
@{PROC}/[0-9]*/exe r, | ||
|
||
@{sys}/kernel/ryzen_smu_drv/pm_table r, | ||
/dev/mem r, | ||
|
||
@{sys}/devices/pci0000:00/0000:00:00.0/class r, | ||
@{sys}/devices/pci0000:00/0000:00:00.0/config rw, | ||
@{sys}/devices/pci0000:00/0000:00:00.0/device r, | ||
@{sys}/devices/pci0000:00/0000:00:00.0/resource r, | ||
@{sys}/devices/pci0000:00/0000:00:00.0/vendor r, | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ Maintainer: Johan Källström <[email protected]> | |
Uploaders: Johan Källström <[email protected]>, | ||
Build-Depends: cmake (>= 3.0~), | ||
debhelper-compat (= 13), | ||
dh-apparmor, | ||
libpci-dev | ||
Standards-Version: 4.6.0 | ||
Homepage: https://github.com/FlyGoat/RyzenAdj/ | ||
|
@@ -18,6 +19,7 @@ Architecture: any | |
Depends: ${misc:Depends}, | ||
${shlibs:Depends}, | ||
libryzenadj0 (= ${binary:Version}), | ||
Pre-Depends: adduser (>= 3.11), | ||
Description: Adjust power management settings for Ryzen Mobile Processors. | ||
This is a commandline tool that allows you to adjust power management | ||
settings for Ryzen Mobile Processors. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
usr/bin/ryzenadj | ||
debian/apparmor/usr.bin.ryzenadj etc/apparmor.d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
# postinst script for #PACKAGE# | ||
|
||
case "$1" in | ||
configure) | ||
# Set setuid root on usr/bin/ryzenadj | ||
chmod u+s /usr/bin/ryzenadj || ( echo 'Error: failed to setuid root on usr/bin/ryzenadj' >&2 ) | ||
;; | ||
|
||
*) | ||
;; | ||
esac | ||
|
||
#DEBHELPER# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
# preinst script for #PACKAGE# | ||
set -e | ||
RYZENADJ_GROUP=ryzenadj | ||
|
||
case "$1" in | ||
install|upgrade) | ||
# create group for authenticating users. | ||
if ! getent group $RYZENADJ_GROUP 2>&1 >/dev/null ; then | ||
echo "Adding group $RYZENADJ_GROUP.." | ||
addgroup --quiet --system $RYZENADJ_GROUP | ||
fi | ||
;; | ||
*) | ||
;; | ||
esac | ||
|
||
#DEBHELPER# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters