5
SATA_ALPM_ENABLE=${SATA_ALPM_ENABLE:-true}
9
$0: SATA link power management
11
This hook tries to save power by allowing SATA controllers to
12
reduce power usage when the SATA subsystem is otherwise idle.
14
This adds a little bit of latency to drive accesses in
15
exchange for moderate power savings if you are not using the drive.
17
This hook has 1 parameter:
18
SATA_ALPM_ENABLE = whether to use SATA ALPM on battery.
25
# see kernel commit 6013efd8860bf15c1f86f365332642cfe557152f
27
[ "$kv" ] || exit $NA #for paranoia's sake
28
[ "${kv%-*}" \< "2.6.33" ] && exit $NA # avoid fs corruption
29
for f in /sys/class/scsi_host/host*; do
30
[ -w "$f/link_power_management_policy" ] || continue
31
printf "Setting SATA APLM on %s to %s..." "${f##*/}" "$1"
32
echo "$1" > "$f/link_power_management_policy" && echo Done. || \
38
true) [ "$SATA_ALPM_ENABLE" = true ] && set_sata_alpm min_power;;
39
false) set_sata_alpm max_performance;;
b'\\ No newline at end of file'