wok annotate pm-utils/stuff/harddrive.patch @ rev 25340

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