You are not logged in.

#1 2008-12-19 13:04:48

Rorschach
Member
From: Ankh-Morpork
Registered: 2008-11-07
Posts: 143

mkinitcpio doesn't respect modules compiled into the kernel

Hi,
can someone explain the following:

I compiled dm_crypt form into my kernel not as module. Now mkinitcpio complained about the missing module while processing the encrypt hook with an "Error can't find module dm_crypt"... But everything works fine. If I remove the encrypt-hook mkinitcipio doesn't complain anymore but I can't decrypt my root-partition while booting.

So is it a bug with mkinitcipio not respecting if a module has beend compiled into the kernel?

Offline

#2 2008-12-19 13:46:11

TjPhysicist
Member
From: Waterloo, Canada
Registered: 2008-04-12
Posts: 126
Website

Re: mkinitcpio doesn't respect modules compiled into the kernel

you can compile "driver" as a module, in which case it is kept seperate (ie a sperate file), and loaded into kernel as and when needed. The pro point for this is that that "module" can be loaded/unloaded as needed making kernel space small if you want. The con is that putting in say driver for HDD that you use as a module will mean that it will have to be loaded into the kernel and is not an inherent part of the kernel, and thus cud cause slowdowns.

Or you could compile it into the kernel itself. In which case the "driver" is now within the kernel (compile into vmlinuz26 and not as a seperate file), this means just loading vmlinuz26 would load the driver you need, and save the time used to load said driver if it was a seperate module. This however means that vmlinuz26 is larger, which means consequently loading time is more, and there is no way you can reduce the footprint of kernel space, since you cannot "remove" that driver to free up the space it uses.


You decided to take option 2. mkinitcpio builds a initrd, this is essentially a "version" of vmlinuz26 with just the needed "modules" built into it. For example, if your "/" is reieserfs, and you built reiserfs as module (option 1). Remember in this case the "driver" is now a seperate file in /lib/modules, and not built into vmlinuz, this means that "/" needs to be read to load the driver, BUT the driver is needed to read "/".

This problem has its solution in initrd image. mkinitcpio, reads a list of modules (such as reieserfs in this case, that NEED to be loaded for the kernel to work as it should) and creates a image and hooks all those modules onto that image, so when you load that image reiserfs is loaded, and after that vmlinuz26 can load "reiserfs" module by using the driver from the initrd image for now. After that initrd is no longer needed (since vmlinuz has now loaded the real reiserfs into memory), and is unloaded. and boot process continues.

So short answer: if you compile dm_crypt into kernel, why WOULD YOU NEED initrd to have it?  iinitrd is MEANT for times when you dont want to compile iinto kernel (vmlinuz26) some very important module that is needed for vmlinuz to continue its boot process.

p.s: im not sure how encrypt/decrypt works, but initrd would prbly not be able to load if its inside somewhere encrypted, cuz it iis waht prbly does the decrypting. On the other hand if you have a seperate /boot partition, and "/" partition is encrypted, having dm_crypt inside vmlinuz26 should work. Remember, Whatever has the dm_crypt should be able to read itself FIRST in order to decrypt your HDD and continue.

ETA: link http://wiki.archlinux.org/index.php/Sys … r_dm-crypt

Last edited by TjPhysicist (2008-12-19 13:52:53)


-Tj
Now reborn as Tjh_ (to keep it similar to my username in other places)

Offline

#3 2008-12-19 17:44:52

broch
Banned
From: L.A. California
Registered: 2006-11-13
Posts: 975

Re: mkinitcpio doesn't respect modules compiled into the kernel

make sure that dm_crypt module is not listed in /etc/mkinitcpio.conf

Offline

#4 2008-12-19 23:26:42

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: mkinitcpio doesn't respect modules compiled into the kernel

Rorschach wrote:

So is it a bug with mkinitcipio not respecting if a module has beend compiled into the kernel?

No. When something is compiled in, it is no longer a "module". The code is compiled into the kernel, not as a module. This means that the message is entirely correct: can't find module. That's because you didn't compile one.

You'll have to custom edit the encrypt install script so that it does not include the modules you have compiled into your kernel.

Offline

Board footer

Powered by FluxBB