tech-userlevel archive

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

Re: Making powerd=YES default

On Mon, Jul 25, 2011 at 09:17:03PM +0200, Martin Husemann wrote:
> Unless you plan to share /etc/powerd/scripts between different machines, I
> don't see what such subdirectories would buy you.

To further clarify this a little: IMO the scripts should be shared by
machines. But this implies consistent MI interfaces in the kernel.

Thus, the current hack is to either use the subdirectories or resort to
things like this (from scripts/sleep_button):

        if /sbin/sysctl machdep.sleep_state >/dev/null 2>&1; then
                /sbin/sysctl -w machdep.sleep_state=3
                sleep 1
                if /etc/rc.d/apmd status >/dev/null ; then
                        /usr/sbin/apm -z
                        /usr/sbin/apm -d -z
                # ... waking up
                sleep 1

Obviously, both approaches leave a lot to be desired.

- Jukka.

Home | Main Index | Thread Index | Old Index