Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 130330 - add support for sdXX devices to hdparm init scripts
Summary: add support for sdXX devices to hdparm init scripts
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-18 00:36 UTC by Sven Schwyn (svoop)
Modified: 2006-06-24 21:43 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Schwyn (svoop) 2006-04-18 00:36:35 UTC
Hi devs

Not sure if I'm right here, but I guess the hdparm init script is a Gentoo extention.

While hdparm now supports sdXX devices for some functions (such as the standby timer -S) and some drives (most notably SATA), the init script only handles entries like hdXX_args and skips sdXX_args. Could you add support for the latter - and maybe add a note to /etc/conf.d/hdparm mentioning that only few parameters are allowed for sdXX devices these days.

Many thanks,    -sven
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-04-18 05:36:52 UTC
Please, don't restrict bugs without a reason.
Comment 2 SpanKY gentoo-dev 2006-04-18 22:00:13 UTC
a note in conf.d wont really cut it ... it has to just kind of "work" out of the box for both PATA and SATA ...
Comment 3 Sven Schwyn (svoop) 2006-04-18 23:54:09 UTC
The init script does not need to be cleverer than the hdparm tool itself - which will return a dumb "inappropriate ioctl for device". Cou can't keep users from adding illegal arguments to /etc/conf.d/hdparm anyway.

Changing the line "for device in /dev/hd?" in /etc/init.d/hdparm so it also parses sdXX_args works just fine on my pretty standard SATA box.
Comment 4 Sander Sweers 2006-06-04 02:53:20 UTC
Well, (In reply to comment #2)
> a note in conf.d wont really cut it ... it has to just kind of "work" out of
> the box for both PATA and SATA ...

The only way I see you can do this is by looking in sysfs. There is a entry for storage.vendor which is set to ATA for sata drives.

So something like: udevinfo -q env -n <scsi_device> | grep VENDOR should return ID_VENDOR=ATA. If not it is a normal scsi device.
Comment 5 SpanKY gentoo-dev 2006-06-24 21:34:10 UTC
you missed the point

adding /dev/sd? to the default list results in an init.d script that, by default, causes ugly messages like:
 * Running hdparm on /dev/sda ...
 HDIO_SET_DMA failed: Inappropriate ioctl for device                      [ ok ]

the code needs to just work by default
Comment 6 SpanKY gentoo-dev 2006-06-24 21:43:53 UTC
added basic support for pata_all_args and sata_all_args