本文介绍了为Ubuntu安装RT Linux补丁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试图通过修补/安装RT Linux来修改内核,以使我的通用Ubuntu成为实时Ubuntu,但找不到直接的设置.有人可以帮忙吗?

Trying to make my generic Ubuntu to real time Ubuntu by modifying the kernel by patching / installing RT Linux but couldn't find a straight setup. Can someone help with the steps?

推荐答案

步骤0-创建工作目录

创建工作目录

#Move to working directory
mkdir ~/kernel && cd ~/kernel

步骤1-下载内核和补丁程序

转到 https://www.kernel.org/pub/linux/kernel/,然后将所需的内核版本下载到〜/kernel.同样,请转到 https://www.kernel.org/pub/linux/kernel/projects/rt/并下载与下载的内核版本相同的RT补丁.我使用的内核和补丁是linux-4.9.115.tar.gz和patch-4.9.155-rt93.patch.gz.

Go to https://www.kernel.org/pub/linux/kernel/ and download a desired version of kernel to ~/kernel. Similarly, go to https://www.kernel.org/pub/linux/kernel/projects/rt/ and download the RT patch with same version as the downloaded kernel version. The kernel and patch I used were linux-4.9.115.tar.gz and patch-4.9.155-rt93.patch.gz.

第2步-解压缩内核

tar -xzvf linux-4.9.115.tar.gz

第3步-修补内核

#Move to kernel source directory
cd linux-4.9.115
gzip -cd ../patch-4.9.115-rt93.patch.gz | patch -p1 --verbose

第4步-启用实时处理此步骤需要libncurses-dev

Step 4 - Enable realtime processingThis step requires libncurses-dev

sudo apt-get install libncurses-dev libssl-dev

下一条命令将在终端中启动图形菜单以生成配置文件.

The next command launches a graphical menu in the terminal to generate the config file.

make menuconfig

转到该位置并进行相应的更改

Go to the location and make the changes accordingly

##Graphical Menu##

Processor type and features ---> [Enter]
Preemption Model (Voluntary Kernel Preemption (Desktop)) [Enter]
Fully Preemptible Kernel (RT) [Enter] #Select

[Esc][Esc]

Kernel hacking --> [Enter]
Memory Debugging [Enter]
Check for stack overflows #Already deselected - do not select


[Esc][Esc]


[Right Arrow][Right Arrow]

<Save> [Enter]

.config

<Okay> [Enter]

<Exit> [Enter]


[Esc][Esc]


[Right Arrow]
<Exit> [Enter]

第5步-编译内核

make -j20
sudo make modules_install -j20
sudo make install -j20

第6步-验证并更新验证是否在/boot目录中生成了initrd.img-4.9.115-rt93,vmlinuz-4.9.115-rt93和config-4.9.115-rt93并更新了grub.

Step 6 - Verify and updateVerify that initrd.img-4.9.115-rt93, vmlinuz-4.9.115-rt93, and config-4.9.115-rt93 are generated in /boot directory and update the grub.

cd /boot
ls
sudo update-grub

验证/boot/grub/grub.cfg文件中是否存在包含文本"menuentry'Ubuntu,带有Linux 4.9.115-rt93'"的菜单项

Verify that there is a menuentry containing the text "menuentry 'Ubuntu, with Linux 4.9.115-rt93'" in /boot/grub/grub.cfg file

要在grub中更改默认内核,请将/etc/default/grub中的GRUB_DEFAULT值编辑为所需的内核.

To change default kernel in grub, edit the GRUB_DEFAULT value in /etc/default/grub to your desired kernel.

注意::0是第一个菜单项

7-重新启动并验证

sudo reboot

系统重新启动后,打开终端并使用uname -a检查内核版本,它应类似于以下内容

Once the system reboots, open the terminal and use uname -a to check the kernel version, it should look like the following

Linux abhay-home 4.9.115-rt93 #1 SMP PREEMPT RT Mon May 13 03:32:57 EDT 2019 x86_64 x86_64 x86_64 GNU/Linux

注意:"SMP PREEMPT RT"验证您的系统正在运行实时内核.

Note: "SMP PREEMPT RT" validates that your system is running real time kernel.

这篇关于为Ubuntu安装RT Linux补丁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 15:36
查看更多