On 28-03-16, 18:17, Shyamjith K V wrote:
Hi There,
I am working to implement hibernation (Suspend to disk) on ARM and have successfully done that by using [1]swsusp ARM patch by Sebastian Capella. Now I can hibernate (suspend to swap partition in sd card) the kernel using the command echo disk > /sys/power/state and the system will resume its state with the next power on. But if I press reset again the kernel follow a normal boot sequence.
My question is how can I make that swap area and hibernate image in that area permanent, so that in every reset it will awake from that permanent image? I have given the value of swapiness=0 so that I expect there wont be any swapping of pages any more while system is alive. How kernel decide whether go for a normal boot or awake from (resume=/dev/swap_partition) hibernation?
I searched a lot on internet but didn't get a clear idea about how Linux kernel is awaking from hibernation and what it will do with swap after resuming once.Thank you for your time
My kernel version is 3.14
If you want to do just that (which is wrong), then you have to hack the kernel somewhere I believe.
Behaving as if we hibernated, even if we did a reboot, is something clearly wrong. Why not just hibernate everytime and boot again ?
The way kernel resume from Hibernate is that, - it boots a normal kernel first - reads swap_partition (or whatever) - learns that we hibernated - suspends the normal kernel (not fully) - copy hibernated kernel's state from swap_partition - resumes the hibernated kernel
Its been 5-6 years, that I have looked into any of these details, but this is what I remember. The process is clearly mentioned in Documentation though.