[Pm-utils] pm-utils hook to restore harddisk APM settings

Till Maas opensource at till.name
Wed Feb 24 13:37:21 PST 2010

On Wed, Feb 24, 2010 at 10:48:36AM -0800, Dan Nicholson wrote:
> On Wed, Feb 24, 2010 at 10:37 AM, Till Maas <opensource at till.name> wrote:

> >> 2. HD_APM_DEVICES in the conf file is completely ignored. No matter
> >> the value, the hook then goes and asks hal for all the devices.
> >
> > Uh, yes, it should probably be initiated before sourcing the config
> > file. E.g. it should be a failback in case hal does not work. I will
> > look into this.
> The other way around would be better.
> source config_file
> if [ -z "$HD_APM_DEVICES" ]; then
>     check_with_hal
> fi
> Then you avoid all the hal calls that you would then throw away. Not

The hal calls append the list of devices, it is not intended to
overwrite it.

> to mention that we should probably from hal to udev, although it
> doesn't look that straightforward without writing a little program to
> do it.

Maybe there is some dir in /dev that can be used. If there is another
little program to be written, than I guess it will contain the same code
as the code in hal that detects storage devices.

> > The problem with this is, that then after a package update, there might
> > be two versions of the config file, that would all be sourced by
> > pm-utils iirc. E.g. a normal one and one with a .rpmnew suffix.
> That would be a problem on fedora, but not pm-utils upstream. Probably
> not a big deal, but it seems out of place in /etc.

Afaik it would be a problem in debian, suse, mandriva and gentoo, too.
Only the suffix might differ.

> >> Finally, I think it needs to be asked why we're doing this in
> >> userspace at all. Shouldn't the kernel be restoring the settings for
> >> us like it does for every other device type?
> >
> > I do not know how to write a patch for this in the kernel and I am not
> > motivated enough to learn it currently. This issue is the reason why the
> > hook was never submitted here. A bug report for the kernel in Fedora is
> > available here: https://bugzilla.redhat.com/show_bug.cgi?id=382061
> Has anyone asked upstream?

From the comments in the bug I assume that there are people involved
that are kernel upstream maintainers. Did you read the comments there?
The current problem is that all HD APM is done in userspace and the
kernel only forwards the raw commands from hdparm to the device.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/pm-utils/attachments/20100224/44ae0ce3/attachment.pgp>

More information about the Pm-utils mailing list