LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Kernel modules (https://www.linuxquestions.org/questions/slackware-14/kernel-modules-504318/)

brooky9999 11-23-2006 05:38 PM

Kernel modules
 
Hi,

I'm using Slack 10.2 with a custom kernel.

When you download/install/compile a custom kernel, where do the kernel modules come from?

Many thanks,


Mark.

masonm 11-23-2006 05:51 PM

Quote:

Originally Posted by brooky9999
Hi,

I'm using Slack 10.2 with a custom kernel.

When you download/install/compile a custom kernel, where do the kernel modules come from?

Many thanks,


Mark.

They are built when you do "make modules" and installed when you do "make modules_install". Pretty obvious really.

If you're asking where the code comes from, it's part of the kernel source.

Brian1 11-23-2006 06:16 PM

If using 2.6 kernels the correct commands is
make Bulid the kernel and modules
make modules_install

The make now does the kernel image and modules both with the single command.

In 2.4 kernels you would do a
make to build the kernel
make modules to build the modules
make modules_install to place them in /lib/modules

Brian

masonm 11-23-2006 07:19 PM

Quote:

Originally Posted by Brian1
If using 2.6 kernels the correct commands is
make Bulid the kernel and modules
make modules_install

The make now does the kernel image and modules both with the single command.

In 2.4 kernels you would do a
make to build the kernel
make modules to build the modules
make modules_install to place them in /lib/modules

Brian

Yeah, you're right. I keep forgetting about that. Old habits LOL

Brian1 11-23-2006 07:22 PM

Old habits, over 10 years in linux and I still do some of the simpliest things the old fashion way

masonm 11-23-2006 07:27 PM

Quote:

Originally Posted by Brian1
Old habits, over 10 years in linux and I still do some of the simpliest things the old fashion way

Ditto :rolleyes: :D

brooky9999 11-24-2006 03:11 AM

Hiya all,

The reason I as is that after compiling 2.6.18.3, my /lib/modules/2.6.18.3/kernel folder is empty.

Shouldn't it have a drivers folder which is full of goodies that I've compiled?


M.

masonm 11-24-2006 08:42 AM

Did you skip the "make modules_install" step? Sounds like it. just go to the kernel source directory and run the command. If it's already been compiled it should go ahead and install the modules.

brooky9999 11-27-2006 03:17 AM

Hiya Masonm,

No I didn't skip that step... I always make sure I run that.

I'm stumped http://images.linuxquestions.org/que...milies/mad.gif
:mad:



Mark.

synapse 11-27-2006 06:07 AM

make modules_install
^

didnt leave the underscore out did you ??

brooky9999 11-27-2006 06:48 AM

Hi synapse,

No, definately got the underscore in there.

I'm wondering, am I barking up the wrong tree here? If I compile everyting into the kernel directly (which I tend to do) and not as modules, then will I see anything in the /lib/modules/2.6.18.3/kernel folder?


Mark.

WindowBreaker 11-27-2006 12:15 PM

To get a list of compiled modules that should be under your /lib/modules/2.6.18.3 directory, run the following command:
Code:

grep -i '=M' /usr/src/linux-2.6.18.3/.config
To see a list of any kernel modules in that dir:
Code:

find /lib/modules/2.6.18.3 -type f -name '*.ko'
To get a count of how many modules are in there:
Code:

find /lib/modules/2.6.18.3 -type f -name '*.ko' | wc -l
I have 1583 kernel modules shown from running the previous command.
Of course, if the first command doesn't show any compile options selected as modules, then it makes sense that the directory structure was created by 'make modules_install', but no actual modules were placed there.

Good luck

malo_umoran 11-27-2006 12:52 PM

Quote:

Originally Posted by WindowBreaker
To get a list of compiled modules that should be under your /lib/modules/2.6.18.3 directory, run the following command:
Code:

grep -i '=M' /usr/src/linux-2.6.18.3/.config
To see a list of any kernel modules in that dir:
Code:

find /lib/modules/2.6.18.3 -type f -name '*.ko'
To get a count of how many modules are in there:
Code:

find /lib/modules/2.6.18.3 -type f -name '*.ko' | wc -l
I have 1583 kernel modules shown from running the previous command.
Of course, if the first command doesn't show any compile options selected as modules, then it makes sense that the directory structure was created by 'make modules_install', but no actual modules were placed there.

Good luck

1583??????

M.

masonm 11-27-2006 12:53 PM

If you compiled everything into the kernel instead of as modules you have your answer.

malo_umoran 11-27-2006 01:01 PM

hmmm ... maybe, but it is still pretty much. I thin, I would not reach 300 when I would compile everything in modules.


All times are GMT -5. The time now is 04:06 PM.