File tree Expand file tree Collapse file tree 4 files changed +14
-3
lines changed Expand file tree Collapse file tree 4 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,11 @@ The simplest way to build it:
129
129
make
130
130
131
131
modify permissions for executing as root when started from Ryzen controller
132
- and user belongs to the ryzenadj group.
132
+ and user belongs to the ryzenadj group
133
+
134
+ setcap 'cap_sys_rawio=ep cap_dac_override=ep cap_sys_admin=ep' ./ryzenadj
135
+
136
+ or via the suid bit
133
137
134
138
sudo chow root:root ./ryzenadj
135
139
sudo chmod u+s ./ryzenadj
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ include <tunables/global>
10
10
11
11
capability sys_admin,
12
12
capability sys_rawio,
13
+ capability dac_override,
13
14
14
15
# Needed for some files in /proc see
15
16
# https://gitlab.com/apparmor/apparmor/-/wikis/TechnicalDoc_Proc_and_ptrace#apparmor-3-with-ptrace-rules
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ Depends: ${misc:Depends},
20
20
${shlibs:Depends},
21
21
libryzenadj0 (= ${binary:Version}),
22
22
Pre-Depends: adduser (>= 3.11),
23
+ libcap2-bin,
23
24
Description: Adjust power management settings for Ryzen Mobile Processors.
24
25
This is a commandline tool that allows you to adjust power management
25
26
settings for Ryzen Mobile Processors.
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
# postinst script for #PACKAGE#
3
3
4
+ BINARY=/usr/bin/ryzenadj
4
5
case " $1 " in
5
6
configure)
6
- # Set setuid root on usr/bin/ryzenadj
7
- chmod u+s /usr/bin/ryzenadj || ( echo ' Error: failed to setuid root on usr/bin/ryzenadj' >&2 )
7
+ if which setcap > /dev/null && setcap ' cap_sys_rawio=ep cap_dac_override=ep cap_sys_admin=ep' " $BINARY " ; then
8
+ echo " Set setcap on $BINARY successfull"
9
+ else
10
+ echo " Set setuid root on $BINARY "
11
+ chmod u+s " $BINARY " || ( echo " Error: failed to setuid root on $BINARY " >&2 )
12
+ fi
8
13
;;
9
14
10
15
* )
You can’t perform that action at this time.
0 commit comments