LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Question about kernel compilation (https://www.linuxquestions.org/questions/linux-kernel-70/question-about-kernel-compilation-744528/)

dinkyverma279 08-02-2009 10:26 AM

Question about kernel compilation
 
Hi,

I have one more question as follows:

When i do "make menuconfig" and i configure the some driver as "M"

during kernel compilation i am getting like this in one of the line (output during make)

LD drivers/usb/gadget/built-in.o

I was not getting .ko files. Now the thing is when i loaded the kernel image on to board, How do i load this driver as i configured the driver as "M" during kernel config.

why .ko files are not there?

regards,
dinky

brianL 08-02-2009 01:33 PM

After make, run:
make modules_install

GlennsPref 08-02-2009 06:30 PM

Hi, I saw your post's and thought I may be able to shed some light on the subject.

After you configure and save the 2.6.xx.x (.config file) kernel with

make menuconfig or
make xconfig

the next steps are required to get the newly configured kernel installed.

make all (replaces all in red below....)

make clean
make bzImage
Code:

/usr/src/kernel-rt-2.6.29.5-1.rt22.1mdv/arch/x86/boot/bzImage
make modules

make modules_install
make install

if all went well, reboot to new kernel.

I generally append the commands with &&,

this way it will run the next command only if the last was successful.

;; may also be used to append commands, but with no checks. NOT SAFE in this instance

Like this....
Code:

make all && make modules_install && make install && shutdown -r now
Hope this helps.

regards Glenn

Quakeboy02 08-04-2009 07:55 PM

It would also help if you'd add your distro to your options, or wherever it is, like the others users have. The reason is that there is at least Debian and its derivatives that do things a bit differently. I've posted Debian related instructions several times only to find out that the OP needed to use the instructions as posted above.

sundialsvcs 08-05-2009 09:41 PM

It might help to consider just what these various "make" commands need to ultimately do. In other words, "exactly what do I need to somehow accomplish, in order to build an operating-system kernel that works?"
  • The kernel is an intricate piece of software that's designed to run on lots of types of hardware. But the only software that you actually need to build is whatever your system requires. That's the whole point of "configuration." Those hundreds of options, embodied in the hidden file .config, determine exactly what source-code is, and is not, compiled to make your kernel.
  • Linux uses a modular kernel. Modules can be loaded and unloaded on-demand. Nevertheless, all of the modules must be built, so that at the end of the kernel compile you have not only the always-resident kernel portions but also the modules ... all freshly compiled.
  • Believe it or not, when a kernel-compile is finished, you've got a fairly ordinary object-file on your hard disk... but, that alone isn't enough to get that software into memory where it needs to be. Because the kernel's job is to create the system environment, it (alone) cannot rely on that environment. The kernel uses a special loading process to get itself into memory. This means that, somehow, all of the file-setup necessary to do that must somehow be done. If the kernel includes modules, those also must be put into the proper locations so that it all "just works."
The Linux kernel is an intricate program, certainly, but it's not a particularly large one. What's really special about it is: the role that it plays in the grand scheme of things, and the rather peculiar way that it gets loaded into memory and initialied when you first start your computer. (The computer really does "pull itself up by its own boot straps..." :) ) These mechanisms are somewhat esoteric, as they are used nowhere else, but they actually make perfect sense once you understand them. Try to "get the big picture," because once you "see" that, everything else falls into place.

GlennsPref 08-05-2009 10:25 PM

Hi, sundialsvcs makes some good points.

But inparticular....
Quote:

But the only software that you actually need to build is whatever your system requires
I've not tried lately, but how do I know exactly what kernel modules are required?

Apart from lsmod, what other tools/apps do you use to configure a small kernel?

tia Glenn


All times are GMT -5. The time now is 06:15 AM.