justlinux.com
Tue, 09-Feb-2010 17:09:15 GMT
internet.com
Forum: Registered Users: 73633, Online: 274
nhfs Here you can view your subscribed threads, work with private messages and edit your profile and preferences Registration is free! Calendar Find other members Frequently Asked Questions Search Home Home

Help File Library: 20 (or so) Steps to a New Kernel (With Grub)


by Christine Trobbiani (ctrobbia [at] poetrycontestonline.com)

The steps for installing a new kernel in Red Hat Linux are easy. Just follow these simple rules and you will be set. This is done on my Red Hat 7.3 machine. I use grub as my bootloader. The kernel number is relative to what kernel you are using, so please extrapolate! If you are working with kernel 2.2.6 that will be the version number instead of 2.4.19.

I had a hard time finding a kernel how-to directed towards users who are running grub as their bootloader. This document is meant to be very thorough but to also impart a little knowledge. I am no kernel guru by far, just someone who appreciates a nice set of directions. Please let me know if you had trouble with this document or find any errors.

  1. Go to http://www.kernel.org and download the latest stable kernel
  2. Change user to root
    su
    
  3. Copy the downloaded kernel to your /usr/src directory:
    cp linux-2.4.19.tar.gz /usr/src/
    
  4. Uncompress the kernel.
    tar -zxvf linux-2.4.19.tar.gz
    
  5. Change to the linux-2.4.19 directory
    cd linux-2.4.19
    
  6. Make mrproper (This will erase any .config file) This cleans out the configuration files and any object files an older version might have.
    make mrproper
    

    The next step is optional, depending on if you want to keep your old configuration or base your new kernel on your old configuration and add the new options found in the new kernel.

    OPTIONAL: Copy over the old configuration file. (assumes it is an i686)

    cp -p /usr/src/linux-2.4.19/configs/kernel-2.4.18-i686.config .config
    
  7. Complete configuration by one of these four options:
    make oldconfig
    

    This will ask you if you want to add in the new options from the kernel by selecting y/n/m.
    make xconfig
    

    (uses a GUI configuration) or
    make menuconfig
    

    (uses a terminal configuration based on curses) or
    make config
    

    You would need to edit the .config in order to select what options you want and then run make config to make the configuration file.

    xconfig and menuconfig have a help option which is nice if you are unsure of what option you are turning on/off. make config and make oldconfig DO NOT have this help menu option.

  8. Make the dependencies, which insures all things, like include files, are in place.
    make dep
    
  9. Make your bzImage
    make bzImage
    
  10. Make your modules
    make modules
    
  11. Copy the image over to /boot.
    cp /usr/src/linux-2.4.19/arch/i386/boot/bzImage /boot/vmlinuz-2.4.19
    
  12. Install the modules
    make modules_install
    
  13. Copy the new System.map over to /boot
    cp /usr/src/linux-2.4.19/System.map /boot/System.map-2.4.19
    
  14. Change back to the /usr/src directory
    cd ..
    
  15. At this point (for Red Hat) I remove the linux-2.4 symlink
    rm linux-2.4
    
  16. Then I make a new symlink to my new kernel directory.
    ln -s linux-2.4.19 linux-2.4
    
  17. Add the new kernel in the configuration file. For example, in grub.conf add:
    title Red Hat Linux (2.4.19)
    root (hd0,1)
    kernel /boot/vmlinuz-2.4.19 ro root=/dev/hda2 hdd=ide-scsi
    

    If your /boot is on its own partition please remove /boot part of the kernel location. Your last line in grub should read (If your /boot is on it's own partition)
    kernel /vmlinuz-2.4.19 ro root=/dev/hda2 hdd=ide-scsi
    
  18. Edit grub.conf
    vi /etc/grub.conf
    
  19. Add the new kernel in the configuration file

    Example: grub.conf

    title Red Hat Linux (2.4.19)
    root (hd0,1)
    kernel /boot/vmlinuz-2.4.19 ro root=/dev/hda2 hdd=ide-scsi
    

    Blue: This is the title that Grub will show in the Splash Screen. It will say

    Red Hat Linux (2.4.19)
    

    Red: This is essentially for grub's benefit. It is where grub is installed. (since I am dual booting Windows 2000 this is hd0,1, not hd0,.)

    Green: this is where the kernel Image is located and what device root is (/dev/hda2) The hdd=ide-scsi is for scsi emulation (In my case I need it for my IDE CDRW, ATAPI Zip Drive, and USB Smartmedia Reader)

  20. Reboot.
    reboot
    

VIOLA!


internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers
internet.commerce
Be a Commerce Partner












The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers