Click to See Complete Forum and Search --> : How do you compile the kernel?


Dark Millennium
August 25th, 2003, 09:33 AM
Hi guys,

Long time no post....

Anyway I just wanted to know how are you supposed to install/compile a kernel.

I followed daemon's links to the kernel documentation project and followed the steps listed there but it didn't work.

I kept getting an error about "Unable to mount root file system. Please append a proper label to root=".

I checked my grub.conf file and am certain it was configured properly.

The initrd image also seemed to be correct.

Could someone please tell me, step by step what I'm supposed to do to compile a kernel?

I'm using redhat 9.0, and I do not use scsi if that makes a difference....

Thanks for any help you can provide....:) I'm also trying to compile kernel 2.4.21...

+Daemon+
August 25th, 2003, 10:32 AM
go into kernel src directory

/usr/src/linux

type the following

make mrproper
make menuconfig (or make xconfig or make xmenuconfig - for Xwindows)
make dep
make bzImage
make modules

cd /usr/src/linux/arch/i386/boot/
cp bzImage /boot

edit lilo.conf ot grub.conf

you will want to use the menuconig to take out things you dont need and put things in that you will need..

also never remove your stock kernel, just add another line to your grub and or lilo config file so you can boot from your old kernel as well as your new kernel

+Daemon+
August 25th, 2003, 02:34 PM
some help from redhat

http://www.europe.redhat.com/documentation/HOWTO/Kernel-HOWTO-2.php3

Dark Millennium
August 26th, 2003, 08:40 PM
Thanks for the link and the advice...

I'm at this point a little frustrated with the box but will be giving all this a try asap.

Thanks again :)

tazman
August 26th, 2003, 10:13 PM
I see a step in a previous post was missed. Try this: cd /usr/src/linux
make xconfig (gui config) - Select various drivers and modules to suit your needs.

make dep (checks dependencies)
make clean (cleans unused items)
make bzImage (remember the "i" is capitalized)
make modules (sets the chosen modules)
make modules_install (installs the modules into the kernel)
This should take some time so be patient and watch for any driver or module blow-outs due to dependencies or you may have to go back to step 1 and repair the dep's.
When successfully finished :
cp /arch/i386/boot/bzImage /boot/vmlinuz-"name". Make sure you name the image to something other than just vmlinuz or it may overwrite your default kernel image.
After you've done this, edit the /boot/grub/menu.lst with the new kernel info and rerun grub. If you're using lilo, edit the /etc/lilo.conf file and rerun lilo.install the new boot info. Good Luck.

+Daemon+
August 30th, 2003, 05:19 PM
Originally posted by tazman
I see a step in a previous post was missed. Try this: cd /usr/src/linux
make xconfig (gui config) - Select various drivers and modules to suit your needs.

make dep (checks dependencies)
make clean (cleans unused items)
make bzImage (remember the "i" is capitalized)
make modules (sets the chosen modules)
make modules_install (installs the modules into the kernel)
This should take some time so be patient and watch for any driver or module blow-outs due to dependencies or you may have to go back to step 1 and repair the dep's.
When successfully finished :
cp /arch/i386/boot/bzImage /boot/vmlinuz-"name". Make sure you name the image to something other than just vmlinuz or it may overwrite your default kernel image.
After you've done this, edit the /boot/grub/menu.lst with the new kernel info and rerun grub. If you're using lilo, edit the /etc/lilo.conf file and rerun lilo.install the new boot info. Good Luck.

well I tryed compiling the 2.5 kernel for kicks (I guess its not being worked on anymore) and any-who its pretty neat how you compile it, you basicly just type

make menuconfig
make
make modules_install

pretty simple...humm to try 2.6