DEV Community

Cover image for Building and compiling Linux Kernel :
Rahul Kumar
Rahul Kumar

Posted on

3 2

Building and compiling Linux Kernel :

What is Linux Kernel ?

  • As we know Kernel is the core of any operating system which is the interface between computer's hardware and it's processes .
  • And the main task of the kernel is :
1. Memory management
2. Process management
3. System calls
4. Device drivers
5. Security
Enter fullscreen mode Exit fullscreen mode
  • Linux Kernel is a free opensource monolithic, modular and multitasking Kernel for Unix like operating systems .

  • Though it is opensource we can install and manipulate as per our need .

Dependencies :

  • Make sure to install these dependencies :
sudo apt-get install libncurses-dev flex bison openssl libssl-dev dkms libelf-dev libudev-dev libpci-dev libiberty-dev autoconf
Enter fullscreen mode Exit fullscreen mode

How to installation :

  • Navigate to kernel.org and download the latest version .
  • Here I am using Ubuntu as the operating system .
  • Install it with wget .

$sudo wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.10.9.tar.xz

  • Unzip the downloaded file .

$ sudo tar -xvf linux-5.10.9.tar.xz

  • Make a directory in your home folder .

$ mkdir kernel

  • Copy the file after extraction .

$ cp -r linux-5.10.9/ /kernel

  • Navigate to :

$cd kernel/linux-5.10.9/

  • Start the Linux source configuration tool

make menuconfig

  • Edit the configuration of kernel and save-and-exit.
    Alt Text

  • Compile the kernel .

$make -j 5 KDEB_PKGVERSION=1.0 deb-pkg

  • Install the Kernel .

sudo dpkg -i ../linux*.deb

  • Reboot your system and check for the kernel version .

Thank You 🤖🤖🤖

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site