0% found this document useful (0 votes)
18 views4 pages

Assignment 07

Uploaded by

bird.wiser.ai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views4 pages

Assignment 07

Uploaded by

bird.wiser.ai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Name :Vishwas Ramesh Nalawade

PRN :21610043

Assignment: Compilation and Installation of Linux Kernel


Objective: To compile and install a custom Linux Kernel on a system/VM using a specific Linux
distribution like Fedora, Ubuntu, Debian, CentOS, Mint, or Suse.

Step-by-Step Process

1. Preparing the System


○ Install the necessary tools required for kernel compilation.

For Ubuntu/Debian:
bash
Copy code
sudo apt-get update
sudo apt-get install build-essential libncurses-dev bison flex
libssl-dev libelf-dev

For Fedora/CentOS:
bash
Copy code
sudo dnf groupinstall "Development Tools"
sudo dnf install ncurses-devel bison flex elfutils-libelf-devel
openssl-devel


2. Downloading the Kernel Source

Download the latest stable kernel from the official Linux Kernel website.
bash
Copy code
wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.14.1.tar.xz
tar -xf linux-5.14.1.tar.xz
cd linux-5.14.1

3. Kernel Configuration

Copy the current kernel configuration file:


bash
Copy code
cp /boot/config-$(uname -r) .config

Run the kernel configuration tool to customize the options:


bash
Copy code
make menuconfig


○ Exit and save the configuration.
4. Compiling the Kernel

Clean previous builds:


bash
Copy code
make clean

Compile the kernel:


bash
Copy code
make -j$(nproc)


■ $(nproc) ensures all available CPU cores are used to speed up the
process.

Installing Kernel Modules


bash
Copy code
sudo make modules_install

5.
6. Installing the Kernel

Install the newly compiled kernel:


bash
Copy code
sudo make install


7. Updating Bootloader (GRUB)

For Ubuntu/Debian, update GRUB:


bash
Copy code
sudo update-grub

For Fedora/CentOS:
bash
Copy code
sudo grub2-mkconfig -o /boot/grub2/grub.cfg


8. Rebooting into the New Kernel

Reboot the system:


bash
Copy code
sudo reboot


○ Select the new kernel from the boot menu.
9. Verifying Kernel Installation

After reboot, check the running kernel version:


bash
Copy code
uname -r

References

1. Kernel.org
2. Fedora Custom Kernel Build Guide
3. Ubuntu Kernel Compilation - Video Guide
4. Tecmint - Kernel Compilation
5. OpenSUSE Kernel Guide

You might also like