Guest User

Untitled

a guest
Mar 20th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. > cd /sys/devices/system/cpu
  2.  
  3. > cat cpu0/cpufreq/scaling_available_governors
  4. conservative ondemand userspace powersave performance
  5.  
  6. > cat cpu0/cpufreq/scaling_governor
  7. ondemand
  8.  
  9. echo performance > cpu0/cpufreq/scaling_governor
  10.  
  11. sudo sh -c "echo performance > cpu0/cpufreq/scaling_governor"
  12.  
  13. #!/bin/sh
  14. ### BEGIN INIT INFO
  15. # Provides: raspi-config
  16. # Required-Start: udev mountkernfs $remote_fs
  17. # Required-Stop:
  18. # Default-Start: S
  19. # Default-Stop:
  20. # Short-Description: Switch to ondemand cpu governor (unless shift key is pressed)
  21. # Description:
  22. ### END INIT INFO
  23.  
  24. . /lib/lsb/init-functions
  25.  
  26. case "$1" in
  27. start)
  28. log_daemon_msg "Checking if shift key is held down"
  29. timeout 1 thd --dump /dev/input/event* | grep -q "LEFTSHIFT|RIGHTSHIFT"
  30. if [ $? -eq 0 ]; then
  31. printf " Yes. Not enabling ondemand scaling governor"
  32. log_end_msg 0
  33. else
  34. printf " No. Switching to ondemand scaling governor"
  35. SYS_CPUFREQ_GOVERNOR=/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor if [ -e $SYS_CPUFREQ_GOVERNOR ]; t
  36. hen
  37. echo "ondemand" > $SYS_CPUFREQ_GOVERNOR
  38. echo 50 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
  39. echo 100000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
  40. echo 50 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
  41. echo 1 | sudo tee /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
  42. fi
  43. log_end_msg 0
  44. fi
  45. ;;
  46. *)
  47. echo "Usage: $0 start" >&2
  48. exit 3
  49. ;;
  50. esac
Add Comment
Please, Sign In to add comment