LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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-11-2008, 08:54 PM   #1
unikgila
LQ Newbie
 
Registered: Jul 2008
Posts: 27

Rep: Reputation: 15
ask about compiling kernel


Hi all,

Suppose i have kernel source at /usr/src/linux
I found the drivers in the /usr/src/linux/drivers tree. And try to modify some codes in the drivers folder.

My question is how can i compile the code that i have modified?

I have tried this sequence:
1. make menuconfig
2. make dep
3. make zImage
4. make module
5. make module_install

is it right?
 
Old 08-11-2008, 09:00 PM   #2
johnson_steve
Senior Member
 
Registered: Apr 2005
Location: BrewCity, USA (Milwaukee, WI)
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152

Rep: Reputation: 46
well I'm on gentoo so it might be a bit different, but if all you did was change the source a bit I would think:
Code:
make && make modules_install
should suffice. Then install the new kernel so you bootloader loads it instead of your old one. This always works for me.

Last edited by johnson_steve; 08-11-2008 at 09:02 PM.
 
Old 08-12-2008, 01:42 AM   #3
darthaxul
Member
 
Registered: Aug 2008
Distribution: Devuan; Gentoo; FreeBSD
Posts: 236

Rep: Reputation: 19
kernel

you shouldnt have to modify anything in drivers folder unless u got some obscure or really brand new hardware.
but yeah those commands should work u also need to make an initramfs image as well.
 
Old 08-12-2008, 01:48 AM   #4
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
If you use one of the Debian branch of distros, it would be more like:
make-kpkg clean && fakeroot make-kpkg --initrd --append-to-version=-(whatever_you_like) kernel_image kernel_headers

I do not quite agree with the previous poster. What is the point of compiling your own kernel if you are not going to reconfigure it?

Last edited by jay73; 08-12-2008 at 01:49 AM.
 
Old 08-12-2008, 03:03 AM   #5
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
Quote:
I have tried this sequence:
and it does not work? or does it?

1. make menuconfig
2. make dep - not necessary after 1.
3. make zImage ... I never do that...
4. make module ... the command should be make modules
5. make module_install ... dito here: make modules_install


my sequence is:

make menuconfig
make
make modules_install
make install (or copying arch/i386/boot/bzImage directly to where you need it to be)

Basically: the exact same process as you always do.
 
Old 08-12-2008, 07:19 AM   #6
unikgila
LQ Newbie
 
Registered: Jul 2008
Posts: 27

Original Poster
Rep: Reputation: 15
sorry i didn't mention that work's result. because i didn't try it yet
I just want to make sure that the compilation that codes occur in make modules and make modules_install step ?

I tried to modify with error and there is no error when i using these steps:
1. make menu_config
2. make dep
3. make zImage

I didn't install the modules yet, so that's why i suggest that error should be occur in make modules or make modules_install.

am i correct?
 
Old 08-12-2008, 09:02 AM   #7
johnson_steve
Senior Member
 
Registered: Apr 2005
Location: BrewCity, USA (Milwaukee, WI)
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152

Rep: Reputation: 46
Quote:
Originally Posted by darthaxul View Post
you shouldnt have to modify anything in drivers folder unless u got some obscure or really brand new hardware.
but yeah those commands should work u also need to make an initramfs image as well.
I have had to edit the kernel source on two occasions: To get my tv tuner card to work I had to hard code the tuner number into the source otherwise it would always be 5 even if I tried to change it, and to get the driver for a USB wifi stick to compile on a ppc mac I had to tweak it a bit. I don't use an initrd, if you do you will have to make a new one otherwise it will load the old stuff from the old initrd. If that still doesn't work maybe start with a 'make clean' to get rid of any old object files before you compile the kernel.
 
  


Reply



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
Compiling a module separately without compiling entire kernel kushalkoolwal Linux - Kernel 8 08-06-2008 01:45 AM
/lib/modules/2.4.33.3/kernel/sound folder is missing after compiling kernel Paulo Góes Slackware - Installation 2 04-15-2007 08:42 PM
Where Is Kernel Directory In Rh9(kernel 2.4.20-8), For Compiling HSP56 MR(pctel) Mode rudy3107 Linux - Software 1 07-25-2004 04:17 AM
Kernel compiling and module compiling tarballed Linux - General 1 12-22-2002 05:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 03:46 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration