Discussion:
merging tuxonice changes into ubuntu git tree?
Matt Price
2010-03-30 01:37:07 UTC
Permalink
Hi everyone,

so, I'm getting pretty darn tired of waiting forever and a day for my
new computer to wake up from hibernation on ubuntu lucid. However,
the vanilla kernel is pretty messed up on my machine -- freezes even!,
and no wireless - so I'd liek to try to add tuxonice to the ubuntu
kernel git tree; but I can't relaly rememberh ow to do this. Anyone
willing to remind me? I created my git repo as recommended on the
ubuntu KernelGitGuide page:
git clone git://kernel.ubuntu.com/ubuntu/linux-2.6
git clone --reference linux-2.6/ git://kernel.ubuntu.com/ubuntu/ubuntu-lucid.git

presumably the next thing i want to do is create a new branch, pull
from nigel's upstream repo (?), then maybe create yet another branch
in which i try to merge nigel's changes into one of the ubuntu
branches (when the repo is cloned you get a *lot* of tags). is that
right? and can someone explain to me how to do it? i know this is
lame but I always find the git docs discouragingly difficult.

in any case thanks a bunch,
matt
Nigel Cunningham
2010-03-30 01:45:06 UTC
Permalink
Hi Matt.
Post by Matt Price
Hi everyone,
so, I'm getting pretty darn tired of waiting forever and a day for my
new computer to wake up from hibernation on ubuntu lucid. However,
the vanilla kernel is pretty messed up on my machine -- freezes even!,
and no wireless - so I'd liek to try to add tuxonice to the ubuntu
kernel git tree; but I can't relaly rememberh ow to do this. Anyone
willing to remind me? I created my git repo as recommended on the
git clone git://kernel.ubuntu.com/ubuntu/linux-2.6
git clone --reference linux-2.6/ git://kernel.ubuntu.com/ubuntu/ubuntu-lucid.git
presumably the next thing i want to do is create a new branch, pull
from nigel's upstream repo (?), then maybe create yet another branch
in which i try to merge nigel's changes into one of the ubuntu
branches (when the repo is cloned you get a *lot* of tags). is that
right? and can someone explain to me how to do it? i know this is
lame but I always find the git docs discouragingly difficult.
in any case thanks a bunch,
You could just try applying the patch for vanilla. They almost always
apply without modification to Ubuntu trees.

That said, I'm going to take a look now, and see if I can push a tree to
kernel.ubuntu.com shortly.

Nigel
Nigel Cunningham
2010-03-30 02:26:16 UTC
Permalink
Hi Matt et al.

Okay. There's a Lucid tree on kernel.ubuntu.com now. I've not compile
tested it, but that shouldn't be a problem because there were no rejects
in applying the vanilla 2.6.32 patch.

After I grab some lunch, I'll do a commit setting up the config options
that will allow you to just run debian/rules binary.

Regards,

Nigel
Martin Schläffer
2010-03-30 11:45:06 UTC
Permalink
Hi Matt,
Post by Matt Price
so, I'm getting pretty darn tired of waiting forever and a day for my
new computer to wake up from hibernation on ubuntu lucid. However,
the vanilla kernel is pretty messed up on my machine -- freezes even!,
and no wireless - so I'd liek to try to add tuxonice to the ubuntu
kernel git tree; but I can't relaly rememberh ow to do this. Anyone
willing to remind me? I created my git repo as recommended on the
git clone git://kernel.ubuntu.com/ubuntu/linux-2.6
git clone --reference linux-2.6/ git://kernel.ubuntu.com/ubuntu/ubuntu-lucid.git
presumably the next thing i want to do is create a new branch, pull
from nigel's upstream repo (?), then maybe create yet another branch
in which i try to merge nigel's changes into one of the ubuntu
branches (when the repo is cloned you get a *lot* of tags). is that
right? and can someone explain to me how to do it? i know this is
lame but I always find the git docs discouragingly difficult.
As Nigel already wrote you can just use the vanilla patch. In the Ubuntu
git tree, checkout the current Lucid kernel version
(Ubuntu-2.6.32-18.27), apply the patch and build the kernel.

There is also a build running in the tuxonice-testing PPA which you can
try when (if) it finishes. Note that there might still be some problems
with it but I would be happy if you could test it.

Martin
Matt Price
2010-04-02 12:32:19 UTC
Permalink
Post by Martin Schläffer
Hi Matt,
As Nigel already wrote you can just use the vanilla patch. In the Ubuntu git
tree, checkout the current Lucid kernel version (Ubuntu-2.6.32-18.27), apply
the patch and build the kernel.
There is also a build running in the tuxonice-testing PPA which you can try
when (if) it finishes. Note that there might still be some problems with it
but I would be happy if you could test it.
Martin
Hi Martin, Nigel, everyone,

so, I installed the kernel from the tuxonice-testing ppa. At present
I'm suspending fine (using hibernate 2.0 script, again from a ppa),
but having no luck on resume. This is a brand-new system so I don't
have my old initramfs scripts installed on it, and at first I assumed
that was the problem, but I've since added
/etc/initramfs-tools/scripts/local-premount/tuxonice-resume and
/etc/initramfs-tools/hooks/tuxonice-userui, attached, and haven't
noticed any improvements. I also saw that the new grub2 configuration
doesn't include a resume- boot parameter, and on boot added first a
resume=/dev/sdaX and then resume=swap:/dev/sdaX, again with no luck.
Dmesg just reports

Apr 1 15:03:40 roke kernel: [ 1.172486] TuxOnIce 3.1 (http://tuxonice.net)
Apr 1 15:03:40 roke kernel: [ 1.172609] TuxOnIce: Ignoring late
initcall, as requested.
Apr 1 15:03:40 roke kernel: [ 1.172672] PM: Checking image
partition /dev/sda7
Apr 1 15:03:40 roke kernel: [ 1.174243] PM: Resume from disk failed.

though I haven't enabled debug yet, I'll do that as soon as i've
written this i guess! although now i can't remember -- do i need to
enable debugging at the kernel config level? trying to do that right
now in nigel's ubuntu-lucid+tuxonice tree.

In any case I was hoping someone could review the changes that are
currently required to a vanila system to get tuxonice working - i know
it's gotten much closer to 'drop-in replacement' status than it was
when i last had to install it on a fresh machine, and I don't want to
start making unnecessary changes, as i am trying not to make some of
the mistakes i did with my last machine (cluttered, unmaintainable
/etc, for instance).

Thanks as always,
Matt
Matt Price
2010-04-05 12:56:12 UTC
Permalink
Post by Matt Price
This is a brand-new system so I don't
have my old initramfs scripts installed on it, and at first I assumed
that was the problem, but I've since added
/etc/initramfs-tools/scripts/local-premount/tuxonice-resume and
/etc/initramfs-tools/hooks/tuxonice-userui, attached, and haven't
noticed any improvements.
grrrhhhxh... I had a typo in my suspend script -- a curly html-ized
open quote instead of proper quotation marks -- and intiramfs-tools of
course wouldn't add the script to the initrd! fixed now, everything
works great, on to the next question ( see my next posting).

matt
Martin Schläffer
2010-04-05 13:19:14 UTC
Permalink
Hi all,
Post by Matt Price
Post by Matt Price
This is a brand-new system so I don't
have my old initramfs scripts installed on it, and at first I assumed
that was the problem, but I've since added
/etc/initramfs-tools/scripts/local-premount/tuxonice-resume and
/etc/initramfs-tools/hooks/tuxonice-userui, attached, and haven't
noticed any improvements.
grrrhhhxh... I had a typo in my suspend script -- a curly html-ized
open quote instead of proper quotation marks -- and intiramfs-tools of
course wouldn't add the script to the initrd! fixed now, everything
works great, on to the next question ( see my next posting).
I just uploaded new packages and all required files for the initrd are
installed by the kernel package. So, tuxonice should just work by
installing the packages. No configuration needed. Note that also the
swap partition is already detected by tuxonice itself. No resume=...
parameter needed anymore!

The hibernate package is just there as a backup solution. By default,
everything is handled by pm-utils which works here at least (try to
suspend with "pm-hibernate").

The kernel package uses tuxoniceui_text by default again since usplash
has been removed from Ubuntu Lucid (plymouth is used now).

Martin
Matt Price
2010-04-05 22:08:56 UTC
Permalink
wow, great martin.  thanks.  So does this mean that the kernel package
is really *all* that is required anymore to integrate tuxonice?
That's fantastic.
In theory: yes! Tell me if it works in your case as well.
On the topic of pm-utils: does anyone know if there's a way to get
pm-utils to use tuxonice's suspend-to-both (powerdown method 3) when
the 'sleep' option is chosen?  suspend-to-ram is a bit unreliable on
my current machine, so I would love to have a tuxonice backup when,
say, the laptop lid is closed.
Hmm, I tell you if I find out. BTW: you just replied to me and not to the
list.
shoot, sorry -- gmail etiquette buster...

i found the following message in the list archives -- ironically from
kenneth to me, so you'd have thought i remembered -- describing one
approach (which requires hibernate). Does this seem like it might
work, and does debian packaging permit modifying a file that belongs
to another package?

----------------------
I've always had to make the following changes since using Ubuntu to get
ToI to work properly with it (i.e., let GNOME's utils call pm-hibernate,
which goes thru the /usr/lib/pm-utils scripts, then calls ToI, and back
on the way back up:

Add SLEEP_MODULE="tuxonice" to /etc/pm/config.d/00sleep_module, then
the following patches in /usr/lib/pm-utils. The first set allows all of
ToI's hibernate to run (so you get the stuff in /etc/hibernate to run,
too) and the 2nd set (99video) is NVidia-specific to allow "suspend" to
work correctly on resume so text-mode VTs work OK.

--- save/tuxonice 2009-10-06 14:41:22.000000000 -0700
+++ module.d/tuxonice 2009-05-17 11:54:44.000000000 -0700
@@ -16,8 +16,18 @@
HIBERNATE_MODULE="tuxonice"
do_hibernate()
{
- echo 5 > "${TUXONICE_LOC}/powerdown_method"
- echo anything > "${TUXONICE_LOC}/do_hibernate"
+ /usr/local/sbin/hibernate
+ }
+fi
+
+if [ -z "$SUSPEND_MODULE" -a -n "$TUXONICE_LOC" ] && \
+ grep -q mem /sys/power/state && \
+ [ -f "${TUXONICE_LOC}/do_hibernate" ]; then
+ SUSPEND_MODULE="tuxonice"
+ do_suspend()
+ {
+ /usr/local/sbin/hibernate-ram
+ REVERSE="thaw"
}
fi

@@ -28,7 +38,7 @@
do_suspend_hybrid()
{
echo 3 >"${TUXONICE_LOC}/powerdown_method"
- echo anything >"${TUXONICE_LOC}/do_hibernate"
+ /usr/local/sbin/hibernate
[ -f /sys/power/tuxonice/did_suspend_to_both ] && \
[ "$(cat /sys/power/tuxonice/did_suspend_to_both)" != "1" ] && \
REVERSE="thaw"
--- save/99video 2009-10-06 14:41:22.000000000 -0700
+++ sleep.d/99video 2009-11-08 23:24:46.359440034 -0800
@@ -202,14 +202,14 @@
}

case "$1" in
- suspend) maybe_chvt; suspend_video ;;
- hibernate) maybe_chvt
+# suspend) maybe_chvt; suspend_video ;;
+ suspend|hibernate) maybe_chvt
if [ "$HIBERNATE_RESUME_POST_VIDEO" = "yes" ]; then
suspend_video
fi
;;
- resume) resume_video; maybe_deallocvt;;
- thaw)
+# resume) resume_video; maybe_deallocvt;;
+ resume|thaw)
if [ "${HIBERNATE_RESUME_POST_VIDEO}" = "yes" ]; then
resume_video
fi

-------------

thx,
matt
Martin
Loading...