前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Ubuntu / Linux 实时内核 RT Preempt 安装-Ubuntu18.04 内核

Ubuntu / Linux 实时内核 RT Preempt 安装-Ubuntu18.04 内核

原创
作者头像
ZC_Robot机器人技术
发布2020-09-03 09:52:15
5.2K0
发布2020-09-03 09:52:15
举报

1 安装依赖项

sudo apt install build-essential git libssl-dev libelf-dev

2 下载内核源码以及 实时内核模块

wget https://mirrors.edge.kernel.org/pub/linux/kernel/v5.x/linux-5.4.19.tar.xz

wget https://mirrors.edge.kernel.org/pub/linux/kernel/projects/rt/5.4/patch-5.4.19-rt11.patch.xz

解压缩

xz -cd linux-5.4.19.tar.xz | tar xvf -

cd linux-5.4.19

xzcat ../patch-5.4.19-rt11.patch.xz | patch -p1

3 配置实时模块

cp /boot/config-5.3.0-40-generic .config

make oldconfig

Preemption Model

1. No Forced Preemption (Server) (PREEMPT_NONE)

2. Voluntary Kernel Preemption (Desktop) (PREEMPT_VOLUNTARY)

3. Preemptible Kernel (Low-Latency Desktop) (PREEMPT__LL) (NEW)

4. Preemptible Kernel (Basic RT) (PREEMPT_RTB) (NEW)

> 5. Fully Preemptible Kernel (RT) (PREEMPT_RT_FULL) (NEW)

选择“5. Fully Preemptible Kernel (RT) (PREEMPT_RT_FULL) (NEW)”

此处也可以采用make menuconfig,实现可以安装依赖 sudo apt install flex bison

4 编译

make -j8 deb-pkg

sudo dpkg -i ../linux-headers-5.4.19-rt11_5.4.19-rt11-1_amd64.deb ../linux-image-5.4.19-rt11_5.4.19-rt11-1_amd64.deb ../linux-libc-dev_5.4.19-rt11-1_amd64.deb

5 Reboot 并且验证

uname -a

6 安全设置

Add your user to realtime group

$ sudo groupadd realtime

$ sudo usermod -aG realtime $USER

add the following to /etc/security/limits.d/99-realtime.conf

$ sudo nano /etc/security/limits.d/99-realtime.conf

@realtime soft rtprio 99

@realtime soft priority 99

@realtime soft memlock 102400

@realtime hard rtprio 99

@realtime hard priority 99

@realtime hard memlock 102400

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 1 安装依赖项
  • 2 下载内核源码以及 实时内核模块
  • 3 配置实时模块
  • 4 编译
  • 5 Reboot 并且验证
  • 6 安全设置
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档