Advertisement
Guest User

Untitled

a guest
Jul 1st, 2013
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.69 KB | None | 0 0
  1.  #!/bin/bash
  2. if on_ac_power; then
  3. # Reset back to normal settings
  4. #Wireless Power Saving for interface wlan0 
  5. iw dev wlan0 set power_save off
  6. #Enable SATA link power management for /dev/sda
  7. echo 'min_power' > '/sys/class/scsi_host/host0/link_power_management_policy'
  8. #VM writeback timeout
  9. echo '1500' > '/proc/sys/vm/dirty_writeback_centisecs'
  10. #Enable Audio codec power management
  11. echo '1' > '/sys/module/snd_hda_intel/parameters/power_save'
  12. #Autosuspend for USB device DW375 Bluetooth Module [Dell Computer Corp]
  13. echo 'auto' > '/sys/bus/usb/devices/1-1.4/power/control'
  14. #Runtime PM for PCI Device NVIDIA Corporation GF108 High Definition Audio Controller
  15. echo 'auto' > '/sys/bus/pci/devices/0000:01:00.1/power/control'
  16. #Runtime PM for PCI Device O2 Micro, Inc. OZ600 1394a-2000 Controller
  17. echo 'auto' > '/sys/bus/pci/devices/0000:0b:00.0/power/control'
  18. #Runtime PM for PCI Device Intel Corporation 2nd Generation Core Processor Family DRAM Controller
  19. echo 'auto' > '/sys/bus/pci/devices/0000:00:00.0/power/control'
  20. #Runtime PM for PCI Device Intel Corporation 82579LM Gigabit Network Connection
  21. echo 'auto' > '/sys/bus/pci/devices/0000:00:19.0/power/control'
  22. #Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller
  23. echo 'auto' > '/sys/bus/pci/devices/0000:00:1b.0/power/control'
  24. #Runtime PM for PCI Device Intel Corporation Centrino Ultimate-N 6300
  25. echo 'auto' > '/sys/bus/pci/devices/0000:03:00.0/power/control'
  26. #Wake-on-lan status for device eth0
  27. ethtool -s eth0 wol d
  28.  
  29. else
  30. # Turn on aggressive power savings
  31.  
  32. #NMI watchdog should be turned off
  33. echo '0' > '/proc/sys/kernel/nmi_watchdog'
  34. #VM writeback timeout
  35. echo '1500' > '/proc/sys/vm/dirty_writeback_centisecs'
  36. #Enable SATA link power management for /dev/sda
  37. echo 'min_power' > '/sys/class/scsi_host/host0/link_power_management_policy'
  38. #Autosuspend for USB device DW5550 [Dell]
  39. echo 'auto' > '/sys/bus/usb/devices/2-1.6/power/control'
  40. #Autosuspend for USB device Extreme [SanDisk]
  41. echo 'auto' > '/sys/bus/usb/devices/2-1.1/power/control'
  42. #Autosuspend for USB device 5880 [Broadcom Corp]
  43. echo 'auto' > '/sys/bus/usb/devices/2-1.8/power/control'
  44. #Runtime PM for PCI Device NEC Corporation uPD720200 USB 3.0 Host Controller
  45. echo 'auto' > '/sys/bus/pci/devices/0000:0a:00.0/power/control'
  46. #Runtime PM for PCI Device NVIDIA Corporation GF108GLM [Quadro 1000M]
  47. echo 'auto' > '/sys/bus/pci/devices/0000:01:00.0/power/control'
  48. #Runtime PM for PCI Device O2 Micro, Inc. OZ600 MMC/SD Controller
  49. echo 'auto' > '/sys/bus/pci/devices/0000:0b:00.1/power/control'
  50. #Runtime PM for PCI Device O2 Micro, Inc. OZ600 MS/xD Controller
  51. echo 'auto' > '/sys/bus/pci/devices/0000:0b:00.2/power/control'
  52. #Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller
  53. echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.3/power/control'
  54. #Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller
  55. echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.2/power/control'
  56. #Runtime PM for PCI Device Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port
  57. echo 'auto' > '/sys/bus/pci/devices/0000:00:01.0/power/control'
  58. #Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1
  59. echo 'auto' > '/sys/bus/pci/devices/0000:00:16.0/power/control'
  60. #Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1
  61. echo 'auto' > '/sys/bus/pci/devices/0000:00:1d.0/power/control'
  62. #Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2
  63. echo 'auto' > '/sys/bus/pci/devices/0000:00:1a.0/power/control'
  64. #Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1
  65. echo 'auto' > '/sys/bus/pci/devices/0000:00:1c.0/power/control'
  66. #Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2
  67. echo 'auto' > '/sys/bus/pci/devices/0000:00:1c.1/power/control'
  68. #Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 3
  69. echo 'auto' > '/sys/bus/pci/devices/0000:00:1c.2/power/control'
  70. #Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4
  71. echo 'auto' > '/sys/bus/pci/devices/0000:00:1c.3/power/control'
  72. #Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 8
  73. echo 'auto' > '/sys/bus/pci/devices/0000:00:1c.7/power/control'
  74. #Runtime PM for PCI Device Intel Corporation QM67 Express Chipset Family LPC Controller
  75. echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.0/power/control'
  76. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement