Friday 24 February 2017

Configuring, Compiling and Booting the Linux Kernel for the first time

It was a happy moment when my own Linux Kernel booted successfully and that too in the very first attempt!! Well, here are the steps that I followed:
(Note: The host machine was Fedora 25)

  1. Download the latest stable Linux Kernel from https://www.kernel.org
     I got linux-4.9.11.tar.xz
  2. Then extract the file using
    $ tar xf linux-4.9.11.tar.xz
  3. Then go to the extracted directory
    $ cd linux-4.9.11
  4. Install the dependencies
    $ sudo dnf install ncurses-devel
    $ sudo dnf install elfutils-devel
  5. Configure the kernel
    $ make menuconfig
    I just made one change the first time. I added NTFS support to my Linux kernel
  6. Build the kernel and the modules
    $ make
    $ make modules
  7. Install the modules
    $ sudo make modules_install install
  8. Update grub2
    $ grub2-mkconfig -o /boot/grub2/grub.cfg
  9. Reboot the machine
  10. Check which kernel is running
    $ uname -r
    4.9.11
    And that is how things worked out wonderfully!

No comments:

Post a Comment