-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtuned-remove-spindown-profile.patch
263 lines (261 loc) · 6.94 KB
/
tuned-remove-spindown-profile.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
bz #596817 - spindown-disk profile requires hciconfig
patch removes problematic 'spindown-disk' profile
Date: Thu, 27 May 2010 13:47:58 +0200
diff -u -uNr tuned-0.2.11.old/tune-profiles/spindown-disk/ktune.sh tuned-0.2.11.new/tune-profiles/spindown-disk/ktune.sh
--- tuned-0.2.11.old/tune-profiles/spindown-disk/ktune.sh 2009-10-05 18:10:41.000000000 +0200
+++ tuned-0.2.11.new/tune-profiles/spindown-disk/ktune.sh 1970-01-01 01:00:00.000000000 +0100
@@ -1,143 +0,0 @@
-#!/bin/sh
-# Author of original script: Daniel Mach
-# Rewrite into profiles by: Marcela Mašláňová
-
-ALPM="medium_power"
-
-# Set ALPM for all host adapters that support it
-set_alpm() {
- for x in /sys/bus/scsi/devices/host*/scsi_host/host*/; do
- hotplug="0"
- if [ -e $x/sata_hotplug ]; then
- hotplug="$(cat $x/sata_hotplug)"
- fi
- if [ "$hotplug" == "0" -a -e $x/link_power_management_policy ]; then
- echo $1 > $x/link_power_management_policy
- fi
- done
-}
-
-remount() {
- OPTS=$1
-
- mount | grep 'type ext3 (' | while read LINE; do
- DEV=$(echo $LINE | sed 's@^\(.*\) on .* type .*$@\1@')
- MNT=$(echo $LINE | sed 's@^.* on \(.*\) type .*$@\1@')
- mount -o remount,$1 $DEV $MNT
- done
-}
-
-
-hdd_apm() {
- APM=$1
-
- for DEV in /dev/[sh]d[a-z]; do
- hdparm -B $APM $DEV >/dev/null 2>&1
- done
-}
-
-
-hdd_spindown() {
- SPINDOWN=$1
-
- for DEV in /dev/[sh]d[a-z]; do
- hdparm -S $SPINDOWN $DEV >/dev/null 2>&1
- done
-}
-
-
-wireless_powersave() {
- POWER=$1
-
- IFACES=$(cat /proc/net/wireless | grep -v '|' | sed 's@^ *\([^:]*\):.*@\1@')
- for IFACE in $IFACES; do
- iwpriv $IFACE set_power $POWER
- done
-}
-
-dont_sync_logs() {
- cp -p /etc/rsyslog.conf /etc/rsyslog.conf.bckp
- sed 's/ \/var\/log/-\/var\/log/' /etc/rsyslog.conf.bckp > /etc/rsyslog.conf
-}
-
-revert_logs() {
- mv /etc/rsyslog.conf.bckp /etc/rsyslog.conf
-}
-
-start() {
-# redirect cron to tty8 isn't probably needed anymore
-
- set_alpm ${ALPM}
- # Enables USB autosuspend for all devices
- for i in /sys/bus/usb/devices/*/power/autosuspend; do echo 1 > $i; done
- # Disable HAL polling of CDROMS
- for i in /dev/scd*; do hal-disable-polling --device $i; done
- hciconfig hci0 down; modprobe -r hci_usb
- dont_sync_logs
- wireless_powersave 1
- hdd_spindown 6
- hdd_apm 128
- remount commit=600,noatime
- find /etc/ >/dev/null 2>&1
- sync
- return 0
-}
-
-# Disable ALPM for all host adapters that support it
-stop() {
- set_alpm "max_power"
- modprobe hci_usb; hciconfig hci0 up
- wireless_powersave 0
- revert_logs
- hdd_spindown 0
- hdd_apm 255
- remount commit=5
- return 0
-}
-
-# Reload it, just start once more
-reload() {
- start
-}
-
-# Status
-status() {
- return 0
-}
-
-
-case "$1" in
- start)
- [ -f "$VAR_SUBSYS_KTUNE" ] && exit 0
- start
- RETVAL=$?
- ;;
- stop)
- [ -f "$VAR_SUBSYS_KTUNE" ] || exit 0
- stop
- RETVAL=$?
- ;;
- reload)
- [ -f "$VAR_SUBSYS_KTUNE" ] && reload
- RETVAL=$?
- ;;
- restart|force-reload)
- [ -f "$VAR_SUBSYS_KTUNE" ] && stop
- start
- RETVAL=$?
- ;;
- condrestart|try-restart)
- [ -f "$VAR_SUBSYS_KTUNE" ] || exit 0
- stop
- start
- RETVAL=$?
- ;;
- status)
- status
- RETVAL=$?
- ;;
- *)
- echo $"Usage: $0 {start|stop|restart|condrestart|status}"
- RETVAL=2
- ;;
-esac
diff -u -uNr tuned-0.2.11.old/tune-profiles/spindown-disk/ktune.sysconfig tuned-0.2.11.new/tune-profiles/spindown-disk/ktune.sysconfig
--- tuned-0.2.11.old/tune-profiles/spindown-disk/ktune.sysconfig 2010-05-27 13:33:40.298496108 +0200
+++ tuned-0.2.11.new/tune-profiles/spindown-disk/ktune.sysconfig 1970-01-01 01:00:00.000000000 +0100
@@ -1,17 +0,0 @@
-# ktune service configuration
-
-# This is the ktune sysctl file. You can comment this out to prevent ktune
-# from applying its sysctl settings.
-#SYSCTL="/etc/sysctl.ktune"
-
-# Use *.conf files in the ktune configuration directory /etc/ktune.d.
-# Value: yes|no, default: yes
-# It is useful if you want to load settings from additional files. Set this to
-# no if you to prevent ktune from using these additional files.
-USE_KTUNE_D="yes"
-
-# This is the custom sysctl configuration file. Any settings in this file will
-# be applied after the ktune settings, overriding them. Comment this out to
-# use only the ktune settings.
-SYSCTL_POST="/etc/sysctl.conf"
-
diff -u -uNr tuned-0.2.11.old/tune-profiles/spindown-disk/README tuned-0.2.11.new/tune-profiles/spindown-disk/README
--- tuned-0.2.11.old/tune-profiles/spindown-disk/README 2009-10-05 18:10:41.000000000 +0200
+++ tuned-0.2.11.new/tune-profiles/spindown-disk/README 1970-01-01 01:00:00.000000000 +0100
@@ -1,14 +0,0 @@
-Possible problems:
-The script is remounting your ext3 fs if you have
-it as noatime. Also configuration of rsyslog is
-changed to not sync. hdparm is setting disc to
-minimal spins but without use of tuned daemon.
-Bluetooth will be switch off.
-Wifi will be switch into power safe mode.
-Usecase:
-Safe extra energy on your laptop or home server
-which wake-up only when you ssh to it. On server
-could be hdparm and sysctl values problematic for
-some type of discs. Laptops should be probably ok
-with these numbers.
-
diff -u -uNr tuned-0.2.11.old/tune-profiles/spindown-disk/sysctl.ktune tuned-0.2.11.new/tune-profiles/spindown-disk/sysctl.ktune
--- tuned-0.2.11.old/tune-profiles/spindown-disk/sysctl.ktune 2009-10-05 18:10:41.000000000 +0200
+++ tuned-0.2.11.new/tune-profiles/spindown-disk/sysctl.ktune 1970-01-01 01:00:00.000000000 +0100
@@ -1,7 +0,0 @@
-# ktune sysctl settings
-
-vm.dirty_writeback_centisecs=6000
-vm.dirty_expire_centisecs=9000
-vm.dirty_ratio=60
-vm.laptop_mode=5
-vm.swappiness=30
diff -u -uNr tuned-0.2.11.old/tune-profiles/spindown-disk/tuned.conf tuned-0.2.11.new/tune-profiles/spindown-disk/tuned.conf
--- tuned-0.2.11.old/tune-profiles/spindown-disk/tuned.conf 2009-10-05 18:10:41.000000000 +0200
+++ tuned-0.2.11.new/tune-profiles/spindown-disk/tuned.conf 1970-01-01 01:00:00.000000000 +0100
@@ -1,57 +0,0 @@
-#
-# tuned configuration main service
-#
-
-[main]
-# Interval for monitoring and tuning. Default is 10s.
-# interval=10
-
-#
-# Disk monitoring section
-#
-[DiskMonitor]
-# Enabled or disable the plugin. Default is True. Any other value
-# disables it.
-enabled=False
-
-#
-# Disk tuning section
-#
-[DiskTuning]
-# Enabled or disable the plugin. Default is True. Any other value
-# disables it.
-enabled=False
-hdparm=False
-alpm=False
-
-#
-# Net monitoring section
-#
-[NetMonitor]
-# Enabled or disable the plugin. Default is True. Any other value
-# disables it.
-enabled=False
-
-#
-# Net tuning section
-#
-[NetTuning]
-# Enabled or disable the plugin. Default is True. Any other value
-# disables it.
-enabled=False
-
-#
-# CPU monitoring section
-#
-[CPUMonitor]
-# Enabled or disable the plugin. Default is True. Any other value
-# disables it.
-enabled=False
-
-#
-# CPU tuning section
-#
-[CPUTuning]
-# Enabled or disable the plugin. Default is True. Any other value
-# disables it.
-enabled=False