User Tools

Site Tools


linux:debian:build_kernel_rt

# Debian with PREEMPT_RT patched kernel

## Overview

Theses short steps were tested on Debian Wheezy 7.4, x64 core.

## Steps

Create a “workspace”, where you have some free disk space

  mkdir ~/rt_kern
  cd ~/rt_kern

Get the files !

  wget -c https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.25.tar.xz
  wget -c https://www.kernel.org/pub/linux/kernel/projects/rt/3.14/patch-3.14.25-rt22.patch.xz

Extract and patch

  tar xaf linux-3.14.25.tar.xz
  unxz patch-3.14.25-rt22.patch.xz
  cd ./linux-3.14.25
  patch -p1 < ../patch-3.14.25-rt22.patch

Get the config of your current Debian kernel

  cp -vf /boot/config-3.2.0-4-amd64 .config

Now comes the _fun_ part: Configuring the Kernel That's usually the part where you screw up and build a non-working kernel.

  make menuconfig

Note: I missed some libraries so be able to run this command, you probably do too.

 sudo aptitude install libncurses5-dev

Once you get the configuration GUI, you have to select a few options:

* Enable the full RT features: `Processor type and features > Preemption Model > (Fully Preemptible Kernel (RT))`

Save and quit (TAB until you can select the option)

Build (where X is two times the number of cores of your CPU). Took 45minutes on my 2.5Ghz Core2Duo, with SSD.

  make -jX

Or, you can directly build the debian packages (Name it as you want… I named it _-hyde_)

  make deb-pkg LOCALVERSION=-hyde KDEB_PKGVERSION=1

Install it

  cd ../
  sudo dpkg -i ./linux-image-3.14.25-rt22-hyde_1_amd64.deb 

Aaannndd reboot, select your new kernel =)

## Links

* https://rt.wiki.kernel.org/index.php/RT_PREEMPT_HOWTO

/home/share/www/redox.ws/wiki/data/pages/linux/debian/build_kernel_rt.txt · Last modified: 2023/11/24 21:55 by 127.0.0.1