Comment 12 for bug 554009

Revision history for this message
Moreno Bartalucci (moreno-bartalucci) wrote :

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.