Auto hibernation

New features which should be implemented in Porteus; suggestions are welcome. All questions or problems with testing releases (alpha, beta, or rc) should go in their relevant thread here, rather than the Bug Reports section.
Post Reply
User avatar
oranus
Contributor
Contributor
Posts: 69
Joined: 25 Aug 2011, 13:46
Location: Turkey

Auto hibernation

Post#1 by oranus » 04 Nov 2011, 09:36

To speed up Porteus;

I suppose to auto-hibernation on Porteus. I think hibernate system bootstrapping time is less than usual bootstrapping. So after Porteus bootstrapping successfully it make automatically save hibernate file to pendrive and make hash file of that computer specs. And
1.If porteus starts the same machine again it just use hibernate file for fast boot.
2.If porteus starts the another machine it follow usual bootstrapping procedure and change hibernate file for that computer for another booting.

Any idea?

User avatar
brokenman
Site Admin
Site Admin
Posts: 5576
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: Auto hibernation

Post#2 by brokenman » 04 Nov 2011, 13:34

I was pondering this a while back ... having porteus dump system state to the drive and then awaking to this system state as in some devices that take only seconds to boot. Porteus already has the hibernate feature (which took a while to shutdown for me) and i gave up on the idea for a number of reasons.

If you save state to RAM you have a problem if a laptop battery runs down, or is unplugged. If you save the system state to a hard drive you aren't really gaining much. Time saved in bstrap is minimal and porteus already has an insanely fast boot time, even when loading changes. So all in all i don't really see an advantage in creating this scenario, but i see a lot of pitfalls and potential troubles.

If you still want to pursue it though, i will help as best i can.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Auto hibernation

Post#3 by Hamza » 04 Nov 2011, 16:17

That is what a recent Microsft Windows Operating System does, and I hate this.

It is consuming too many resources like the RAM with a "normal" computer.
This should be fine when you have 8GB of RAM and a SSD as Master Drive ;)
NjVFQzY2Rg==

User avatar
fanthom
Site Admin
Site Admin
Posts: 4621
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Re: Auto hibernation

Post#4 by fanthom » 08 Nov 2011, 22:04

i'm trying to look at this request from technical point of view. so far only one major problem:

a) generating unique PC id should be easy:

Code: Select all

lspci > pcid && md5sum pcid
this ID could be used as a swap file name.
b) Porteus has 'mkswapfile' utility which can create swap image on the fly with desired size (more than available memory i guess)
c) here is a thread discussing how to boot from a swap file:
http://superuser.com/questions/21020/ca ... -partition
more info is here:
http://www.kernel.org/doc/Documentation ... -files.txt

so we have two ways of achieving the goal:
a)

Code: Select all

Use an application that will bmap the swap file with the help of the
FIBMAP ioctl and determine the location of the file's swap header, as the
offset, in <PAGE_SIZE> units, from the beginning of the partition which
holds the swap file.
and

Code: Select all

Add the following parameters to the kernel command line:
resume=<swap_file_partition> resume_offset=<swap_file_offset>
this way should be easy but wont make possible to verify the PC ID.
here is detailed Ubuntu tutorial:
http://ubuntuforums.org/showthread.php?t=1042946

b)
will have to use initrd to generate PC ID -> find swap file -> activate it or inject it's content directly into PC memory.
some info is here:
http://www.kernel.org/doc/Documentation ... swsusp.txt
but doesn't tell me much how to do the last part

any help?
Please add [Solved] to your thread title if the solution was found.

Post Reply