LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   kernel compilation (https://www.linuxquestions.org/questions/linux-newbie-8/kernel-compilation-143275/)

nelsonnery 02-07-2004 05:26 AM

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 :D !

Thanks a lot for all the help!

NELSON

snacky 02-07-2004 05:32 AM

# 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.

b0uncer 02-07-2004 05:37 AM

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.

/bin/bash 02-07-2004 05:42 AM

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.

benjaminrtz 02-07-2004 05:47 AM

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 !


All times are GMT -5. The time now is 07:23 PM.