supporting tuxonice in pm-utils

Matt Price matt.price at
Fri Jan 18 19:30:15 UTC 2008


i've been browsing through the pm-utils code since fixing some suspend
issues on my laptop (running ubuntu hardy) and it looks to me like it'd
be pretty straightforward to get pm-utils to support tuxonice in
debian-based distros.  i think not much would be required beyond a
couple of small changes in pm-action and functions; first we slightly
improve the test for suspend-hybrid capability (in pm-action):

case "$ARG" in
               grep -q mem /sys/power/state || exit 1
               grep -q disk /sys/power/state || exit 1
              grep -q mem /sys/power/state || exit 1
              grep -q disk /sys/power/state || exit 1
              [ -d /sys/power/tuxonice ] || [ -x /usr/sbin/s2both ] ||
exit 1

and in functions, change do_suspend_hybrid():
       if [ -x /usr/sbin/s2both ]; then
               /usr/sbin/s2both -f $S2DISK_CONF $S2RAM_OPTS
       elif [ -d /sys/power/tuxonice ]; then
               echo 3 > /sys/power/tuxonice/powerdown_method
               echo -n "platform > /sys/power/disk
               echo -n "disk" > /sys/power/state
               exit 1;

one could make other refinements, in particular allowing users to set a
preference when multiple suspend options are present; but i think these
would be sufficient in principle.  let me know what you think & if you
would be interested in patches.  thanks much,


Matt Price
matt.price at

More information about the Ubuntu-devel-discuss mailing list