[LWN Logo]

From: Robert Tennent <rdt@qucis.queensu.ca>
Date: Mon, 7 Dec 1998 20:27:46 -0500 (EST)
To: gherlein@herlein.com, redhat-devel-list@redhat.com
Subject: Re: Details on Booting

Here's the basis for a mini-HOWTO, originally posted here 
by Gene Czarcinski.

Installing/updating a new kernel on Red Hat Linux
-------------------------------------------------

The following is based on kernel => 2.0.35 (or 2.1.125 for rawhide) and 
initscripts => 3.67 (or 3.78 for rawhide).  It also includes some info
from RedHat HOWTOs for kernel upgrade procedures (these seem to change early
and often).

The following info is NOT intended for the novice but may be helpful
anyway.

The "binary" (i386) packages involved are:
	- kernel
	- kernel-modules
	- kernel-pcmcia-cs
	- iBCS
	- kernel-headers
	- kernel-source
	- initscripts

You may also need/want to install the kernel<<...>.src.rpm [see below]

1. If you do not need pcmcia or iBCS support, ignore these packages.  You
can do a rpm -e to delete them if they are installed but not needed.

2. You can copy the kernel, kernel-modules, and (optionally) the
kernel-pcmcia-cs packages to a temporary directory. Do the commands:

    cd /<<the temp dir>/
    rpm -ivh *.i386.rpm 

in the temporary directory.  This will INSTALL the new kernel and modules 
while leaving the OLD kernel in place.  DO NOT (repeat), DO NOT install a
kernel with -Uvh since any slip and you will have NO system to boot.

3. At some time you will want to update (rpm -Uvh ...) the kernel-headers 
and kernel-source but you may want to wait until you make sure the 
new kernel works (at least that is what I do).

4. Check to make sure the installed initscripts package is correct for
the new kernel.  If not, then update it.

5. If you have any scsi devices (check /etc/conf.modules), you will need to
generate an initial ramdisk.  I do this anyway if there is anything in
/etc/conf.modules.  Issue the command mkinitrd of the form:

	/sbin/mkinitrd /boot/initrd-<<version>.img <<version>

where <<version> is the version of your kernel/kernel-modules rpms such
as 2.0.35-2.

6. Modify (edit) you /etc/lilo.conf file to add an entry of the form:

	image=/boot/vmlinuz-2.0.35-2
		label=test
		root=/dev/hda2
		initrd=/boot/initrd-2.0.35-2
		read-only

and then run /sbin/lilo.

7. Reboot the system and select test at the lilo prompt.  When you are
satisfied that the new kernel is OK, you can "move" the lilo.conf entry 
to the top (so it is the default) and change the labels of the kernels 
to something like:

	test -> linux
	linux -> old

8.  If you need to modify the kernel, upgrade/install kernel-source and
rebuild the kernel to your liking.  Assuming that you have installed 2.0.35-2
and then do your own kernel, install the indicated files in more or less 
the following form (supply your own version idents:

	cp -vp /usr/src/linux/arch/i386/boot/zImage /boot/vmlinuz-2.0.35-2a
	mv /lib/modules/2.0.35 /lib/modules/2.0.35-2a
	cp -vp /usr/src/linux/System.map /boot/System.map-2.0.35-2a
	cp -vp /boot/module-info-2.0.35-2 /boot/module-info-2.0.35-2a
	/sbin/mkinitrd /boot/initrd-2.0.35-2a.img 2.0.35-2a

NOTE: /lib/modules/2.0.35 was created by "make modules_install".

Now, modify you /etc/lilo.conf file, run /sbin/lilo,  and reboot to 
begin testing.

9.  More than likely, the new system WILL NOT WORK PROPERLY ... no
modules!  The "current" versions of initscripts (3.65 on 5.1 and 3.78 
on rawhide) requires the file /lib/modules/<<version>/.rhkmvtag to exist 
and to contain exactly the same information as in /proc/version for the 
booted kernel.  RedHat's i386.rpm packages install the appropriate file but 
if you create your own kernel, there will be no such file.  If you use 
the kernel-<<version>.src.rpm, then this will not be a problem since it is 
created by the (non-installed) program rhkmvtag.c.

If you can boot at all, you can create the appropriate file by running:

	cat /proc/version >/lib/modules/<<version>/.rhkmvtag

Then reboot and everything "should" be OK.

Alternately, you can modify /etc/rc.d/rc.sysinit so the it will find 
the correct directory and files.

10.  If you are running the OSS sound driver, be sure to rename/delete
the /lib/modules/preferred/misc/sound.o file.

-- 
To unsubscribe:
mail -s unsubscribe redhat-devel-list-request@redhat.com < /dev/null