[pkg-cryptsetup-devel] Bug#507721: cryptsetup: Sometimes initrd ends up missing conf/conf.d/cryptroot file in it

Christian Jaeger christian at jaeger.mine.nu
Thu Dec 11 11:08:57 UTC 2008


Yves-Alexis Perez wrote:
> On jeu, 2008-12-11 at 01:37 +0100, Christian Jaeger wrote:
>   
>> Ok, so I've taken a stab at debugging this thing and got it to work;
>> see
>> the attached patches; some of them also contain changes which I needed
>> to be able to run the script with set -eu. I think it would make sense
>> to apply these, too, so I'm attaching them as well. I'm not squashing
>> together the patches 1 and 5, and patches 6 and 8, since I think it
>> may show the difficulties more clear.
>>     
>
> I don't know initramfs really well so I won't comment all the patches,
> but, basically what you are saying is that the problem lies in the
> dm-mod.ko naming. Sometimes it's dm-mod.ko and sometimes dm_mod.ko and
> that it breaks the search?

No, that was just a followup problem. The real problem was, as Ben
correctly said, that the get_lvm_deps function didn't recurse for
plaintext lvm volumes (or their volume group, I'm not sure), and thus
didn't notice that the physical volume underneath the volume group was
in fact encrypted. Now why building the initrd *sometimes* worked for
me, I don't know; (possibly because I had mounted some other encrypted
volume? But all of my encrypted volumes are physical volumes of a volume
group, afair; so no idea).

After fixing get_lvm_deps this way, the script started searching for
dm_mod [and dm_crypt?] by using the add_crypto_modules procedure (*).

Look at
http://christianjaeger.ch/dyn/pubgit/gitweb?p=cryptroot-debugging.git;a=log;h=refs/heads/debugging
for the details on how I proceeded. (Note: because I did rebase, the
commidid's in messages like "This reverts commit XXX" are broken.)

(* note: the code which I did change in commit
http://christianjaeger.ch/dyn/pubgit/gitweb?p=cryptroot-debugging.git;a=commitdiff;h=9dcef260d89858d372d42123b8770321700da355
which I did find by searching for dm_mod is actually calling
manual_add_modules directly; it seems that it was not this code which is
calling the add_crypto_modules procedure.)

Christian.






More information about the pkg-cryptsetup-devel mailing list