LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-07-2004, 05:26 AM   #1
nelsonnery
Member
 
Registered: May 2003
Distribution: Mandriva 2005
Posts: 57

Rep: Reputation: 15
kernel compilation


Hi!

I have a (possibly) stupid question.

I got an rpm with the source kernel for a certain kernel.

I installed it and compiled it as described below and it works fine.

After I do "make menuconfig" I know that I have to do "make dep".

The question is, are the following steps always required after the two steps mentioned above?

# make clean
# make bzImage
# make modules
# make modules_install
# cp /usr/scr/linux-2.6.1/arch/i386/boot/bzImage /boot/vmlinuz-2.6.1via
# mkinitrd /boot/initrd-2.6.1via 2.6.1via
(/lib/modules/2.6.1via)
- Copy /usr/src/linux-2.6.1/System.map to System.map-2.6.1via and .config
to config-2.6.1via into /boot


If not, can someone please tell me what is the necessary stuff to do after I change something in the kernel?

I am sorry if this is really obvious but I am still a REAL newbie and the fact that the site kernel-HOWTO is down doesn't help !

Thanks a lot for all the help!

NELSON
 
Old 02-07-2004, 05:32 AM   #2
snacky
Member
 
Registered: Feb 2004
Distribution: Debian
Posts: 286

Rep: Reputation: 30
# make clean
Not necessary for the very first time you build. Often not necessary for the second time either, but for now it can't hurt to run it...
# make bzImage
This is now redundant. In 2.6, "make" implies making a bzImage. You can just type "make" all by itself.
# make modules
This is also redundant. These steps are performed the first time you type "make" by itself.
# make modules_install
Required. (except in certain circumstances but don't even worry 'bout it until you know what you're doing)
# cp /usr/scr/linux-2.6.1/arch/i386/boot/bzImage /boot/vmlinuz-2.6.1via
# mkinitrd /boot/initrd-2.6.1via 2.6.1via
(/lib/modules/2.6.1via)
- Copy /usr/src/linux-2.6.1/System.map to System.map-2.6.1via and .config
to config-2.6.1via into /boot

If you use LILO, "make install" will perform these necessary steps for you - then, all you really have to do is to reboot.

Last edited by snacky; 02-07-2004 at 05:34 AM.
 
Old 02-07-2004, 05:37 AM   #3
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Well, according to what I've done when compiling my kernels (I've done it a few times..heheh) I'd say you need to

make menu(or whatever)config
make bzImage
make modules
make modules_install
cp where-ever-you-are/arch/i386/boot/bzImage /boot/whatever-you-use
cp where-ever-you-are/System.map /boot/System.map

and that's it. make clean "cleans" the installation, and isn't that way necessary for the kernel to work - still, if you like cleaning, do it I guess many do. Copying config isn't needed, I think....why would it be?

So bzImage is the kernel image, and you need it if you wish to boot it if you have selected anything to be compiled as modules, you need to "make modules" and then install them via "make modules_install"... System.map is, as it's name tells, a map of System (haven't checked out it that well, but I'd say it's needed) and...initrd is "initial ram disk", and at least I don't ever copy or make that one. Not on a normal kernel compilation, that is and do the "clean" if you wish, but it won't basically affect your kernel's compilation.

EDIT:

I no more use LILO, haven't used it for a while because I didn't like it's "you mus rerun lilo-stuff every time you do something to your kernel" grub doesn't ask that..just to update it's config & boot. not a big deal, but well....I've learnt to like grub, even though LILO was a good friend earlier.

Last edited by b0uncer; 02-07-2004 at 05:41 AM.
 
Old 02-07-2004, 05:42 AM   #4
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 47
For 2.6 kernel make dep is not necessary anymore. Also you can combine some of the steps e.g.
make all
This replaces these three commands; make clean; make bzImage; make modules.

Another thing is if you only want to add a module, quite often you can run make menuconfig add the module then just do make modules without make clean and it will save you a lot of time. Then you can copy the module from the kernel tree to the module tree manually and do depmod -a. This is not guaranteed to work all the time, but I use it a lot when I forget to add something and later I want to add it without building a whole new kernel.
 
Old 02-07-2004, 05:47 AM   #5
benjaminrtz
Member
 
Registered: Jul 2002
Location: India
Distribution: Ubuntu, Gentoo
Posts: 99

Rep: Reputation: 15
Quote:
Originally posted by snacky
# make clean
Not necessary for the very first time you build. Often not necessary for the second time either, but for now it can't hurt to run it...
# make bzImage
This is now redundant. In 2.6, "make" implies making a bzImage. You can just type "make" all by itself.
# make modules
This is also redundant. These steps are performed the first time you type "make" by itself.
# make modules_install
Required. (except in certain circumstances but don't even worry 'bout it until you know what you're doing)
# cp /usr/scr/linux-2.6.1/arch/i386/boot/bzImage /boot/vmlinuz-2.6.1via
# mkinitrd /boot/initrd-2.6.1via 2.6.1via
(/lib/modules/2.6.1via)
- Copy /usr/src/linux-2.6.1/System.map to System.map-2.6.1via and .config
to config-2.6.1via into /boot

If you use LILO, "make install" will perform these necessary steps for you - then, all you really have to do is to reboot.
Thx!!!
Just what I have been wondering with the 2.6. kernel
Since I am lazy !! After make modules_install , I just do make install !
 
  


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
kernel compilation-From where it should be started for already compiled kernel b0nd Linux - Newbie 11 08-17-2005 01:08 PM
kernel compilation : to remove a kernel which files should be deleted b0nd Linux - Newbie 2 08-17-2005 11:35 AM
Kernel compilation problems, distorted video and kernel panic shamrock_uk Linux - Laptop and Netbook 5 08-12-2005 10:53 PM
does kernel-source installs with the compilation cum installtion of a new kernel? luqman Linux - General 18 03-04-2005 07:33 AM
Kernel Compilation radhapriya Programming 1 05-17-2003 06:32 AM


All times are GMT -5. The time now is 03:09 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration