[Techtalk] kernel upgrades

Lee Blackwell lee_blackwell at eur.3com.com
Thu Oct 11 08:52:42 EST 2001


Ok... quick and dirty method.  I'd pop over to linuxdoc.org and find the
kernel readme.

This is what I do:


- Visit kernel.org and get your updated kernel tarball
- su to root
- change /usr/src

- /usr/src/linux is a symbolic link to distro kernel tree i.e. ->
/usr/src/linux-2.2.16.  You need to preserve the original tree, so 'rm
linux' to get rid of the link.

- Now untar your kernel source

[root at bella /usr/src]# tar zxvf /home/lee/linux-2.4.10.tar.gz .

By default, kernel tarballs are stored in the 'linux' directory.  *This*
is why you unlink /usr/src/linux, because otherwise you'd overwrite your
original source tree (bad idea!)

- Now move your new kernel source to a relevant directory name:

mv linux linux-2.4.10

- now restore the origiginal symlink

ln -s linux-2.2.16/ linux

- now it's time to build your kernel,

cd linux-2.4.10
make menuconfig

- Use the menu program to configure your kernel - I'll leave you to play
with that.

- Next is to compile your kernel and modules if you've used any.  There
are several steps, usually the next step depends on the previous one.  I
usually use one command line, with an operator to ensure that if one step
fails, the rest are aborted.  Try this:

make dep && make && make bzImage && make modules && make modules_install

If you get to the bottom with no errors, you've just compiled a kernel.

Now you need to be able to boot from it.  *WARNING* Do NOT remove your
original kernel - you most certainly will need it.  I've got four
different versions I can boot from ;-)

Installing the kernel:

Follow these commands:

cp arch/i386/boot/bzImage /boot/linux-2.4.10
cp System.map /boot/System.map-2.4.10

now:

cd /boot

Again, "System.map" will be a symlink to your original disto System.map
(but check with ls -l)

Remove the symlink:

rm System.map

And link to your new System.map:

ln -s System.map-2.4.10 System.map

Finally, edit your /etc/lilo.conf  - to save me explaining it, look at
mine:

=====

boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
message=/boot/message
linear
default=249

image=/boot/vmlinuz-2.2.16-22
	label=linux
	read-only
	root=/dev/hda8
image=/boot/linux-2.4.3
	label=243
	read-only
	root=/dev/hda8
image=/boot/linux-2.4.5
	label=245
	read-only
	root=/dev/hda8
image=/boot/linux-2.4.5
	label=245-cdrw
	read-only
	root=/dev/hda8
	append="hdc=scsi"
image=/boot/linux-2.4.9
	label=249
	read-only
	root=/dev/hda8

=====


As you can see, I've got several different images.  Worth noting is that
each image has a label, and your original distro image is "linux".

I've modified my lilo.conf so that it boots the "249" image first.  You
can do the same.  If your new kernel fails to boot, you can simply reboot
and choose "linux" from the lilo boot loader screen and your back to your
original kernel...

Once you've updated the file, install the new boot sector, run:

lilo

And watch the output, e.g.:

[root at bella /root]# lilo
Added linux
Added 243
Added 245
Added 245-cdrw
Added 249 *

The "*" indicates the default boot image.

In fact, run lilo two or three times.  Just to be real sure.

Er, thats it.  init 6/reboot and boot your new kernel.... ;-)

Oh - if you're not completely confident in compiling code, working with
symlinks or are unsure of anything I've written above; well, don't do this
on any machine you need...  If it breaks you've got a big job on your
hands to repair.  Best try it on an old machine, or something that you
don't mind formatting.

And, you *did* create a boot disk when you originally installed RH7.1,
didn't you???

HTH,

Lee

-- 
Lee Blackwell
Unix Specialist, NCS, 3com IT.
"I love blinking, I do!" - Helen, Big Brother, 2001

On Thu, 11 Oct 2001, wolf wrote:

>
> Having never done a kernel upgrade, I'm using red hat 7.1, I would be
> very grateful if someone would list
> the steps to doing so or perhaps offer up a link they followed to learn
> how to do this?
>
>
> --
> --------------------------------------------------------------------------------------------------------------
>
>
>                         "Do not judge me for what I appear to be,
>                         I am far more than you will ever imagine"
>
>                                      www.wolfrising.net
>
>                         Because the people who are crazy enough to think
>
>                       they can change the world, are the ones who do.
>
>
>
> _______________________________________________
> Techtalk mailing list
> Techtalk at linuxchix.org
> http://www.linuxchix.org/mailman/listinfo/techtalk
>






More information about the Techtalk mailing list