wok-next annotate pm-utils/stuff/patches/harddrive.patch @ rev 20656

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