On Sunday 02,May,2010 05:23 PM, Moreno Bartalucci wrote:
> I tried another way to check if there has been a hibernation or not.
> I found useful the blkid utility (which is included already in the initramfs
> image).
> I may pass a device name as well as an offset to blkid to check the contents
> of the device.
> In turn, it prints various info but now I'm interested only in the 'type'
> info, which appears to be the same of the udev one with the exception that it
> can check at an arbitrary offset.
>
> So, I made a new patch to be applied to /usr/share/initramfs-
> tools/scripts/local-premount/resume file.
>
> Please find it here attached.
>
> I think I still need to call wait-for-root to wait for the device to
> appear, although I'm not completely sure about it.
>
> I'd like to hear comments about this patch.
>
>
> ** Patch added: "Added a further check with blkid."
> http://launchpadlibrarian.net/47207465/resume.patch
>
It looks like a good idea, but.. is there a /conf/page_size.conf? I've never
seen that file around before. Moreover, blkid appears to assume the page size to
be 4096, so if it's anything other than 4096, it'd fail to detect the swsusp
signature anyway (swsusp puts its signatures at the end of the first page).
Another thing: you don't need to keep track of the output of wait-for-root, so
it should be sufficient to just replace that line with something like:
wait-for-root "${resume}" ${RESUMEDELAY:-5} instead.
As for the offset_option calculation, you could just use something like...
offset_option=$((${resume_offset:-0} * $PAGE_SIZE)) instead. That sets a default
value of "0" if resume_offset is not set.
--
Kind regards,
Chow Loong Jin
--
Resume from disk (swapfile) fails
https://bugs.launchpad.net/bugs/554009
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs