Skip to content

Home Lab

Notes from my learning sessions

Menu
Menu

Complile Linux Kernel (on Debian 11)

Posted on December 26, 2021 by sandeep

Install required packages.

root@server1:~# apt-get install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc flex libelf-dev bison dwarves

Download the source of the required/planned version of the Linux kernel  (I had decided on 5.15)

root@server1:~# wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.11.tar.xz

Extract the xz file (to default folder)

root@server1:~# tar xvf linux-5.15.11.tar.xz
root@server1:~# cd linux-5.15.11/
root@server1:~/linux-5.15.11#

Copy the existing configuration file

root@server1:~/linux-5.15.11# cp -v /boot/config-$(uname -r) .config

Debian 11 includes additional trusted X.509 keys directly into the kernel image, which can be used to verify kernel modules before loading them.  Need to disable the inclusion

root@server1:~/linux-5.15.11# make menuconfig

Scroll down and select Cryptographic API

Scroll down to the end of the options list and select “Certificates for signature checking”

Select the Additional certificates and clear the contents “debian/certs/debian-uefi-certs.pem”

Exit to the main menu and select ‘Save’

Exit menuconfig

In my server, I have 36 cores / 72 threads. So I decided to increase the concurrency of compilation to make it fast

root@server1:~/linux-5.15.11# make -j64
SYNC include/config/auto.conf.cmd
HOSTCC scripts/kconfig/conf.o
HOSTLD scripts/kconfig/conf
WRAP arch/x86/include/generated/uapi/asm/bpf_perf_event.h
SYSHDR arch/x86/include/generated/uapi/asm/unistd_32.h
WRAP arch/x86/include/generated/uapi/asm/errno.h
. . . 
. . .
LD [M] sound/x86/snd-hdmi-lpe-audio.ko
LD [M] sound/xen/snd_xen_front.ko
LD [M] virt/lib/irqbypass.ko
root@server1:~/linux-5.15.11# make modules_install
arch/x86/Makefile:142: CONFIG_X86_X32 enabled but no binutils support
INSTALL /lib/modules/5.15.11-dc-5.15/kernel/arch/x86/crypto/aegis128-aesni.ko
INSTALL /lib/modules/5.15.11-dc-5.15/kernel/arch/x86/crypto/aesni-intel.ko
. . .
. . .
INSTALL /lib/modules/5.15.11-dc-5.15/kernel/sound/xen/snd_xen_front.ko
INSTALL /lib/modules/5.15.11-dc-5.15/kernel/virt/lib/irqbypass.ko
DEPMOD /lib/modules/5.15.11-dc-5.15
root@server1:~/linux-5.15.11# make install
arch/x86/Makefile:142: CONFIG_X86_X32 enabled but no binutils support
sh ./arch/x86/boot/install.sh 5.15.11-dc-5.15 \
arch/x86/boot/bzImage System.map “/boot”
…
Generating grub configuration file …
…
Found initrd image: /boot/initrd.img-5.10.0-10-amd64
done
root@server1:~/linux-5.15.11#]

Reboot the server once.

Recent Posts

  • Ceph + KVM: 4. Orchestrating Ceph RBD backed VMs on KVM Hosts
  • Rabbit MQ Cluster + HAProxy + Keepalived
  • Install and configure MariaDB / Galera cluster
  • Ceph + KVM : 3. Installing KVM, cutsomized monitoring scripts
  • Ceph + KVM : 5. Service checks and CLI commands
  • Ceph + KVM : 2. Installation – Ceph Storage
  • Ceph + KVM : 1. Planning and preparing for Ceph Storage
  • Openstack Xena on Ubuntu 20.04 – Cinder
  • Preparing custom Debian 11 MATE image
  • Setup Ubuntu 20.04 repository mirror server

Archives

  • April 2025
  • March 2025
  • October 2024
  • September 2024
  • April 2022
  • March 2022
  • February 2022
  • December 2021
  • October 2021
  • September 2021
  • October 2020
  • February 2020
  • January 2020
  • December 2019
© 2025 Home Lab | Powered by Minimalist Blog WordPress Theme