How To Install and Update A Redhat Linux Kernel RPM

advertisement
How To Install and Update A Redhat
Linux Kernel RPM
This tutorial covers downloading and installing a new kernel for the Redhat
distribution of Linux. The Kernel is loaded from the "RPM" package format. This
tutorial is most useful for Red Hat 7.1 installations and older which used the Lilo
operating system boot loader. Red Hat 7.2 introduced GRUB as the default boot
loader and it is configured automatically by the RPM installation. Thus users of
Red Hat 7.2-9.0 and Fedora using the GRUB boot loader need not concern
themselves with any special configuration requirements. Just install the RPM's
and that is it. Use the RPM command "rpm -ivh kernel-2xxx.rpm" and NOT
"rpm -Uvh kernel-2xxx.rpm" as is common for most RPM upgrades. The "rpm Uvh" RPM upgrade command will remove the kernel which is still executing! Use
the command "rpm -e kernel-2-OLD.rpm" to remove the old kernel after a
system reboot. Also remove reference to the old kernel in the GRUB config file
/etc/grub.conf. Typically the removal of the kernel RPM will remove it's entry in
/etc/grub.conf.
Download:
Down load RPMs from Redhat (updates.redhat.com) or Metalab:












FTP command line method:
ftp ftp.ibiblio.org
Name: anonymous
Password: your-email-address@your-isp.com
cd pub/Linux/distributions/redhat/updates/current/en/os/i386
prompt
mget kernel-*2.2.17-14.i386.rpm
cd ../i586 - Only perform these steps for Pentium (586) or
K6-2/3 architectures
ls
get kernel-2.2.17-14.i586.rpm
OR

Point the browser at one of the following sites:
o
o
o
Red Hat:
http://distro.ibiblio.org/pub/Linux/distributions/redhat/updates/
RedHat Updates
Fedora:
http://distro.ibiblio.org/pub/Linux/distributions/fedora/linux/core/upda
tes/
Note: If using Netscape, press and hold the "Shift" key and select the link
to the RPM file to download.
Note: There are precompiled kernels for various architectures (i386, i586, i686,
...) Check your current kernel for its precompiled architecture with the command
uname -m. The kernels marked "smp" are for multiprocessor systems or hyperthreaded systems such as some of the Intel Xenon or P4 processors.
Hyperthreading must also be enabled. This is often selected in the BIOS for
systems on which this is available. The "smp" (symetric multi-processing) kernels
allow for all processors to participate in scheduler tasks as well as all threads
(two) in hyper-threaded processors. This will result in significant performance
gains on a loaded system.
Installation:
Install the kernel. Using the "-F" "freshen" option will remove all previous kernel
installs. Do this only if you are daringly confident. The install option is prefered
and safer because if an error is made, hopefully you can always re-boot to the
previous kernel.
rpm -ivh --force kernel-2.2.17-14.i586.rpm
OR
rpm -Fvh kernel-2.2.17-14.i586.rpm
Note:


The "smp" RPM kernel-smp-2.2.17-14.i586.rpm is for multi-processor
systems.
Linux kernel RPM: kernel (/boot/vmlinux-2.X.XX-X), modules
(/lib/modules/2.X.XX-X/...), /boot/System.map-2.X.XX-X, and
/boot/module-info-2.X.XX-X
The next two packages complete the kernel base.
rpm -ivh --force kernel-ibcs-2.2.17-14.i386.rpm
- Intel Binary
Compatability Standard: This allows Linux to run Unixware and commercial
UNIX Intel binaries
rpm -ivh --force kernel-pcmcia-cs-2.2.17-14.i386.rpm - Laptop PCMCIA
card support
The following RPMs are not required but are helpful to developers or those who
want to fine tune the kernel by recompiling at a later date.
rpm -ivh --nodeps kernel-source-2.2.17-14.i386.rpm
rpm -ivh --nodeps kernel-headers-2.2.17-14.i386.rpm
rpm -Fvh kernel-doc-2.2.17-14.i386.rpm
rpm -Fvh kernel-utils-2.2.17-14.i386.rpm
- Provides
/usr/bin/ksymoops which translates the kernel's OOPS output to readable
messages
The following RPM is used to generate a boot disk. It includes a trimmed down
version of the Linux kernel. This kernel is used on the installation boot disks only
and should not be used for an installed system, as many features in this kernel
are turned off because of the size constraints.
rpm -ivh kernel-BOOT-2.2.17-14.i386.rpm
Configuration:
Note for SCSI systems:
If your system is booting from a SCSI hard drive, execute the following
mkinitrd script which creates the file used to let the system load the SCSI
module at boot time:
/sbin/mkinitrd


/boot/initrd-2.2.17-14.img
2.2.17-14
The second argument is the name of the sub-directory of the
modules under the directory /lib/modules/. (In this case
/lib/modules/2.2.17-14/)
The mkinitrd command is not issued for IDE systems and is SCSI
specific. (It actually works on IDE systems but it is pointless. The
default Red Hat install also has this.) It also requires a line in
/etc/modules.conf (or for older systems: /etc/conf.modules)
referencing the SCSI adapter. It will be the line containing the term
"scsi_hostadapter".
Configuration:



GRUB configuration: GRUB is configured by the RPM installation. The
configuration file /etc/grub.conf is modified to reference the new kernel
installed. If you want to convert your system from Lilo to GRUB execute
the following command (as root) before installing the kernel RPMs:
grub-install --root-directory=/boot '(hd0,0)'
where GRUB device descriptions are as follows: (hard-drivenumber,partition). Use the command df to view the layout of your hard
drives. Hard drives are numbered beginning with "0" and include SCSI and
EIDE drives without distinction. The designation (hd0,0) is equivalent to
Linux device designations /dev/sda1 (SCSI) or /dev/hda1 (EIDE).

Lilo configuration: Next edit the /etc/lilo.conf file. The first option is
basic. The second example will allow you to reboot to the previous kernel
as well as the new kernel.
boot=/dev/hda
boot sector
map=/boot/map
drive where the kernel can be found for boot
install=/boot/boot.b
prompt
timeout=50
default=linux
image=/boot/vmlinuz-2.2.17-14
label=linux
initrd=/boot/initrd-2.2.17-14.img
specific. Omit for IDE
read-only
root=/dev/hda7
- Location of Lilo
- Locations on hard
- This line is SCSI
To allow the system to boot the previous kernel just keep the following
lines:
image=/boot/vmlinuz-2.2.14-5.0
label=oldlinux
initrd=/boot/initrd-2.2.14-5.0.img
specific. Omit for IDE
read-only
root=/dev/hda7
- This line is SCSI
Note the numbers must refer to the kernel you are using. See the directory
/boot for a listing.

Update MBR: Now enter the command lilo -v to write the new
information to the Master Boot Record (MBR).
Diagnostic output:



LILO version 21, Copyright 1992-1998 Werner Almesberger
Reading boot sector from /dev/sda







Merging with /boot/boot.b
Boot image: /boot/vmlinuz-2.2.17-14
Mapping RAM disk /boot/initrd-2.2.17-14.img
Added linux *
Writing boot sector.
A new /boot/map file will also be generated. This file holds the locations on
hard drive where the kernel can be found for boot.

Reboot: The command shutdown -r now will cause the system to
shutdown and reboot.
At the boot prompt one can enter "?" to list all the available kernels. In our
extended lilo example, two options will be given:linux and oldlinux. The
name may be typed in or a caraige return will select the default as
assigned.
Download