Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 220913 - sys-kernel/genkernel-3.4.10_pre10: resume from tuxonice with initramfs requires resume= and real_resume= to be present at kernel cmdline
Summary: sys-kernel/genkernel-3.4.10_pre10: resume from tuxonice with initramfs requir...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2008-05-08 12:14 UTC by Matthias Schwarzott
Modified: 2010-12-10 10:44 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
unbreak resuming (genkernel-tuxonice.patch,3.32 KB, patch)
2008-07-02 18:32 UTC, Ambroz Bizjak
Details | Diff
unbreak resuming (genkernel-tuxonice2.patch,3.72 KB, patch)
2008-07-04 09:46 UTC, Ambroz Bizjak
Details | Diff
fix console=... ? (genkernel-console.patch,442 bytes, patch)
2008-07-04 09:58 UTC, Ambroz Bizjak
Details | Diff
fix resume for tuxonice (genkernel-tuxonice-resume-git.diff,3.03 KB, patch)
2009-05-27 11:20 UTC, Matthias Schwarzott
Details | Diff
fix resume for tuxonice on genkernel-3.4.10.906 (genkernel-3.4.10.906-tuxonice-resume.diff,3.17 KB, patch)
2009-09-04 09:21 UTC, Matthias Schwarzott
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Schwarzott gentoo-dev 2008-05-08 12:14:42 UTC
Using an initramfs created by sys-kernel/genkernel-3.4.10_pre10 to resume a tuxonice kernel now requires not only resume= but also real_resume= to be present on kernel-cmdline.

I just noticed this as system did not resume but boot normal after creating a new initramfs.

So why do we need to use real_resume, as not its value is checked for tuxonice-resume, but only its pure existance?
As the comment says this is to stop resume be active on livecd boots.
Couldn't the code check on resume= to be present only.

Even real_resume is not documented anywhere - at least nowhere I have looked at.

I need the initramfs as my root-partition is on lvm, so I cannot just delete it from my grub entry.

Reproducible: Always

Steps to Reproduce:
1. Have a tuxonice kernel
2. Create a initramfs with genkernel
3. Add it to grub.conf with just resume=swap:/dev/sda15 (for me) in kernel-cmdline
3. Do suspend.
4. Try to resume
Actual Results:  
System will boot up ignoring the suspended image

Expected Results:  
System should resume from swap partition into the formerly suspended system
Comment 1 Chris Gianelloni (RETIRED) gentoo-dev 2008-06-06 16:43:09 UTC
Got a patch?  I don't use tuxonice and don't really know much of anything on how it works.  Nearly all of that code is contributed by others, so patches are definitely welcome.
Comment 2 Ambroz Bizjak 2008-07-02 18:32:01 UTC
I got a patch.
Tuxonice code is completly broken. Consider real_resume is something like swap:/dev/sda4:0x44078 (swap file). Becouse "swsusp_resume" is always called before "tuxonice_resume", it may fail to interpret the device string and output an error something like "ls: no such file...". Further on, "tuxonice_resume" doesn't actually do anything with real_resume, while it should configure resuming from it.

With my patch, resuming can be done as follows:
If you have a regular kernel, use real_resume=/dev/<swap>.
If you have a tuxonice kernel, use an appropriate device in real_resume, as understood by tuxonice (swap:/dev/<swap> or file:/dev/<root>:0xXXXXX or swap:/dev/<root>:0xXXXXX or probably even /dev/<swap>)
If you have a tuxonice kernel but want regular swsusp (regardless you chose in the kernel to override swsusp by default or not), add real_resume=/dev/<swap> use_swsusp.

Looking at the code, I also noticed the initrd tries to provide the kernel with a tuxonice user interface. However I have no idea of why that code is there, as the user interface would have to be included initrd.
Comment 3 Ambroz Bizjak 2008-07-02 18:32:36 UTC
Created attachment 159353 [details, diff]
unbreak resuming
Comment 4 Laurento Frittella (mrfree) 2008-07-03 15:44:36 UTC
Using your patch I dropped resume= from cmdline leaving only real_resume= 
and it seems to works well here

With the latest genkernel I also notice that text messages overlap the splash image but I don't know if it's related with tuxonice.
Comment 5 Ambroz Bizjak 2008-07-03 17:23:56 UTC
The text overlapping can be fixed by adding "console=tty1 quiet" to the kernel command line.
Comment 6 Paul Kronenwetter 2008-07-03 23:17:15 UTC
And perhaps genkernel itself should add a real_resume= entry if it finds a resume= so non-technical folks can still use tuxonice.
Comment 7 Ambroz Bizjak 2008-07-04 09:46:51 UTC
Created attachment 159510 [details, diff]
unbreak resuming

With this patch, 'resume' is treated the same way as 'real_resume'.
(note the specification of the resume device is redundant in case of 'resume' as the kernel already configures it, but is there for simlicity.)
Also, this patch removes checking for 'noresume' as it prevents suspending from being configured (e.g. if you used noresume you were not be able suspend during that boot). 'noresume' is handled by the kernel itself. It will not resume if it finds it, regardless if we ordered it to resume.
However, I can only confirm that behaviour with tuxonice as I don't have place for a swap partition. Could someone please test it for swsusp? (e.g. save all your data, hibernate with swsusp, and when resuming, add 'noresume' to the cmdline, and the system should clean boot)
Comment 8 Laurento Frittella (mrfree) 2008-07-04 09:48:21 UTC
(In reply to comment #5)
> The text overlapping can be fixed by adding "console=tty1 quiet" to the kernel
> command line.

I already have them in my cmdline (console must be upper-case) but it doesn't
work anymore, the text overlaps background image during boot in silent mode
Comment 9 Ambroz Bizjak 2008-07-04 09:58:23 UTC
Created attachment 159514 [details, diff]
fix console=... ?

(In reply to comment #8)
> I already have them in my cmdline (console must be upper-case) but it doesn't
> work anymore, the text overlaps background image during boot in silent mode
Try this patch (along with the tuxonice patch).
Comment 10 Ambroz Bizjak 2008-07-04 10:22:29 UTC
console=... probably works anyway. the previous patch should fix CONSOLE=...
Comment 11 Laurento Frittella (mrfree) 2008-07-04 20:54:17 UTC
Both your patches work fine here (tuxonice2.patch and console.patch)
Comment 12 Ambroz Bizjak 2008-07-04 23:10:31 UTC
I was able to test swsusp, and yes, it does work properly, both using resume=, real_resume=, and noresume also work. The tuxonice patch is well tested and is ready to be merged. Also, the last patch fixes an obvious bug that prevents CONSOLE= from being interpreted properly (while console= works).
Comment 13 Ambroz Bizjak 2008-07-04 23:26:19 UTC
There is, however, still a minor 'inconsistency' concerned swsusp, that is when using resume= itself (not real_resume), unlike tuxonice, the kernel will try to resume immediately, before starting the initrd. But this is actually good, as the system will resume faster if the disk driver is built into the kernel; otherwise, it will still resume during the initrd.
Comment 14 Ambroz Bizjak 2008-07-14 21:22:49 UTC
Maintainers please? My patch has been tested and also reported to work; it would be nice if you merged it.
Comment 15 Andrew Gaffney (RETIRED) gentoo-dev 2008-07-14 21:26:53 UTC
Don't do that. We get the bugmail for genkernel. We see the patch. Bugging us like this just makes us want to put this particular bug at the bottom of our respective long lists of things to do.

Did it ever occur to you that we might have lives and/or just be busy with other things? We'll get to this eventually. Both of the maintainers are members of releng, and we just finished putting out the 2008.0 release, which we're still trying to "clean up" from.

Comment 16 Chris Gianelloni 2008-11-03 12:54:40 UTC
We'll want to look into fixing this for 3.4.11's release.
Comment 17 Matthias Schwarzott gentoo-dev 2009-05-27 11:20:14 UTC
Created attachment 192581 [details, diff]
fix resume for tuxonice

This patch works against latest git-version of genkernel (and with small change against genkernel-3.4.10.904).
Comment 18 Matthias Schwarzott gentoo-dev 2009-09-04 09:21:50 UTC
Created attachment 203107 [details, diff]
fix resume for tuxonice on genkernel-3.4.10.906

This is an updated patch for genkernel-3.4.10.906.

It works for me with tuxonice-sources-2.6.30-r5 with root and swap on lvm2 with this kernel command line:
kernel /vmlinuz dolvm real_root=/dev/vg2/slash video=vesafb:ywrap,mtrr vga=0x315 resume=/dev/sda15
Comment 19 Andrew Gaffney (RETIRED) gentoo-dev 2009-09-05 04:43:45 UTC
This patch has been applied in git. I have no way to test it, but I'll be sure to blame you if it breaks ;)
Comment 20 Matthias Schwarzott gentoo-dev 2009-12-28 11:26:19 UTC
works as it should :)
Comment 21 Sebastian Pipping gentoo-dev 2010-12-10 10:44:44 UTC
(In reply to comment #19)
> This patch has been applied in git.

Due to the date of the last comment on this bug I assume that feature to be
included in 3.4.10.907 or an earlier release of genkernel.

Therefore, I remove this bug from tracker bug #245389 "Features for inclusion by 3.4.11".