4

I am new bee in Linux kernel programming, trying to work with an old kernel Linux 2.6.32 on x86_64. I want to enable the CONFIG_PREEMPT option in it but can not find information about how can I do it. I can compile a new kernel with my preferred options, but do not know what I need to do in this case. So can anyone please tell me

How can I enable CONFIG_PREEMPT option? Do I need to recompile the kernel again with new menuconfig? In that case which option is responsible for CONFIG_PREEMPT?

I think it's trivial for anyone who worked with this before, so please give me your valuable help!

Vilhelm Gray
  • 11,516
  • 10
  • 61
  • 114
TJ974
  • 59
  • 2
  • 3
  • You really couldn't find information on how to do this [anywhere](https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/Documentation/kbuild/kconfig.txt)? – artless noise May 25 '13 at 19:51

3 Answers3

4

You can use make menuconfig to enable CONFIG_PREEMPT for the kernel; just select it from the menu options. To verify that it's enabled, check the .config file generated by make menuconfig for the following line:

CONFIG_PREEMPT=y

You can also make the modification by hand if you prefer (make menuconfig is simply a GUI to create the .config file).

Once everything is configured, recompile the kernel with the usual:

make && make modules_install && make install
Vilhelm Gray
  • 11,516
  • 10
  • 61
  • 114
  • @TJ974 if you find Vilhelm's answer useful and it solved your problem please consider accepting his answer :) – Ahmed Masud May 25 '13 at 00:44
  • @TJ974 If you need any further assistance with this question please let me know. If the answer is satisfactory, "accept" the answer by clicking the checkmark to the left of it under the vote count (the large number to the left of the text). – Vilhelm Gray May 25 '13 at 03:30
  • 1
    To find the whereabouts of that CONFIG_PREEMPT option, type / (slash) in make menuconfig and search for PREEMPT. – Ludwig Schulze May 22 '17 at 13:21
2

If you want to add fully optimized kernel, you need to add a patch, which can be downloaded from the main website here
If you don't know how to add a patch, just go through this thread.

Community
  • 1
  • 1
0

One can often install a corresponding package, such as the linux-image-4.19.0-12-rt-amd64-unsigned on Debian

apt install linux-image-4.19.0-12-rt-amd64-unsigned
grep PREEMPT /boot/config-4.19.0-12-rt-amd64
sync && reboot

grep PREEMPT /proc/version
Linux version 4.19.0-12-rt-amd64 (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP PREEMPT RT Debian 4.19.152-1 (2020-10-18)
ArtemGr
  • 11,684
  • 3
  • 52
  • 85