Skip to content

Commit

Permalink
Initial version, seems to work on Fedora 17.
Browse files Browse the repository at this point in the history
  • Loading branch information
pwnall committed May 6, 2012
0 parents commit 1165752
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
DESTDIR?=/usr

permissions:
chmod 755 src/radeonhd-power
chmod 644 src/radeonhd-power.service

install:
install --mode=u=rw-x,go=-rwx,a-s src/radeonhd-power.service ${DESTDIR}/lib/systemd/system/
install src/radeonhd-power ${DESTDIR}/bin/
31 changes: 31 additions & 0 deletions src/radeonhd-power
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh

method_file="/sys/class/drm/card0/device/power_method"
profile_file="/sys/class/drm/card0/device/power_profile"

if [ ! -f $method_file ] || [ ! -f $profile_file ]; then
echo "Your system does not appear to have the RadeonHD drivers installed."
exit 1
fi

if [ ! -w $method_file ] || [ ! -w $profile_file ]; then
echo "You can't write to sysfs. Try using sudo."
exit 1
fi

if [ $1 == '--help' ]; then
echo "Configures the RadeonHD open-source driver's power management."
echo "Usage:"
echo " $0 [low|med|high|dynamic]"
echo ""
echo "By default, the power saving mode is set to dynamic."
echo ""
exit 0
fi

if [ -z $1 ] || [ $1 == "dynamic" ]; then
echo dynpm > $method_file
else
echo profile > $method_file
echo $1 > $profile_file
fi
12 changes: 12 additions & 0 deletions src/radeonhd-power.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=OpenSSH server daemon
After=syslog.target network.target auditd.service

[Service]
EnvironmentFile=/etc/sysconfig/sshd
ExecStartPre=/usr/sbin/sshd-keygen
ExecStart=/usr/sbin/sshd -D $OPTIONS
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=graphical.target

0 comments on commit 1165752

Please sign in to comment.