Bug#397887: Re: Bug#397887: Re: Bug#397887: [Pkg-cryptsetup-devel] Bug#397887: resume support renders system unbootable

David Härdeman david at hardeman.nu
Mon Nov 13 00:14:50 CET 2006


On Sun, Nov 12, 2006 at 11:24:53PM +0100, martin f krafft wrote:
>also sprach David Härdeman <david at hardeman.nu> [2006.11.12.2308 +0100]:
>> >created/setup correctly, /bin/fstype returns unknown for FSTYPE,
>> >and thus the cryptroot script thinks that something went wrong
>> >and loops endlessly. For some reason, mkswap didn't work. It did,
>> >however, when I tried again.
>> 
>> I think the reason is that you changed the script slightly when
>> you rewrote it, in the attached script, the last line says "echo
>> ..." while it used to say "echo -n ..." so now the passphrase
>> which the swap partition was setup with included a newline so the
>> first time you used your changed script you also got a different
>> key for the swap partition.
>
>Good spot. This sound plausible, we'll just assume this is what
>happened. :)
>
>> >Anyway, the problem continues to exist once I tried suspend2disk,
>> >since now surely fstype doesn't recognise the partition type
>> >anymore. I am not sure what the point is of verifying a valid
>> >filesystem type -- fstype is never going to know about all of
>> >them.
>> 
>> So you did manage to boot using the script after rewriting it and
>> rerunning mkswap? And then it failed after you'd done
>> a suspend2disk for the first time, correct?
>
>Yes.

So that means that suspend2disk actually removes the swap signature from 
disk when you suspend. I seemed to recall that the suspend solutions 
didn't do that but reading the source it seems I'm wrong.

>> >So why not just skip the $FSTYPE = unknown check and continue if
>> >the mapping was set up properly?
>> 
>> fstype is the only way that the initramfs script can know if
>> a dm-crypt device has been setup with the right passphrase or not
>> since the only thing that differences the wrong key from the right
>> one is that the dm-crypt device that is setup contains gibberish.
>
>Ouch. I guess this is fixed with luks, huh?

Yup (although the initramfs scripts still run a fstype check, and I 
think it'll stay that way for now, it's better to fix fstype)

>Anyway, so we need to add detection for uswsusp and suspend2 swap
>partitions to fstype I guess...

I wrote a quick patch to add detection of swsusp, suspend2 and uswsusp 
to fstype and sent it to the to the klibc ML and as a BR against 
klibc-utils a couple of minutes ago.

-- 
David Härdeman




More information about the Pkg-cryptsetup-devel mailing list