kernel2.4.x

This page describes how to install the latest Linux version 2.4 kernel on Redhat 7.x. In particular, it describes how to compile the official kernel sources with Redhat's default configuration.

Download the Sources

  1. Download latest stable kernel source from kernel.org. Don't try to compile the same version that you are already using unless you know what you are doing, or you risk messing up your kernel modules. You can figure out what kernel you are already running with
    $ uname -r
    
  2. Unpack the sources. Older versions had to be unpacked in /usr/src, but now days you are probably better off compiling the source in your own home directory logged in as a normal user.
    $ tar zxvf linux-2.4.3.tar.gz
    $ mv linux linux-2.4.3
    
  3. If you have a patch file, apply like
    $ cd linux-2.4.3
    $ gunzip < /tmp/patch-2.4.3.gz | patch -p1 
    

Configure

  1. In top directory of your kernel source from kernel.org, run
    $ make mrproper
    
  2. Copy the most appropriate config file for your system into .config in the top directory of the kernel source
    $ cp /usr/src/linux-2.4.2/configs/kernel-2.4.2-i686.config linux-2.4.3/.config
    
  3. Your config file is for an older version of the kernel, and so must be updated. The following command will only ask questions about new features. Most of the time you can safely leave out these new features unless they specifically interest you
    $ make oldconfig
    
  4. As configured, your kernel and modules will support a huge variety of hardware and features that you don't need. You might want to turn off some of things to speed up the compile and save disk space. Or you may want to enable some feature that was turned off in the default. To do so, run
    $ make menuconfig
    
  5. Make a backup copy of .config.
    $ cp .config ~/backup-kernel-config
    
  6. If you are compiling same version of existing kernel, edit /usr/src/linux/Makefile like date format below to avoid overwriting modules
    EXTRAVERTION = -20020710
    

Compile the kernel and modules

  1. This part is easy. You'll have plenty of time to go get a cup of coffee....
    $ make dep
    # make clean
    $ make bzImage
    $ make modules
    
  2. If you want a rescue disk, do
    $ make bzdisk
    

Install your new kernel

  1. Up to now, you have hopefully been logged in as a normal user. Now you'll need to become root.
    $ su
    
  2. Copy the kernel into its final destination. Don't overwrite your working kernel!!!
    # cp ~user/linux/arch/i386/boot/bzImage /boot/vmlinuz-2.4.3
    
  3. Install the modules.
    # make modules_install
    
  4. To build the new initrd image, run /sbin/mkinitrd with parameters such as this
    # mkinitrd /boot/initrd-2.4.3.img 2.4.3 --with=ext3
    

Configure GRUB

  1. Edit /etc/grub.conf
    # grub.conf generated by anaconda
    #
    # Note that you do not have to rerun grub after making changes to this file
    # NOTICE:  You have a /boot partition.  This means that
    #          all kernel and initrd paths are relative to /boot/, eg.
    #          root (hd0,0)
    #          kernel /vmlinuz-version ro root=/dev/sda8
    #          initrd /initrd-version.img
    #boot=/dev/sda
    default=0
    timeout=10
    splashimage=(hd0,0)/grub/splash.xpm.gz
    title Red Hat Linux-up (2.4.7-10)
            root (hd0,0)
            kernel /vmlinuz-2.4.7-10 ro root=/dev/sda8
            initrd /initrd-2.4.7-10.img
    title Red Hat Linux-up (2.4.18)
            root (hd0,0)
            kernel /vmlinuz-2.4.18 ro root=/dev/sda8
            initrd /initrd-2.4.18.img
    

Configure LILO

  1. Edit /etc/lilo.conf so that you can boot the new kernel. Don't take out the lines for your working kernel until you have booted the new one!!! In the following example, you'll probably have to change the location of the root partition.
    image=/boot/vmlinuz-2.4.3
    		label=linux-2.4.3
    		read-only
    		root=/dev/hdc2
    
  2. Run lilo
    # /sbin/lilo
    

Try it out.

Now you can reboot your system and choose the new kernel at the lilo prompt. If everything works, you can run "make mrproper" in the source directory or delete it entirely to make space. Delete the old kernel if you're absolutely certain you won't be needing it, updating /etc/lilo.conf as appropriate.
Back
Google
Web www.grape-info.com