]> git.pld-linux.org Git - packages/hdparm.git/commitdiff
- allow using disk labels from /dev/disk/by-id auto/th/hdparm-9_37-3
authorElan Ruusamäe <glen@pld-linux.org>
Wed, 10 Aug 2011 08:04:39 +0000 (08:04 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    hdparm.init -> 1.20
    hdparm.spec -> 1.130
    hdparm.sysconfig -> 1.4

hdparm.init
hdparm.spec
hdparm.sysconfig

index 1f6ddb9a24a2b0685e3f06dfc030946b0999d144..40f7db062faa4ad9233fa0c43a47c75d5b0750de 100644 (file)
@@ -15,12 +15,25 @@ fi
 
 for var in $blockdevs; do
        drive=${var#HDPARM_}
-       if [ -L "/proc/ide/${drive}" -o -d "/sys/block/${drive}" ]; then
+
+       # check if it is some ID
+       if [ -L /dev/disk/by-id/ata-$drive ]; then
+               dev=$(readlink -f /dev/disk/by-id/ata-$drive)
+       elif [ -L /dev/disk/by-id/scsi-$dev ]; then
+               dev=$(readlink -f /dev/disk/by-id/scsi-$drive)
+       else
+               dev=$drive
+       fi
+
+       # strip /dev
+       dev=${dev#/dev/}
+
+       if [ -L "/proc/ide/$dev" -o -d "/sys/block/$dev" ]; then
                eval PARAMS=\$$var
-               if [ -n "${PARAMS}" ]; then
+               if [ -n "$PARAMS" ]; then
                        show "Setting parameters for drive %s (%s)" "$drive" "$PARAMS"
                        busy
-                       /sbin/hdparm ${PARAMS} /dev/${drive}
+                       /sbin/hdparm $PARAMS /dev/$dev
                        ok
                fi
        fi
index e4974c6ce530325617161c62d63c0b1b6333b0e6..8a749d35ca720afd435d36190d60d5b9591cb0c6 100644 (file)
@@ -9,7 +9,7 @@ Summary(tr.UTF-8):      (E)IDE/SATA/SAS sabit disklerle ilgili bazı parametreleri de
 Summary(uk.UTF-8):     Утиліта для показу/установки параметрів жорстких дисків
 Name:          hdparm
 Version:       9.37
-Release:       2
+Release:       3
 License:       BSD
 Group:         Applications/System
 Source0:       http://downloads.sourceforge.net/hdparm/%{name}-%{version}.tar.gz
index 7db4c91804183c282dbf6e7522e07a434722d01e..8c66c31e6602ae707669c30d13758801521b6f27 100644 (file)
@@ -1,9 +1,13 @@
 # This file lets you set your hard drive parameters for better performance
 # See hdparm(8) for details.
 # Please use -q flag before any other or you will get garbage on screen
+# You can use here /dev node ("/dev/"-part stripped), also /dev/disks/by-id is accepted
 
 #HDPARM_hda=
 #HDPARM_hdb="-qm 16 -qa 16 -qu 1"
 #HDPARM_hdb=
 #HDPARM_hdc=
 #HDPARM_hdd=
+#
+# for /dev/disk/by-id/ata-HDS722525VLSA80_VN6JTECFF1SP0A:
+#HDPARM_HDS722525VLSA80_VN6JTECFF1SP0A="-qy"
This page took 0.126232 seconds and 4 git commands to generate.