wok-6.x view pm-utils/stuff/harddrive.patch @ rev 18280

Add tags to mate packages.
author Yuri Pourre <yuripourre@gmail.com>
date Sun Aug 09 17:29:42 2015 -0300 (2015-08-09)
parents
children
line source
1 --- harddrive.orig
2 +++ harddrive.new
3 @@ -23,7 +23,7 @@
4 $0: Control hard drive spindown, write caching,
5 power management and acoustic management.
7 -This hook has 8 tuneable parameters:
8 +This hook has 6 tuneable parameters:
9 DRIVE_SPINDOWN_VALUE_AC = time until a drive will spin down on AC
10 Defaults to 0, which disables drive spindown.
11 DRIVE_SPINDOWN_VALUE_BAT = time until a drive will spin down on battery
12 @@ -45,14 +45,6 @@
14 See the -B option on the hdparm man page
16 -Drive acoustic management:
17 -DRIVE_ACOUSTIC_MGMT_AC = Drive Acoustic Management value on AC
18 -Defaults to 254 for max head speed.
19 -DRIVE_ACOUSTIC_MGMT_BAT = Drive Acoustic Management value on battery
20 -Defaults to 128 for max quietness.
21 -
22 -See the -M option on the hdparm man page.
23 -
24 Drives to manage:
25 DRIVE_LIST = the list of hard drives to manage.
26 Defaults to "/dev/[hs]d[a-z]", which will manage up to the first 25 drives.
27 @@ -62,8 +54,7 @@
29 harddrive_ac () {
30 for dev in $DRIVE_LIST; do
31 - # disable write caching, do not spin down the drive, disable APM
32 - # and acoustic management, and sync everything to drive.
33 + # enable write caching, do not spin down the drive, disable APM
34 printf "Disabling hard drive power management for %s..." "$dev"
35 hdparm -W $DRIVE_WRITE_CACHE_AC \
36 -S $DRIVE_SPINDOWN_VALUE_AC \
37 @@ -75,12 +66,12 @@
39 harddrive_battery() {
40 for dev in $DRIVE_LIST; do
41 - # disable write caching, enable acoustic management
42 + # disable write caching, spin down the drive, enable APM
43 + # and sync everything to drive.
44 printf "Enabling power management for %s..." "$dev"
45 hdparm -W $DRIVE_WRITE_CACHE_BAT \
46 -S $DRIVE_SPINDOWN_VALUE_BAT \
47 - -B $DRIVE_POWER_MGMT_BAT \
48 - -M $DRIVE_ACOUSTIC_MGMT_BAT -F $dev >/dev/null 2>&1 \
49 + -B $DRIVE_POWER_MGMT_BAT -f $dev >/dev/null 2>&1 \
50 && echo Done. || echo Failed.
51 done
52 }