LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-16-2007, 11:00 PM   #1
lurko
Member
 
Registered: Jun 2006
Location: Ontario, Canada
Distribution: Debian
Posts: 448

Rep: Reputation: 35
uswsusp confusion on Lenny w/2.6.21-6


I'm trying to setup Software Suspend on Lenny with a 2.6.21-6 kernel I compiled from the linux-source package in unstable. I followed the instructions in the HOWTO file included with uswsusp, but there's a couple items in that file that I don't understand.

The kernel I built has software suspend, initial ram disk support, ram disk support, loopback support, and ext2 all compiled-in (as well as everything I need to boot without actually using an initrd). The HOWTO describes how to manually do everything that running "make install-resume-initrd"(from the source package I presume) does. I went through those steps because I installed the uswsusp Debian package and did not see any file resembling "install-resume-initrd" when I ran 'dpkg -L uswsusp'.

The HOWTO says
Quote:
it is recommended to initially build the kernel with all of the drivers needed to mount the root filesystem (most importantly the drivers needed to access your hard disk drive) compiled in. Then, you will only need the initrd to run the resume binary itself and you will be able to use the resume initrd installation script provided in this package.
I took this(and the presence of the info on creating your own initrd) to mean I should compile the kernel without the --initrd option (but as I said above, initrd support is compiled-in), was I correct to (not) do that or should I try this again with a kernel compiled with --initrd? Is there an initrd installation script included with the uswsusp Debian package somewhere that I'm not seeing?

making the initrd:
First I recreated the /initrd directory(though it doesn't appear to have been used yet). Then I made a 2MB file 'initrd'(in my ~) with dd and ran 'mke2fs -F -m0' on it to format the file as ext2 (does it matter if the kernel option for default ram disk size is 4096 and this initrd is half that?). Then I mounted this file and made a /dev directory on it. Then I ran
Code:
# mknod dev/console c 5 1
# mknod dev/snapshot c 10 231
# mknod dev/hda2 b 3 2 (***)
***1/2 of what I'm confused about, coming back to this

and then I made /proc and /etc directories, and copied the 'real' /etc/uswsusp.conf to the /etc in the initrd file. The HOWTO says the file is suspend.conf, but there is no file by that name in my /etc. Then I copied /usr/lib/uswsusp/resume to the root of the initrd file and created a link (also in the file's root) to it called linuxrc. This is all described in section 5 of the uswsusp HOWTO ('Install resume').

Then I unmounted the file, and copied it to /boot/resume-initrd. And finally, I edited GRUB's menu.list to add an initrd line to my kernel (I normally do not use an initrd). This is the other 1/2 of my confusion. The HOWTO says to add this line to the kernel entry:
Code:
initrd (hd0,0)/resume-initrd
but doesn't go into further detail that I can use to adapt the line to my system. The first time I tried this, I assumed that (hd0,0) is supposed to be my root partition so I just changed it to (hd0,1) which is my root partition (hda2). When resuming I got an error about "could not find file" or something similar, basically it would not boot past GRUB and the error. So I tried '(hd0,1)/boot/resume-initrd' and trying to resume with that would boot further than before, but shortly resulted in the error message 'suspend: Could not stat the resume device file' and a prompt to enter the file's location or press enter to continue booting normally. I'm not entirely clear on what file it wanted me to point to (the resume-initrd? my swap partition? confusion!) so I just booted normally and here I am.

So, the initrd line in menu.list - is (hd0,1)/boot/resume-initrd the proper entry?

***and back to the /dev/hda2 file in the initrd I created - is that supposed to be my root partition or my swap partition? Or something else? (edit: oh yeah, I also tried, after getting the 'could not stat...' error, renaming this file to /dev/hda5, which is my swap, my memory bites but I think it just booted normally without prompting me about errors. damn foggy memory, sorry).

/etc/uswsusp looks acceptable enough to me, the resume partition points properly to my swap anyway (it's also defined in my kernel config). Am I missing something else? Any input is greatly appreciated. If there is any info I'm not providing please let me know so I can provide it. Where am I going wrong here?

edit: still trying to dig up info on this, no luck really. Would I be better off looking at the hibernate package? Or powersaved?

Last edited by lurko; 07-17-2007 at 01:14 AM.
 
Old 07-17-2007, 07:01 AM   #2
almatic
Member
 
Registered: Mar 2007
Distribution: Debian
Posts: 547

Rep: Reputation: 67
Quote:
I went through those steps because I installed the uswsusp Debian package and did not see any file resembling "install-resume-initrd" when I ran 'dpkg -L uswsusp'.
I'm having trouble to understand this. Does it mean, you installed the (binary) package and did not work ? If yes, what exactly failed ?
You definately need an initrd, but the package has all tools to update it and it should work out of the box (it surely does for me, even with an encrypted swap partition).
 
Old 07-17-2007, 01:40 PM   #3
lurko
Member
 
Registered: Jun 2006
Location: Ontario, Canada
Distribution: Debian
Posts: 448

Original Poster
Rep: Reputation: 35
thanks for the reply almatic

I installed the binary package for uswsusp. It kept giving me errors at first(when aptitude/dpkg was setting it up on installation) about not being able to modify the initrd for a kernel I no longer had installed, this happened when I first installed the package, and also after running 'dpkg-reconfigure uswsusp'. I found some info about the error, turns out there was some cruft in /var/ somewhere, a folder in /var/lib/ I think it was, there was a file in there for the initrd of every stock Debian kernel I've ever installed on this system. I deleted all these files (I didn't have any of the corresponding kernels installed anymore), and it stopped spitting out the error. However it doesn't say anything about initrd now (on install or dpkg-reconfigure).

So I should definitely build the kernel with the --initrd option then? And then dpkg-reconfigure uswsusp again?

Am I doing the rest correctly (namely the GRUB entry)? Do I need a resume=/dev/hda5 appended to the kernel line? Am I correct in thinking I should be booting with the same kernel entry (in GRUB) whether I'm resuming or starting normally? And swsusp should figure out for itself if there is a resume image to resume with, and if not it just boots? Or do I need two GRUB entries for the same kernel, one with resume options and one without?
 
Old 07-17-2007, 02:50 PM   #4
almatic
Member
 
Registered: Mar 2007
Distribution: Debian
Posts: 547

Rep: Reputation: 67
I'd just create the initrd image (of course you can also recompile your kernel).

update-initramfs -c -k $(uname -r)

check /etc/uswsusp.conf before, that it points to the swap. The 'resume' line in menu.lst should not be necessary (at least I don't have it)
 
Old 07-17-2007, 03:06 PM   #5
lurko
Member
 
Registered: Jun 2006
Location: Ontario, Canada
Distribution: Debian
Posts: 448

Original Poster
Rep: Reputation: 35
well that was simple enough. I created the initrd and reconfigured uswsusp, which regerated that initrd. I'm about to try another attempt, would this be the correct initrd line for my menu.list?
Code:
initrd          (hd0,1)/boot/initrd.img-2.6.21-k7
my root partition is hda2 and that is the correct name of the generated ramdisk, which is in /boot. fingers crossed, will post back in a few either way.

edit: ok, I can resume now! Thank you so much for your assistance almatic

There is a problem however, I believe it's down to the nvidia blob. Basically, the resume seems to go fine until X loads(or rather tries to load), and then X seems to crash and I am presented with KDM's login. I tried adding agp=off (workaround I came across in my information quest) to my kernel line for GRUB, but that didn't seem to make any difference at all. I understand the hibernate package implements a lot of workarounds for stuff like this, is using that instead of uswsusp likely to solve this problem?

edit2: the nvidia blob is definitely part of the problem, but I suspect not all. I tried suspending and resuming while running X with the vesa driver and X did not crash that time, but my mouse input was borked. I clicked the Kmenu and after that no mouseclicks would register, but the cursor was still following my mouse movements. The keyboard was still working fine. I use evdev for my mouse driver btw.

Last edited by lurko; 07-17-2007 at 03:57 PM.
 
Old 07-17-2007, 05:40 PM   #6
almatic
Member
 
Registered: Mar 2007
Distribution: Debian
Posts: 547

Rep: Reputation: 67
sorry, I cannot help you with the nvidia problem. I know there are nvidia related problems with certain configurations, the nvidia support forum would be a better place to ask (www.nvnews.net/vbulletin/forumdisplay.php?f=13).
I also have no experience with hibernate script or powersaved.
 
Old 07-17-2007, 07:09 PM   #7
lurko
Member
 
Registered: Jun 2006
Location: Ontario, Canada
Distribution: Debian
Posts: 448

Original Poster
Rep: Reputation: 35
well thanks anyway for your help almatic. I think I've about given up on this, my patience doesn't last long when what I'm trying to get working involves a reboot when it doesn't. If that makes sense. how disappointing

my motherboard is an ASUS A7N8X-E Deluxe, which has the nforce2-400(Ultra) chipset. Has anyone here with a similar setup got this(or suspend2/tuxonice) working in any form(preferably with the nvidia driver)?

edit: can I just use the ACPI sleep states in the kernel (and my bios) without Software Suspend or Suspend2/tuxonice at all?

Last edited by lurko; 07-17-2007 at 08:19 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Lenny vs Etch kz_chopper Debian 3 07-14-2007 06:51 PM
Apt-get lenny? Bjorne Debian 7 05-17-2007 09:33 AM
etch upgrade to lenny StargateSteve Debian 8 04-12-2007 03:11 PM
hello Im lenny lenny123 Linux - Hardware 2 06-25-2006 08:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 05:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration