Why do we still ship hal-system-power-pmu / PMU support suboptimal in pm-utils

Martin Pitt martin at piware.de
Mon Dec 3 03:35:58 PST 2007


Hi,

Michael Biebl [2007-12-02 10:00 +0100]:
> I have to add, that pm-utils in Debian does not ship pm-pmu (it was
> removed by the Debian maintainer deliberately), as we tried to make
> pm-utils an arch:all package (only shell scripts)

You can do this with a scripting language, too, for example, by
calling perl in a shell script:

---- put to sleep ----
perl <<EOF
sub PMU_IOC_SLEEP { 0x20004200; }
open PMU, "/dev/pmu" or die "open /dev/pmu: \$!";
ioctl PMU, &PMU_IOC_SLEEP, 0;
EOF
-----------------------

---- query sleep capability ----
perl << EOF && echo "can sleep"
sub PMU_IOC_CAN_SLEEP { 0x40044205; }
open PMU, '/dev/pmu' or die "open /dev/pmu: \$!";
\$p = pack 'l', 0;
ioctl PMU, &PMU_IOC_CAN_SLEEP, \$p or die "ioctl: \$!";
(\$v) = unpack 'l', \$p;
exit (\$v ? 0 : 1);
EOF
--------------------------------

Martin

-- 
Martin Pitt        http://www.piware.de
Ubuntu Developer   http://www.ubuntu.com
Debian Developer   http://www.debian.org


More information about the hal mailing list