You are not logged in.

#1 2014-07-28 12:28:35

Moosey_Linux
Member
From: Malmö Sweden
Registered: 2012-07-01
Posts: 44

[SOLVED] How to add modules to build with the kernel?

Hello i´m trying to learn how to build my own custom kernel and doing it the arch way https://wiki.archlinux.org/index.php/Ke … raditional. But unfortunately dm-crypt was not included in the kernel so it all failed.

svart_alg% sudo mkinitcpio -k 3.15.6 -c /etc/mkinitcpio.conf -g /boot/initramfs-test.img
==> Starting build: 3.15.6
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [lvm2]
==> ERROR: module not found: ‘dm-snapshot’
  -> Running build hook: [encrypt]
==> ERROR: module not found: ‘dm-crypt’
  -> Running build hook: [block]
  -> Running build hook: [filesystems]
  -> Running build hook: [keyboard]
  -> Running build hook: [fsck]
==> WARNING: No modules were added to the image. This is probably not what you want.
==> Creating gzip initcpio image: /boot/initramfs-test.img
==> WARNING: errors were encountered during the build. The image may not be complete.

I have never don any of this before and have no idea of how to add a missing module to the kernel i´m building. So i search on internet and had a very hard time finding a good guide for this but i fond one possible solution. https://www.kernel.org/doc/Documentatio … odules.txt

svart_alg% make -C /home/nigro_alko/Kernel/linux-3.15.6 M=/home/nigro_alko/Kernel/cryptsetup-1.6.5/Makefile.in
make: Entering directory ‘/home/nigro_alko/Kernel/linux-3.15.6‘
mkdir: cannot create directory ‘/home/nigro_alko/Kernel/cryptsetup-1.6.5/Makefile.in’: Not a directory
scripts/Makefile.build:44: /home/nigro_alko/Kernel/cryptsetup-1.6.5/Makefile.in/Makefile: Not a directory
make[1]: *** No rule to make target ‘/home/nigro_alko/Kernel/cryptsetup-1.6.5/Makefile.in/Makefile’.  Stop.
Makefile:1310: recipe for target ‘_module_/home/nigro_alko/Kernel/cryptsetup-1.6.5/Makefile.in’ failed
make: *** [_module_/home/nigro_alko/Kernel/cryptsetup-1.6.5/Makefile.in] Error 2
make: Leaving directory ‘/home/nigro_alko/Kernel/linux-3.15.6‘

So is there any one that have time to help a lost little newbie i would bee very happy  :-)

Last edited by Moosey_Linux (2014-07-29 15:00:40)

Offline

#2 2014-07-28 12:59:24

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] How to add modules to build with the kernel?

Excuse me, but initramfs is not the linux kernel. Read the wiki.
What exactly are you trying to do?


Have you read https://wiki.archlinux.org/index.php/Ke … ll_modules ?

Maybe you should start with https://wiki.archlinux.org/index.php/Ke … ild_System , it may be easier to make a custom kernel this way.
Why do you want a custom kernel in the first place?

Last edited by karol (2014-07-28 13:01:14)

Offline

#3 2014-07-28 15:38:30

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED] How to add modules to build with the kernel?

karol wrote:

Why do you want a custom kernel in the first place?

Moosey_Linux wrote:

i´m trying to learn how to build my own custom kernel

Reason enough IMO. But anyway... you refer to the Traditional build method in the wiki, but is it possible you didn't really read it? Or maybe you only skimmed it? Did you run make menuconfig? Did you try to build everything in instead of using modules? That mkinitcpio output suggests that you did.

As suggested there for first-timers, it's a good idea to start with a kernel configuration that is known to work - the Arch config is the obvious choice, but there are other sources e.g. http://kernel-seeds.org/ .

Offline

#4 2014-07-28 15:56:01

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] How to add modules to build with the kernel?

I meant: what exactly is your custom kernel supposed to do, what's the difference between your custom kernel and the stock one?

Offline

#5 2014-07-28 16:02:33

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: [SOLVED] How to add modules to build with the kernel?

1. cd to your kernel source directory
2. run make menuconfig
3. select DM_CRYPT as a module from menuconfig. use '/' to search if you can't find it.
4. recompile the kernel and make modules_install

If you're building your own kernel for the first time ever, it might be better to start off with the stock arch kernel .config, and start working from there.

Last edited by ooo (2014-07-28 16:11:37)

Offline

#6 2014-07-29 15:00:17

Moosey_Linux
Member
From: Malmö Sweden
Registered: 2012-07-01
Posts: 44

Re: [SOLVED] How to add modules to build with the kernel?

Thanks for all the replays specially thanks to ooo for the tip to search whit / it helped me find  dm_crypt and now i can build my kernel :-)

To the question way I want to build my own kernel. It all started whit me trying to use apparmor and realist that i had to patch the kernel to use it. I den decided that i know nothing of how the kernel works and how to build it so a had to learn. And the best way to do that is to use the wiki and yest try and try until I got it.

Any ways thanks again for all the help i mark this as solved but if you have moor god tips on haw should approach my kernel building i love to hear it so thanks thanks thanks :-)

Offline

Board footer

Powered by FluxBB