LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

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

Rep: Reputation: 15
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
 
Old 08-02-2009, 01:33 PM   #2
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 6,970
Blog Entries: 52

Rep: Reputation: Disabled
After make, run:
make modules_install
 
Old 08-02-2009, 06:30 PM   #3
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Mageia Studio-13.37 Kubuntu.
Posts: 3,325
Blog Entries: 33

Rep: Reputation: 199Reputation: 199
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

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

Rep: Reputation: 121Reputation: 121
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, 09:41 PM   #5
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,366

Rep: Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106
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 09:43 PM.
 
Old 08-05-2009, 10:25 PM   #6
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Mageia Studio-13.37 Kubuntu.
Posts: 3,325
Blog Entries: 33

Rep: Reputation: 199Reputation: 199
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
 
  


Reply


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 03:34 AM
Kernel Compilation Question yougene Slackware 9 11-24-2005 12:29 AM
Some question about the Kernel 2.6.10 compilation Shagrath239 Slackware 5 02-20-2005 12:01 PM
kernel compilation question plisken Linux - General 12 12-09-2004 02:04 PM
Kernel compilation question spotz78 Linux - Newbie 2 10-07-2004 08:47 AM


All times are GMT -5. The time now is 02:24 AM.

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