You are not logged in.

#1 2021-03-14 01:36:04

AngelicLolipop
Member
Registered: 2021-02-10
Posts: 9

[SOLVED] Compiling Custom Kernel with dm_crypt

I am trying to compile my own kernel to have better power usage and performance of a laptop/tablet. I am new to compiling custom kernels, and for some reason can't get dm_crypt to work. After compiling the kernel and running mkinitcpio it tells me that it can't find the kernel module.

[root@ArchTab angel]# mkinitcpio -p linux511
==> Building image from preset: /etc/mkinitcpio.d/linux511.preset: 'default'
  -> -k /boot/vmlinuz-linux511 -c /etc/mkinitcpio.conf -g /boot/initramfs-linux511.img
==> Starting build: 5.11.6
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [keyboard]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
  -> Running build hook: [encrypt]
==> ERROR: module not found: `dm_crypt'
==> ERROR: module not found: `dm_integrity'
  -> Running build hook: [filesystems]
  -> Running build hook: [fsck]
==> WARNING: No modules were added to the image. This is probably not what you want.
==> Creating gzip-compressed initcpio image: /boot/initramfs-linux511.img
==> WARNING: errors were encountered during the build. The image may not be complete.
==> Building image from preset: /etc/mkinitcpio.d/linux511.preset: 'fallback'
  -> -k /boot/vmlinuz-linux511 -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback511.img -S autodetect
==> Starting build: 5.11.6
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [keyboard]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
  -> Running build hook: [encrypt]
==> ERROR: module not found: `dm_crypt'
==> ERROR: module not found: `dm_integrity'
  -> Running build hook: [filesystems]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-linux-fallback511.img
==> WARNING: errors were encountered during the build. The image may not be complete.

I was following the instructions from the gentoo wiki on dm_crypt here, specifically talking about the kernel. I am using the stable kernel from kerenl.org 5.11.6.

I have Crypt target support built into the kernel, but it doesn't find it when I mkinitcpio.

Last edited by AngelicLolipop (2021-03-21 01:47:56)

Offline

#2 2021-03-14 07:38:52

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: [SOLVED] Compiling Custom Kernel with dm_crypt

I guess you might have made the modules "built-in" for your kernel? You then don't have dm-crypt.ko and dm-integrity.ko files anymore but dm-crypt is still part of your kernel and working. The error message is perhaps just about the tool looking for the .ko file and not finding it. If this is correct, you should be able to safely ignore the error message.

Last edited by Ropid (2021-03-14 07:39:19)

Offline

#3 2021-03-14 07:55:38

frostschutz
Member
Registered: 2013-11-15
Posts: 1,647

Re: [SOLVED] Compiling Custom Kernel with dm_crypt

check kernel .config for CONFIG_DM_CRYPT=m or CONFIG_DM_CRYPT=y

you also have to enable the various crypto ciphers themselves (CONFIG_CRYPTO_*), dm-crypt is just the front-end to those

Offline

#4 2021-03-14 15:59:46

AngelicLolipop
Member
Registered: 2021-02-10
Posts: 9

Re: [SOLVED] Compiling Custom Kernel with dm_crypt

frostschutz wrote:

check kernel .config for CONFIG_DM_CRYPT=m or CONFIG_DM_CRYPT=y

you also have to enable the various crypto ciphers themselves (CONFIG_CRYPTO_*), dm-crypt is just the front-end to those

Should the crypto parameters in the kernel be modules or built in? I have them built in right now, but when I tried to make them modules it still didn't work(unless modules are not contained in bzImage, since I am compiling on one machine and sending the files over to the other machine.

Offline

#5 2021-03-15 17:03:45

loqs
Member
Registered: 2014-03-06
Posts: 18,917

Re: [SOLVED] Compiling Custom Kernel with dm_crypt

AngelicLolipop wrote:

Should the crypto parameters in the kernel be modules or built in? I have them built in right now, but when I tried to make them modules it still didn't work(unless modules are not contained in bzImage, since I am compiling on one machine and sending the files over to the other machine.

Modules are not contained in the bzImage.  They are separate files with the .ko extension or .ko.X where X denotes the compression type used to compress the module.
Did you make the modules?  `make modules` or as part of `make all`

Offline

#6 2021-03-21 01:47:27

AngelicLolipop
Member
Registered: 2021-02-10
Posts: 9

Re: [SOLVED] Compiling Custom Kernel with dm_crypt

Oh okay thanks

Offline

Board footer

Powered by FluxBB