[Bug 554009] Re: Resume from disk (swapfile) fails

Moreno Bartalucci moreno.bartalucci at tecnorama.it
Fri Apr 30 09:23:20 UTC 2010


I checked hibernate.c but I think it leads nowhere.
It doesn't even find my root partition, that means (as far as I can understand) that it is executed far too early to succeed.

Coming back to the resume script in initramfstools, the piece of code
which used to work for me in karmic is this:

magic=SWAPSPACE2S1SUSPEND
if [ -n "${resume_offset}" ]; then
        offset=$(($PAGE_SIZE * $resume_offset + 4076))
else
        offset=4076
fi
str=$(dd if=$resume bs=1 skip=$offset count=19 2>/dev/null)
magic_found=

if [ "$str" = "$magic" ]; then
        magic_found=yes
fi

Of course it takes care for only one type of suspend signature
(S1SUSPEND) but it could be adapted to check the others too.

I believe we still need the wait-for-root's job to wait for the
partitions to appear.

In case wait-for-root gives a negative result, or, alternatively, in any case a resume_offset is defined, this piece of code could be triggered to further check the swap signature.
When I have 5 minutes I'll try it myself and I'll post the resulting patch.

-- 
Resume from disk (swapfile) fails
https://bugs.launchpad.net/bugs/554009
You received this bug notification because you are a member of Kernel
Bugs, which is subscribed to initramfs-tools in ubuntu.




More information about the kernel-bugs mailing list