Re: COMPILING AND CONFIGURING A NEW KERNEL.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: johnrobertbanks
Date: Friday, April 6, 2007 - 6:26 pm

This is a reply to an email that I accidentally deleted.

COMPILING AND CONFIGURING A NEW KERNEL.

Download a recent kernel from http://www.kernel.org/
I will use the kernel linux-2.6.20.tar.bz2

You will have to change details of the following to suit your purposes.

Save it in /usr/src/
# mv linux-2.6.20.tar.bz2 /usr/src/

Unzip the kernel package
# tar -jxf linux-2.6.20.tar.bz2

Copy the original kernel configuration file (that came with your distro)
to .config
# cp /boot/config-2.6.20 /usr/src/linux-2.6.20/.config

Look at the available kernel building options
# make help

Run oldconfig to update the original kernel config to a current config
# make oldconfig

Use menuconfig (or xconfig or gconfig) to make any further changes
# make menuconfig

YOU SHOULD compile all the drivers necessary to boot your system, into
the kernel (ie, such drivers should not be built as modules).

This way you will NOT need an initrd file.

Use rpm-pkg to create a Red Hat RPM kernel package.
# make rpm-pkg

Went built, the RPM package is put in
/usr/src/packages/RPMS/*your*architecture*

# cd /usr/src/packages/RPMS/x86_64

Install the package (you may have to un-install previous installs)
# rpm -i kernel-2.6.20-1.x86_64.rpm

Use deb-pkg to create a Debian .deb kernel package.
# make deb-pkg

Went built, the .deb package is put in /usr/src/
# cd /usr/src/

Install the package (you may have to un-install previous installs)
# dpkg --install linux-2.6.20_2.6.20_amd64.deb

If you were unable to determine which drivers you need (to boot), then
you will need an initrd file. To build it use the command
# mkinitrd -o /boot/initrd-2.6.20

IF YOU ARE CUSTOMIZING YOUR KERNEL, YOU SHOULD PUT IN THE EFFORT TO
BUILD A KERNEL THAT DOES NOT NEED AN INITRD FILE.

------------------------------------------------------

Now you need to configure your kernel. Using GRUB you need to change the
menu.lst file.

# emacs /boot/grub/menu.lst &

The grub entry that you boot with will look something like:

###Don't change this comment - YaST2 identifier: Original name: linux###
title SUSE LINUX 10.0
    root (hd0,2)
    kernel /boot/vmlinuz root=/dev/hda3 resume=/dev/hda5 vga=0x317
    video=vesafb:nomtrr splash=silent
    initrd /boot/initrd

Leave the old boot entry so you can boot it if things go wrong with the
new kernel.
Cut and paste a copy of it above the old one. Then adjust the copy for
the new kernel.

###Don't change this comment - YaST2 identifier: Original name: linux###
title MY NEW KERNEL
    root (hd0,2)
    kernel /boot/linux-2.6.20 root=/dev/hda3 resume=/dev/hda5 vga=0x317
    video=vesafb:nomtrr splash=silent

Of course, you don't need a initrd entry as you have compiled in all the
vital drivers,... right?
If you could not determine the vital drivers and needed to build an
initrd file, then you need an entry, like

    initrd /boot/initrd-2.6.20

------------------------------------------------------

If your new kernel is destined to have the same name as the old one, you
need to do something about it (unless you do not mind the old one being
overwritten).

Use your favorite text editor to change the top level Makefile
# emacs /usr/src/linux-2.6.20/Makefile &

change the line 
EXTRAVERSION
to 
EXTRAVERSION = something

This will change the name of the new kernel to linux-2.6.20-something

Your /boot/grub/menu.lst entry will now look something like:

###Don't change this comment - YaST2 identifier: Original name: linux###
title MY NEW KERNEL
    root (hd0,2)
    kernel /boot/linux-2.6.20-something root=/dev/hda3 resume=/dev/hda5
    vga=0x317 video=vesafb:nomtrr splash=silent

and perhaps an entry

    initrd /boot/initrd-2.6.20-something

------------------------------------------------------

Now reboot and choose the "MY NEW KERNEL" entry from the GRUB boot menu,
and see how you went.


------------------------------------------------------


On Thu, 05 Apr 2007 17:05:21 -0700, johnrobertbanks@fastmail.fm said:
-- 
  
  johnrobertbanks@fastmail.fm

-- 
http://www.fastmail.fm - mmm... Fastmail...

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
REISER4: fix for reiser4_write_extent, Ignatich, (Thu Apr 5, 3:42 pm)
Re: Reiser4. BEST FILESYSTEM EVER? I need help., johnrobertbanks, (Thu Apr 5, 5:05 pm)
Re: Reiser4. BEST FILESYSTEM EVER? I need help., H. Peter Anvin, (Thu Apr 5, 5:23 pm)
Re: Reiser4. BEST FILESYSTEM EVER? I need help., johnrobertbanks, (Thu Apr 5, 5:34 pm)
Re: Reiser4. BEST FILESYSTEM EVER? I need help., H. Peter Anvin, (Thu Apr 5, 5:39 pm)
Re: Reiser4. BEST FILESYSTEM EVER., johnrobertbanks, (Thu Apr 5, 6:34 pm)
Re: Reiser4. BEST FILESYSTEM EVER., Valdis.Kletnieks, (Thu Apr 5, 8:12 pm)
Re: Reiser4. BEST FILESYSTEM EVER., H. Peter Anvin, (Thu Apr 5, 9:07 pm)
Re: Reiser4. BEST FILESYSTEM EVER., johnrobertbanks, (Thu Apr 5, 9:32 pm)
Re: COMPILING AND CONFIGURING A NEW KERNEL., johnrobertbanks, (Fri Apr 6, 6:26 pm)
Re: COMPILING AND CONFIGURING A NEW KERNEL., johnrobertbanks, (Sat Apr 7, 12:45 am)
Re: REISER4: fix for reiser4_write_extent, Laurent Riffard, (Sat Apr 7, 5:51 am)
Re: COMPILING AND CONFIGURING A NEW KERNEL., Valdis.Kletnieks, (Sat Apr 7, 9:42 am)
Re: COMPILING AND CONFIGURING A NEW KERNEL., Valdis.Kletnieks, (Sat Apr 7, 9:57 am)
Re: Reiser4. BEST FILESYSTEM EVER., Lennart Sorensen, (Sat Apr 7, 12:17 pm)
Re: REISER4: fix for reiser4_write_extent, Edward Shishkin, (Sat Apr 7, 12:29 pm)
Re: Reiser4. BEST FILESYSTEM EVER., johnrobertbanks, (Sat Apr 7, 5:44 pm)
Re: COMPILING AND CONFIGURING A NEW KERNEL., johnrobertbanks, (Sat Apr 7, 6:02 pm)
Re: COMPILING AND CONFIGURING A NEW KERNEL., johnrobertbanks, (Sat Apr 7, 6:11 pm)
Re: Reiser4. BEST FILESYSTEM EVER., Lennart Sorensen, (Sat Apr 7, 6:27 pm)
Re: COMPILING AND CONFIGURING A NEW KERNEL., Lennart Sorensen, (Sat Apr 7, 6:42 pm)
Re: Reiser4. BEST FILESYSTEM EVER., Theodore Tso, (Sat Apr 7, 7:56 pm)
Re: Reiser4. BEST FILESYSTEM EVER., johnrobertbanks, (Sat Apr 7, 9:13 pm)
Re: Reiser4. BEST FILESYSTEM EVER., Christer Weinigel, (Sat Apr 7, 9:32 pm)
Re: Reiser4. BEST FILESYSTEM EVER., Jose Celestino, (Sun Apr 8, 5:48 am)
Re: Reiser4. BEST FILESYSTEM EVER., johnrobertbanks, (Sun Apr 8, 6:21 am)
Re: Reiser4. BEST FILESYSTEM EVER., Willy Tarreau, (Sun Apr 8, 7:14 am)
Re: Reiser4. BEST FILESYSTEM EVER., Theodore Tso, (Sun Apr 8, 10:03 am)
Re: Reiser4. BEST FILESYSTEM EVER., Jeff Mahoney, (Sun Apr 8, 11:18 am)
Re: Reiser4. BEST FILESYSTEM EVER - Christer Weinigel, johnrobertbanks, (Sun Apr 8, 2:50 pm)
Re: Reiser4. BEST FILESYSTEM EVER - Christer Weinigel, Richard Knutsson, (Sun Apr 8, 3:58 pm)
Re: Reiser4. BEST FILESYSTEM EVER - Christer Weinigel, johnrobertbanks, (Sun Apr 8, 10:14 pm)
Re: Reiser4. BEST FILESYSTEM EVER - Christer Weinigel, Willy Tarreau, (Mon Apr 9, 12:07 am)
Re: Reiser4. BEST FILESYSTEM EVER - Christer Weinigel, Richard Knutsson, (Mon Apr 9, 9:10 am)
Re: Reiser4. BEST FILESYSTEM EVER., Nate Diller, (Mon Apr 9, 11:35 am)