Table of Contents
Minimalistic guide to build a Kernel (only)
Introduction
Brief guide to configure, compile and install a kernel. I do this all as root in /usr/src, others do all steps except install in /home/user/somewhere as user. If I'm going to use the Kernel to control my computer I might as well trust the build process. So this guide assumes as ROOT and /usr/src. It is mainly intended as my reference to other howto's that requires building a Kernel first.
This howto assumes kernel-6.6.3. Obviously you should use the newest appropriate version and use those version numbers.
summary:
cd /usr/src tar -xvf linux-6.6.3.tar.xz cd linux-6.6.3 make clean && make mrproper cp ../config-custom ./.config make menuconfig make -j3 make modules && make modules_install cp System.map /boot/System.map-6.6.3_acer-v5 cp .config /boot/config-6.6.3_acer-v5 cp arch/x86/boot/bzImage /boot/vmlinuz-6.6.3_acer-v5
Preparations
Download the latest Kernel stable from:
https://kernel.org/
Check the signature.
Optional: patch
cd /usr/src tar -xvf linux-6.6.3.tar.xz cd linux-6.6.3 make clean && make mrproper cp ../config-custom ./.config
You don't need both mrproper and clean, probably chose one or the other depending on your need (mrproper also does clean), I just do both out of habit. Cp assumes you already have a useful config-custom file in /usr/src, or you could cp /boot/config-generic.
Configure
make menuconfig
Save the configuration.
Compile
make -j3
Where 3 is 3 cores. Use more or less by have/needs.
Modules
make modules && make modules_install
You don't need to do make modules (make basically does make “all” target), only modules_install, I just do out of old habits and precaution. Some targets however, do require make modules, like make bzImage. You also might want to make headers_install here once in awhile.
Install
cp System.map /boot/System.map-6.6.3_acer-v5 cp .config /boot/config-6.6.3_acer-v5 cp arch/x86/boot/bzImage /boot/vmlinuz-6.6.3_acer-v5
OR
make install
If you want to make and use initrd, this is the time.
Then add your custom entry to the bootloader. (If you need some assistance with Grub2 bootloader look here: lilo_to_grub_bios_mbr)
Further details
If you need further information or details regarding Linux kernel builds, there are several more detailed guides available on this page:
Slackbook
Alienbob - detailed
Git related
Slackware Helper scripts
Sources
* Originally written by Zeebra