Package: hdparm
Version: 9.15-1
Severity: normal
Tags: patch

README.Debian states that:

If you have devices that consistently come up in different orders (e.g.,
today's /dev/sda is tomorrow's /dev/sdb), then you can do one of two
things.  Either you can directly use one of the various /dev/disk/by-*
symlinks, or you can create a udev rule to create a symlink to your
drive with a more friendly name.  Then point hdparm at these symlinks
as you previously did with /dev/sda.

... but this didn't seem to work for me - hdparm never attempted to set
parameters for these devices.  The init script did a string comparison
between each entry in hdparm.conf and the device name (e.g. "/dev/sdc"
etc.), as passed in by udev using the "DEVNAME" env variable.  

The attached patch canonicalises the device name from hdparm.conf before
doing the comparison, and seems to work for me.

Ta,

Tim.

-- System Information:
Debian Release: 5.0.2
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB, LC_CTYPE=en_GB (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash

Versions of packages hdparm depends on:
ii  libc6                         2.7-18     GNU C Library: Shared libraries
ii  lsb-base                      3.2-20     Linux Standard Base 3.2 init scrip

hdparm recommends no packages.

Versions of packages hdparm suggests:
pn  apmd                          <none>     (no description available)

-- no debconf information
--- /home/tim/hdparm.orig       2009-09-10 22:05:44.000000000 +0100
+++ /etc/init.d/hdparm  2009-09-10 22:34:42.000000000 +0100
@@ -177,6 +177,9 @@
               OPT_QUIET=$DEF_QUIET
               WAS_RUN=0
               if [ "$UDEV" = 'yes' ]; then
+               if test -h "$DISC"; then
+                 DISC=$(readlink -f "$DISC")
+               fi
                 if [ "$DISC" = "$DEVNAME" ]; then
                   IN_BLOCK=1
                 else

Reply via email to