Advertisement
Guest User

stuff for /etc/rc.local on Banana Pi

a guest
Nov 11th, 2014
710
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.39 KB | None | 0 0
  1. # cpu frequency
  2. echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
  3. echo 600000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
  4. echo 1008000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
  5. # echo -n 1200000 >/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
  6. echo 25 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
  7. echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
  8. echo 1 > /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
  9.  
  10. # assign all network IRQs to second CPU core
  11. echo 2 >/proc/irq/$(awk -F":" '/eth0/ {print $1}' </proc/interrupts)/smp_affinity
  12.  
  13. # adjust network parameters for LAN usage
  14. sysctl -w net/core/rmem_max=8738000
  15. sysctl -w net/core/wmem_max=6553600
  16. sysctl -w net/ipv4/tcp_rmem="8192 873800 8738000"
  17. sysctl -w net/ipv4/tcp_wmem="4096 655360 6553600"
  18. sysctl -w vm/min_free_kbytes=65536
  19. ip link set eth0 txqueuelen 10000
  20.  
  21. # load sunxi_dbgreg.ko module to read out A20's thermal sensors
  22. grep -q sunxi_dbgreg </proc/modules || modprobe sunxi-dbgreg
  23.  
  24. # start temperature measurement daemon
  25. nohup /usr/local/bin/temp-daemon.sh &
  26.  
  27. # fun stuff for the green led on the board -- choose/uncomment only one and
  28. # have a look at http://forum.lemaker.org/thread-1057-4-1-4.html for details
  29.  
  30. # switch off green led on Banana Pi
  31. echo none > /sys/class/leds/green\:ph24\:led1/trigger
  32.  
  33. # show activity of CPU0
  34. # echo cpu0 >/sys/class/leds/green\:ph24\:led1/trigger
  35.  
  36. # turn on green led when there's disk access (requires sysstat package):
  37. # iostat -z -d 1 sda | sed -u -e '1d' -e 's/Device.*/none/' -e 's/sd.*/timer/' -e '/^$/d' >/sys/class/leds/green\:ph24\:led1/trigger &
  38.  
  39. # use green led to show CPU's %idle state (above 90% no led, 50-89% slow
  40. # flashing, 10-49% faster flashing, idle below 10% constant led light):
  41. # iostat -c 1 | sed -u -e '1d' -e 's/avg-cpu.*//' -e '/^$/d' -e 's/^.\{1,50\}//' -e 's/[0,9].*/none/' -e 's/[5-8].*/timer/' -e 's/[1-4].*/heartbeat/' -e 's/\ .*/default-on/' >/sys/class/leds/green\:ph24\:led1/trigger &
  42.  
  43. # use green led to show I/O bottlenecks based on the iowait percentage
  44. # (below 10% no led, 10%-19% slow blinking, 20%-49% fast blinking,
  45. # 50% or above: constant led light):
  46. # iostat -c 1 | sed -u -e '1d' -e 's/avg-cpu.*//' -e '/^$/d' -e 's/^.\{1,34\}//' -e 's/[0,5-9].*/default-on/' -e 's/1.*/timer/' -e 's/[2-4].*/heartbeat/' -e 's/\ .*/none/' >/sys/class/leds/green\:ph24\:led1/trigger &
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement