Tuesday, March 30, 2010

Installing Linux Kernel from Source

Following ten steps will get you a kernel installed, from source, on your machine:

  1. Get a source from www.kernel.org
    Go for the latest stable release.
  2. Untar the source.
  3. Enter the source directory
  4. Copy an old kernel config file, from /boot, into this directory and rename the file to '.config'
    A .config file contains response (yes/no/build-module) for various configuration options such as support for a particular network card. Ideally, one shall go through all the options and select the ones needed - but there are too many options to be configured! So, we copy the config file supplied with your distribution.
  5. make silentoldconfig
    This reads the already present .config file in source directory and asks for responses of the remaining options - press enter for all the remaining options to select the default option.
  6. make -jn (where n is 2*num_cpu_cores)
    Parallel make is fast as it divides the work between multiple cores.
  7. sudo make modules_install
    This installs the modules in /lib/modules/$KERNEL_VERSION directory
  8. sudo make install
    This executes distribution dependent installation script, which for example, copies the built kernel in /boot directory.
  9. sudo update-initramfs -c -k $NEW_KERNEL'S_VERSION
    Creates ramdisk needed for booting.
  10. sudo update-grub
    Adds entry for the new kernel in your grub.
For any more information/details, drop me an e-mail.

Cheers,
Nipun

1 comment:

  1. A lot of persons including me get goosebumps installing and using open source softwares.So u r really doing gud work in this regard.Thanx a lot.

    ReplyDelete