为 Ubuntu 安装 RT Linux 补丁 [英] Install RT Linux patch for Ubuntu
问题描述
试图通过修补/安装 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 processing This 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 update Verify 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, with 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 补丁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!