Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Linux - Kernel This forum is for all discussion relating to the Linux kernel.


  Search this Thread
Old 08-02-2009, 11:26 AM   #1
LQ Newbie
Registered: Jun 2009
Posts: 29

Rep: Reputation: 15
Question about kernel compilation


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?

Old 08-02-2009, 02:33 PM   #2
LQ 5k Club
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 7,453
Blog Entries: 55

Rep: Reputation: Disabled
After make, run:
make modules_install
Old 08-02-2009, 07:30 PM   #3
Senior Member
Registered: Apr 2004
Location: Brisbane, Australia
Posts: 3,366
Blog Entries: 33

Rep: Reputation: 216Reputation: 216Reputation: 216
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
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....
make all && make modules_install && make install && shutdown -r now
Hope this helps.

regards Glenn

Last edited by GlennsPref; 08-02-2009 at 07:36 PM. Reason: concatination of commands
Old 08-04-2009, 08:55 PM   #4
Senior Member
Registered: Nov 2006
Distribution: Debian Squeeze SMP AMD64
Posts: 3,275

Rep: Reputation: 126Reputation: 126
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.
Old 08-05-2009, 10:41 PM   #5
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 7,343

Rep: Reputation: 2298Reputation: 2298Reputation: 2298Reputation: 2298Reputation: 2298Reputation: 2298Reputation: 2298Reputation: 2298Reputation: 2298Reputation: 2298Reputation: 2298
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.

Last edited by sundialsvcs; 08-05-2009 at 10:43 PM.
Old 08-05-2009, 11:25 PM   #6
Senior Member
Registered: Apr 2004
Location: Brisbane, Australia
Posts: 3,366
Blog Entries: 33

Rep: Reputation: 216Reputation: 216Reputation: 216
Hi, sundialsvcs makes some good points.

But inparticular....
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
question on kernel compilation shellarchive Red Hat 1 09-29-2007 04:34 AM
Kernel Compilation Question yougene Slackware 9 11-24-2005 01:29 AM
Some question about the Kernel 2.6.10 compilation Shagrath239 Slackware 5 02-20-2005 01:01 PM
kernel compilation question plisken Linux - General 12 12-09-2004 03:04 PM
Kernel compilation question spotz78 Linux - Newbie 2 10-07-2004 09:47 AM

All times are GMT -5. The time now is 09:53 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration