Skip to content

TheRealCodeVoyage/Kernel-Compile-Install

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

Kernel-Compile-Install

Steps on how to compile and install linux kernel by yourself based on: ITSFOSS Ref

Prequisite

Step 1: Install Dependencies

sudo apt update
sudo apt install bc binutils bison dwarves flex gcc git gnupg2 gzip libelf-dev libncurses5-dev libssl-dev make openssl pahole perl-base rsync tar xz-utils

Step 2: download the Kernel and its PGP Verification Signature

Kernel.org

wget https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.10.6.tar.xz
wget https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.10.6.tar.sign

Compile

Step 1: decompress .xz file

unxz --keep linux-*.tar.xz

Step 2: Get public encryption key(s) and verify signed file

gpg2: OpenPGP encryption and signing tool

gpg2 --locate-keys [email protected] [email protected]

gpg2 --verify linux-*.tar.sign

Step 3: Extract tar archive file

tar -xf linux-*.tar

Step 4: create .config file. Copy the current .config file from the OS

cp /boot/config-"$(uname -r)" .config
file .config

Step 5: Updating the configuration

To update an existing .config file, the make command is used with the target olddefconfig. Broken down, this is old default configuration. This will take the "old configuration file" (which is currently saved as .config as a literal copy of your distribution's configuration) and check for any new configuration options that were added to the Linux codebase since

make olddefconfig

The most reliable way to modify your config file is via the menuconfig command

make menuconfig

General Setup -> CONFIG_LOCALVERSION -> "-CodeVoyageWithIman"

Step 6: Compile and time the compile time

make -j$(nproc) 2>&1 | tee log

If you want, you can time your compile process, in that case use the commnad below:

(time make -j$(nproc) 2>&1 | tee log) 2>&1 | tee build_time.log

Install

Will install all the compile kernel file

sudo make modules_install -j$(nproc)
sudo make headers_install -j$(nproc)
sudo make install -j$(nproc)

After reboot

check your kernel name

uname -r

About

Steps on how to compile and install linux kernel by yourself

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •