Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 01-08-2003, 04:03 PM   #1
LQ Newbie
Registered: Jan 2003
Location: London, UK
Distribution: Red Hat
Posts: 14

Rep: Reputation: 0
Kernel Upgrade Steps

Can anybody who has done a kernel upgrade check out my steps please and provide feedback


Create a boot disk
Backup files
$ rpm -qa | grep 'kernel'


Download the 2.4.20 source to the /usr/src directory
As root, cd /usr/src
ls -l - This showed that /usr/src/linux was a link to /usr/src/linux-2.4.18-14, the current kernel.
rm /usr/src/linux - remove the link
untar the source: creates a new linux sub directory containing new kernel source files
tar -xjvf linux-2.4.20.tar.bz2
ln -s /usr/src/linux-2.4.20 /usr/src/linux
cd /usr/src/linux

Apply Patches:
The ACPI Patch. Once you download that file, put it in the same directory you extracted your linux source into
(should be linux-2.4.20). Example: `zcat patch46.gz | patch -p0' (or `patch -p0 < patch46' if the patch isn't compressed)
patch -p1 < acpi-20021212-2.4.20.diff

The Sound patch ( by Fedor Karpelevitch). To apply this patch run the following patch command:
patch -p1 < presario_sound_fix.diff

Compile new kernel:
Read through the README file, which explains the make commands you're about to enter:

`make mrproper' will do a more extensive `clean'ing. It is sometimes necessary; you may wish to do it at every patch.
`make mrproper' will also delete your configuration file, so you might want to make a backup of it (.config)
make mrproper T

make config
Make sure you enable the appropriate modules for network (8139too), sound (OSS and trident), video (radeon, vesa),
usb, firewire (experimental), and disable machine check exception. Also disable the "Set version information on all
module symbols" option if you plan to include module support in your kernel--without this, your modules will fail
with an MMX-related bug.

When prompted, enter "m" to make a module for new options
After you finish configuration, a message tells you that your kernel has been configured, and to ``check the top-level
Makefile for additional configuration,'' etc. So, look at the Makefile.

When the configure script ends, it also tells you to `make dep' and (possibly) `clean'. This insures that all of the
dependencies, such the include files, are in place. Do not forget this step before attempting to recompile a kernel.
make dep

After depending and cleaning, you may now `make bzImage' (this is the part that takes a long time.). `make bzImage'
will compile the kernel, and leave a file in arch/i386/boot called `bzImage' (among other things). This is the new
compressed kernel. A compressed kernel automatically decompresses itself when executed.
make bzImage

To use loadable modules, first make sure that you don't configure them into the regular kernel; that is, don't say y to it
during `make config'. Compile a new kernel and reboot with it. Then, cd to /usr/src/linux again, and do a `make modules'.
This compiles all of the modules which you did not specify in the kernel configuration, and places links to them in
/usr/src/linux/modules. You can use them straight from that directory or execute `make modules_install', which installs
them in /lib/modules/x.y.z, where x.y.z is the kernel release.
make modules
make modules_install

cd /boot ls -l Remove the folloing links and create new ones as follows:
rm /boot/
rm /boot/vmlinuz
Copy the newly created kernel and to /boot
cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-2.4.20
ln -s /boot/vmlinuz-2.4.20 /boot/vmlinuz
cp /usr/src/linux/ /boot/
ln -s /boot/ /boot/
Create /boot/initrd.2.4.20.img by typing:
/sbin/mkinitrd /boot/initrd-2.4.20.img 2.4.20
Edit the /etc/grub.conf by copying the linux section and giving it a new label and updating the image and intitrd files.
Use the following line for kernel options: kernel /vmlinuz-2.4.20 ro root=/dev/hda2 hdc=ide-scsi noisapnp
To run the new kernel reboot the machine

Not sure but need to cater for this -
If you are using PCMCIA (for example, a laptop), you also need to install the kernel-pcmcia-cs
and keep the old version. If you use the -i switch, it will probably return a conflict because the older
kernel needs this package to boot with PCMCIA support. To work around this, use the --force
switch as follows (the version might vary):
rpm -ivh --force kernel-pcmcia-cs-3.1.24-2.i386.rpm
Old 01-08-2003, 09:06 PM   #2
Registered: Dec 2002
Location: In front of a computer
Distribution: UPS, DHL, FedEx
Posts: 466

Rep: Reputation: 38
next time you can use "make menuconfig" instead of "make config", it's prettier.

and after you edit grub you should type..
/sbin/grub-install /dev/hda(or whatever disk u boot from)

as long as you've copied and made a new label in /etc/grub.conf, everything should be fine, even if you stuff or there're incompatibilties, you can still boot your old kernel.
Old 01-09-2003, 06:26 AM   #3
LQ Newbie
Registered: Jan 2003
Location: London, UK
Distribution: Red Hat
Posts: 14

Original Poster
Rep: Reputation: 0
Thanks a lot - I will use menuconfig and have added the line
/sbin/grub-install /dev/hda2 to my steps.

How about the
Is this going to be there when I untar the kernel source - this is essential for a laptop

And the rest of the steps are OK? As you can realise this is my first time and I want to get it right first time. But I am feeling more confident than I was before
Old 01-09-2003, 08:05 PM   #4
Registered: Aug 2001
Location: Kingsport, TN
Distribution: RHEL & FC
Posts: 267

Rep: Reputation: 30
Since you list RedHat as your distro and for anyone else looking for an "easier" way:

From RedHat's _rawhide_ site is this 2.4.20 source RPM.

# rpm -ivh kernel-2.4.20-2.6.src.rpm
# cd /usr/src/redhat/SPECS
# rpmbuild -bb --target i686 kernel.spec

A bit later in ../RPMS/i686 is a kernel RPM ready to install. A "RedHat kernel" is the same as a regular kernel just usually packaged as an RPM and pre-configured with basically every piece of hardware imaginable as a module.

PS. Or for pre-built kernels just search on and download/install.


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
Steps to upgrade BIOS loanstocker Linux - Software 5 11-18-2004 03:05 AM
Proper steps to upgrade machiner Linux - Distributions 1 09-27-2004 01:53 PM
steps needed to remove a kernel? marlor Slackware 2 07-07-2004 03:48 PM
Compiling a new kernel: why these final steps? fenice1976 Linux - General 4 05-15-2004 10:03 PM
Help with last steps to loading new kernel using Loadlin to boot? NightSky Linux - General 2 12-17-2001 03:18 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:55 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration