TJ974
TJ974

Reputation: 69

How to enable CONFIG_PREEMPT option in Linux kernel?

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!

Upvotes: 5

Views: 7081

Answers (3)

ArtemGr
ArtemGr

Reputation: 12547

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 ([email protected]) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP PREEMPT RT Debian 4.19.152-1 (2020-10-18)

Upvotes: 0

user2706067
user2706067

Reputation:

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.

Upvotes: 2

William Breathitt Gray
William Breathitt Gray

Reputation: 11966

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

Upvotes: 4

Related Questions