[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#898741: stretch-pu: package hdparm/9.51+ds-1+deb9u1



Package: release.debian.org
Severity: normal
Tags: stretch
User: release.debian.org@packages.debian.org
Usertags: pu

hdparm tries to configure APM on every (non-USB/non-firewire) disk
in the system without first checking if APM is supported.
However, sending APM commands to disks that don't support it can have
side-effects. This upload fixes the issue by enabling APM only on
devices which support it.

The fix is cherry-picked from hdparm 9.54+ds-1 and included in the
version in testing.
Version 9.51+ds-1+deb9u1 has also been tested on a live system.

-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.15.0-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8),
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

diff -Nru hdparm-9.51+ds/debian/changelog hdparm-9.51+ds/debian/changelog
--- hdparm-9.51+ds/debian/changelog	2017-01-24 12:20:05.000000000 +0100
+++ hdparm-9.51+ds/debian/changelog	2018-05-15 15:06:28.000000000 +0200
@@ -1,3 +1,10 @@
+hdparm (9.51+ds-1+deb9u1) stretch; urgency=medium
+
+  * Update d/hdparm-funtions: Only enable APM on disks that advertise it,
+    patch from dann frazier <dannf@debian.org>, Closes: #891051
+
+ -- Alexandre Mestiashvili <mestia@debian.org>  Tue, 15 May 2018 15:06:28 +0200
+
 hdparm (9.51+ds-1) unstable; urgency=medium
 
   * New upstream version 9.51+ds
diff -Nru hdparm-9.51+ds/debian/hdparm-functions hdparm-9.51+ds/debian/hdparm-functions
--- hdparm-9.51+ds/debian/hdparm-functions	2017-01-24 12:20:05.000000000 +0100
+++ hdparm-9.51+ds/debian/hdparm-functions	2018-05-15 15:06:28.000000000 +0200
@@ -56,7 +56,15 @@
             return 1
             ;;
     esac
-    return 0
+
+    # Only activate APM on disks that support it.
+    if [ -z "$ID_ATA_FEATURE_SET_APM" ]; then
+        local ID_ATA_FEATURE_SET_APM="$(udevadm info -n "$1" -q property 2>/dev/null | sed -n 's/^ID_ATA_FEATURE_SET_APM=//p')" || true
+    fi
+    if [ "$ID_ATA_FEATURE_SET_APM" = "1" ]; then
+        return 0
+    fi
+    return 1
 }
 
 # parse /etc/hdparm.conf and spit out a list of options for the specified

Reply to: