# Nearly Crazy about Initramfs & Tuxonice[solved]

## maniux

Hi, recently I upgrade my kernel to tuxonice, the problem I have is that I use splash(that means I use Initramfs), so I can't resume.

As the tuxonice wiki said, I have to add a line "echo 1 </sys/power/tuxonice/do_resume" to the init script.

Now I get stuck.

there is no init script in /usr/src/linux/usr/initramfs_data.cpio.

so, how?

P.S. I've been googling for quite a while, no helpLast edited by maniux on Wed Jan 27, 2010 3:45 am; edited 1 time in total

----------

## ppurka

If you are ready to forgo the splash screen at the kernel loading stage then here is what you have to do:

1. cd /etc/splash && ln -s <your splash theme> tuxonice

2. emerge -av tuxonice-userui (with fbsplash USE flag)

3. Since it is recommended to use hibernate command with tuxonice, you need to emerge hibernate-script.

4. Enable "TryMethod tuxonice.conf" in /etc/hibernate/hibernate.conf

5. Specify the userui in /etc/hibernate/tuxonice.conf by

```
ProcSetting userui_program /sbin/tuxoniceui_fbsplash

```

From what I remember, this should get you a working splash with tuxonice. You will, of courrse, need to call suspend to disk via the hibernate command.

----------

## maniux

 *ppurka wrote:*   

> If you are ready to forgo the splash screen at the kernel loading stage then here is what you have to do:
> 
> 1. cd /etc/splash && ln -s <your splash theme> tuxonice
> 
> 2. emerge -av tuxonice-userui (with fbsplash USE flag)
> ...

 

Acturally, I've made it work with splash. Just the resume cang't be done.

According to the wiki, it is because the resume procedure can't be called by the init script in initramfs. So what I should do is to find out where is the init script as there is none in initramfs_data.cpio.

The things you mentioned above has nothing to do with resume, just the splash, and I've done it already.

----------

## ppurka

 *maniux wrote:*   

> Acturally, I've made it work with splash. Just the resume cang't be done.
> 
> According to the wiki, it is because the resume procedure can't be called by the init script in initramfs. So what I should do is to find out where is the init script as there is none in initramfs_data.cpio.
> 
> The things you mentioned above has nothing to do with resume, just the splash, and I've done it already.

 The only thing that requires the resume to work is a line like this in the kernel command of grub,- the "resume=/dev/sda4" where you can replace sda4 with your swap partition (assuming you are hibernating by writing to swap). In my case, I am not using any initramfs and the grub.conf looks like this:

```
title Gentoo Linux

root (hd0,1)

kernel /boot/vmlinuz-2.6.32-zen3 root=/dev/sda2 resume=/dev/sda4 quiet video=uvesafb:1680x1050-32@60,mtrr:3,ywrap splash=silent:theme=natural_gentoo silent console=tty1

```

Secondly, you also need to put the hibernate-cleanup service in your boot runlevel so that it can clean up old hibernate data in swap.

If you still can't resume, then there is some other problem with the resume in your hardware. You should first try hibernating and resuming from console (no X running) and then from X, both without any splash.

EDIT: I have been assuming that you have most of the important modules (such as filesystem, etc) built into your kernel and that you can boot without an initramfs. If you are using initramfs to load modules, and if you can not boot without initramfs, then ignore whatever I have said ( I can't help you in this case, since I never even tried it myself ).

----------

## maniux

 *ppurka wrote:*   

>  *maniux wrote:*   Acturally, I've made it work with splash. Just the resume cang't be done.
> 
> According to the wiki, it is because the resume procedure can't be called by the init script in initramfs. So what I should do is to find out where is the init script as there is none in initramfs_data.cpio.
> 
> The things you mentioned above has nothing to do with resume, just the splash, and I've done it already. The only thing that requires the resume to work is a line like this in the kernel command of grub,- the "resume=/dev/sda4" where you can replace sda4 with your swap partition (assuming you are hibernating by writing to swap). In my case, I am not using any initramfs and the grub.conf looks like this:
> ...

 

Thanks for the replay.

I can resume with pm-utilis & gentoo-sources. And in this method, it is what you said.

But with tuxonice, no. I don't know whether you use tuxonice. It won't work if I only put resume=@*# in my grub.conf. The wiki 

[url]http://en.gentoo-wiki.com/wiki/TuxOnIce#Userland_Script_Installation_and_Configuration [/url]

said it clearly that I should put a line in my init. Because initramfs didn't know the resume procedure if I don't tell it.

After several days of learning, I found that I had to do a initramfs myself as the default initramfs doesn't include a init.

But the kernel panic if I use a init.

I don't know where is the error in init because it is copied from the gentoo wiki and changed only the /dev/sda* .

So I think what I met with is not the thing you are help.

Again, thanks for the replay.

----------

## ppurka

 *maniux wrote:*   

> Thanks for the replay.
> 
> I can resume with pm-utilis & gentoo-sources. And in this method, it is what you said.
> 
> But with tuxonice, no. I don't know whether you use tuxonice. It won't work if I only put resume=@*# in my grub.conf. The wiki 
> ...

 Hm... I don't know what init/initramfs that wiki is talking about. I have a working hibernate with tuxonice with no initramfs. If you want, you can get my kernel config from here:

http://pastebin.com/m7303fc9f

The procedure I followed is all of what I posted in my previous posts above. 

FYI, tuxonice can replace the default kernel's suspend mechanism. I suggest you enable that:CONFIG_TOI_REPLACE_SWSUSP=y, and then use hibernate (from hibernate-script) to actually hibernate. You might also need to set the extra_pages_allowance to some value (I have 1500) in /etc/hibernate/tuxonice.conf if the above doesn't work. If you need my config files from /etc/hibernate, then let me know. Finally, once you have set tuxonice to replace swsusp, all you need to resume is put that resume=... line in your kernel command.

----------

## maniux

 *ppurka wrote:*   

>  *maniux wrote:*   Thanks for the replay.
> 
> I can resume with pm-utilis & gentoo-sources. And in this method, it is what you said.
> 
> But with tuxonice, no. I don't know whether you use tuxonice. It won't work if I only put resume=@*# in my grub.conf. The wiki 
> ...

 

Thanks.

I've solved it by rewriting a init script.

Now, it works.

----------

