Kernel Installation Guide

Kernel Installation Guide

Downloading the Kernel

    1. Download kernel version 2.6.36 to the appropriate
      directory. If
      you just plan to install or upgrade the kernel running on your machine,
      the appropriate directory is /usr/src/. If you are going to be hacking
      this kernel, download to somewhere like your home directory.

      wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.36.tar.gz
      tar xzvf linux-2.6.36.tar.gz

  1. If you’re going to be kernel hacking, append a “-dev” to
    the kernel directory name, to make things clear:

    mv linux-2.6.36 linux-2.6.36-dev

Note: Continue using sudo when necessary.

Configuring the Kernel

Download thisconfig file and save it as .config
in the new linux source directory (e.g.,linux-2.6.36-dev).

Then, configure the kernel from the .configfile.

cd linux-2.6.36-dev
make oldconfig ( If the program asks you to choose y/n/?, just press Enter )

Building and Installing the Kernel

  1. Once the kernel is configured, compile it.
    make (This takes up to about one hour, ...)
    make modules_install
  2. Then copy the new kernel image into /boot,
    cp arch/i386/boot/bzImage /boot/cop4610-bzImage
  3. Generate an initial RAM disk and install it into /boot,
    mkinitramfs -o /boot/cop4610-initramfs 2.6.36
  4. Edit the bootloader’s config file to recognize the new
    kernel.Edit /etc/grub.d/40_custom so it looks like:

    #!/bin/sh
    exec tail -n +3 $0
    # This file provides an easy way to add custom menu entries. Simply type the
    # menu entries you want to add after this comment. Be careful not to change
    # the 'exec tail' line above.
    menuentry 'Ubuntu (kernel 2.6.36) for COP-4610 Lab' --class ubuntu --class gnu-linux --class gnu --class os {
     recordfail
     insmod ext2
     set root='(hd0,1)'
     search --no-floppy --fs-uuid --set b3abc51c-d29b-44dc-b916-50b2e20922e7
     echo 'Loading Linux 2.6.36 for COP-4610 Lab...'
     linux /boot/cop4610-bzImage root=UUID=b3abc51c-d29b-44dc-b916-50b2e20922e7 ro splash
     echo 'Loading initial ramdisk ...'
     initrd /boot/cop4610-initramfs
    }
  5. Run:
    update-grub

     

  6. Now reboot the virtual machine into the new kernel 2.6.36:
    reboot

    At boot, immediately press any key (e.g., ‘q’),

    then you will see a countdown: 5, 4, 3, …

    press the SHIFT key on the left side of the keyboard

    you will see a menu of available kernels.

    Use the arrow key to choose the entry corresponding to your
    kernel, e.g., “Ubuntu (kernel 2.6.36) for COP-4610 Lab”, and press
    Enter.

  7. Cross your fingers. You will see a black screen for about
    20
    seconds, but that’s okay. Eventually, you should see a normal Ubuntu
    login screen.
  8. If you see a Ubuntu login screen, congratulations! Your new
    kernel is now running!To see what version you are running for sure:

    uname -a

    It should say “Linux cop4610-desktop 2.6.36 #1 SMP …”

  9. If the boot does not go through, your modification to the
    kernel
    has a problem. Reboot the virtual machine into the default kernel
    (during the reboot DO NOT press any key). Once your Ubuntu is back,
    login as usual and correct your mistake(s). Then go back to step 1.