How to build a kernel on debain 10

Linux Nov 3, 2019

Dependencies:

apt install gcc libc6-dev libncurses5-dev binutils make gawk gzip coreutils grep zlib1g-dev flex bison git libelf-dev libssl-dev

Download the kernel you want build:
https://www.kernel.org/

Create your kernelConfig [.config] or copy a working old one.
If you use an old config, make sure you run the ´make oldconfig´ command to set all new modules to Y|N.

tar xfsv linux-5.3.8.tar.xz
cd linux-5.3.8

cmueller@debian ~ ll /boot | grep config-$(uname -r)
-rw-r--r-- 1 root root 147K Nov  3 18:44 config-5.2.0

cp /boot/config-$(uname -r) .config
make oldconfig

make menuconfig

If you need some specific driver you can look at the linux-firmware repo:
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git

cd /opt/kernel
git clone https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git

Put the directory in the kernel config:
CONFIG_EXTRA_FIRMWARE_DIR="/opt/kernel/linux-firmware"

Build the kernel:

cd linux-5.3.8
time make -j8 bzImage modules

Install kernel & modules:

sudo make modules_install install

Reboot

Trobleshooting:

Problem:

make[1]: *** Keine Regel vorhanden, um das Ziel „debian/certs/debian-uefi-certs.pem“, 
  benötigt von „certs/x509_certificate_list“, zu erstellen.  Schluss.

Tags

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.